diff options
author | Devang Patel <dpatel@apple.com> | 2008-09-23 22:35:17 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-09-23 22:35:17 +0000 |
commit | d9b4a5f859188cbb168c223071b413e58c53c925 (patch) | |
tree | 04fec821fbc9cdc4f37ab86adc1dcfeb3243d644 /include/llvm/Function.h | |
parent | b2c3e3fdd9987fc2d08eb8f7892db2cbc7ec74d9 (diff) |
Use parameter attribute store (soon to be renamed) for
Function Notes also. Function notes are stored at index ~0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56511 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Function.h')
-rw-r--r-- | include/llvm/Function.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 3aef7c5da9..fea9e0fc48 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -51,12 +51,6 @@ template<> struct ilist_traits<Argument> static int getListOffset(); }; -typedef unsigned FunctionNotes; -const FunctionNotes FN_NOTE_None = 0; -const FunctionNotes FN_NOTE_NoInline = 1<<0; -const FunctionNotes FN_NOTE_AlwaysInline = 1<<1; -const FunctionNotes FN_NOTE_OptimizeForSize = 1<<2; - class Function : public GlobalValue, public Annotable, public ilist_node<Function> { public: @@ -76,7 +70,6 @@ private: mutable ArgumentListType ArgumentList; ///< The formal arguments ValueSymbolTable *SymTab; ///< Symbol table of args/instructions PAListPtr ParamAttrs; ///< Parameter attributes - FunctionNotes Notes; ///< Function properties // The Calling Convention is stored in Value::SubclassData. /*unsigned CallingConvention;*/ @@ -155,18 +148,19 @@ public: /// void setParamAttrs(const PAListPtr &attrs) { ParamAttrs = attrs; } - /// getNotes - Return function notes - /// - const FunctionNotes &getNotes() const { return Notes; } /// hasNote - Return true if this function has given note. - bool hasNote(FunctionNotes N) const { - return (!isDeclaration() && (Notes & N)); + bool hasNote(ParameterAttributes N) const { + // Notes are stored at ~0 index in parameter attribute list + return (!isDeclaration() && paramHasAttr(~0, N)); } /// setNotes - Set notes for this function /// - void setNotes(const FunctionNotes P) { Notes = Notes | P;} + void setNotes(const ParameterAttributes N) { + // Notes are stored at ~0 index in parameter attribute list + addParamAttr(~0, N); + } /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm /// to use during code generation. |