diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2013-09-16 01:08:15 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2013-09-16 01:08:15 +0000 |
commit | 1e3037f0be430ef2339838bbdede11f45658bd82 (patch) | |
tree | 685847478f3c9e31c3e1fa7f63f5f605e5f43f80 /include | |
parent | fabfb5d5880354983c89c6f475312dd359e5bb03 (diff) | |
download | external_llvm-1e3037f0be430ef2339838bbdede11f45658bd82.zip external_llvm-1e3037f0be430ef2339838bbdede11f45658bd82.tar.gz external_llvm-1e3037f0be430ef2339838bbdede11f45658bd82.tar.bz2 |
Implement function prefix data as an IR feature.
Previous discussion:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html
Differential Revision: http://llvm-reviews.chandlerc.com/D1191
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190773 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/Function.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h index 0e51c6f..bba7ecd 100644 --- a/include/llvm/IR/Function.h +++ b/include/llvm/IR/Function.h @@ -159,11 +159,11 @@ public: /// calling convention of this function. The enum values for the known /// calling conventions are defined in CallingConv.h. CallingConv::ID getCallingConv() const { - return static_cast<CallingConv::ID>(getSubclassDataFromValue() >> 1); + return static_cast<CallingConv::ID>(getSubclassDataFromValue() >> 2); } void setCallingConv(CallingConv::ID CC) { - setValueSubclassData((getSubclassDataFromValue() & 1) | - (static_cast<unsigned>(CC) << 1)); + setValueSubclassData((getSubclassDataFromValue() & 3) | + (static_cast<unsigned>(CC) << 2)); } /// @brief Return the attribute list for this Function. @@ -427,6 +427,13 @@ public: size_t arg_size() const; bool arg_empty() const; + bool hasPrefixData() const { + return getSubclassDataFromValue() & 2; + } + + Constant *getPrefixData() const; + void setPrefixData(Constant *PrefixData); + /// viewCFG - This function is meant for use from the debugger. You can just /// say 'call F->viewCFG()' and a ghostview window should pop up from the /// program, displaying the CFG of the current function with the code for each |