diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-04-28 17:37:06 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-04-28 17:37:06 +0000 |
commit | e2435da8abe5ca62c7f08f29c242b6b98e0ec7af (patch) | |
tree | 66e5cc5aa713285dde8e0d76592f695810cd847a /include | |
parent | 1f13c686df75ddbbe15b208606ece4846d7479a8 (diff) | |
download | external_llvm-e2435da8abe5ca62c7f08f29c242b6b98e0ec7af.zip external_llvm-e2435da8abe5ca62c7f08f29c242b6b98e0ec7af.tar.gz external_llvm-e2435da8abe5ca62c7f08f29c242b6b98e0ec7af.tar.bz2 |
Expose parameter attributes via C bindings.
Patch by Anders Johnsen!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm-c/Core.h | 22 | ||||
-rw-r--r-- | include/llvm/Argument.h | 7 |
2 files changed, 29 insertions, 0 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index b536bf5..d1251dc 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -83,6 +83,20 @@ typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef; typedef struct LLVMOpaquePassManager *LLVMPassManagerRef; typedef enum { + LLVMZExtParamAttr = 1<<0, + LLVMSExtParamAttr = 1<<1, + LLVMNoReturnParamAttr = 1<<2, + LLVMNoUnwindParamAttr = 1<<3, + LLVMInRegParamAttr = 1<<4, + LLVMNoAliasParamAttr = 1<<5, + LLVMStructRetParamAttr = 1<<6, + LLVMByValParamAttr = 1<<7, + LLVMNestParamAttr = 1<<8, + LLVMReadNoneParamAttr = 1<<9, + LLVMReadOnlyParamAttr = 1<<10 +} LLVMParamAttr; + +typedef enum { LLVMVoidTypeKind, /**< type with no size */ LLVMFloatTypeKind, /**< 32 bit floating point type */ LLVMDoubleTypeKind, /**< 64 bit floating point type */ @@ -413,6 +427,9 @@ LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn); LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn); LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg); LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg); +void LLVMAddParamAttr(LLVMValueRef Arg, LLVMParamAttr PA); +void LLVMRemoveParamAttr(LLVMValueRef Arg, LLVMParamAttr PA); +void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align); /* Operations on basic blocks */ LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB); @@ -441,6 +458,11 @@ LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst); /* Operations on call sites */ void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC); unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr); +void LLVMAddInstrParamAttr(LLVMValueRef Instr, unsigned index, LLVMParamAttr); +void LLVMRemoveInstrParamAttr(LLVMValueRef Instr, unsigned index, + LLVMParamAttr); +void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, + unsigned align); /* Operations on phi nodes */ void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, diff --git a/include/llvm/Argument.h b/include/llvm/Argument.h index 23d1a08..d203a93 100644 --- a/include/llvm/Argument.h +++ b/include/llvm/Argument.h @@ -15,6 +15,7 @@ #define LLVM_ARGUMENT_H #include "llvm/Value.h" +#include "llvm/ParameterAttributes.h" namespace llvm { @@ -60,7 +61,13 @@ public: /// hasSRetAttr - Return true if this argument has the sret attribute on it in /// its containing function. bool hasStructRetAttr() const; + + /// addAttr - Add a ParamAttr to an argument + void addAttr(ParameterAttributes); + /// removeAttr - Remove a ParamAttr from an argument + void removeAttr(ParameterAttributes); + virtual void print(std::ostream &OS) const; void print(std::ostream *OS) const { if (OS) print(*OS); |