diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Bitcode/LLVMBitCodes.h | 9 | ||||
-rw-r--r-- | include/llvm/Metadata.h | 18 |
2 files changed, 21 insertions, 6 deletions
diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/LLVMBitCodes.h index c037399b96..9bb50d4b3b 100644 --- a/include/llvm/Bitcode/LLVMBitCodes.h +++ b/include/llvm/Bitcode/LLVMBitCodes.h @@ -111,10 +111,11 @@ namespace bitc { enum MetadataCodes { METADATA_STRING = 1, // MDSTRING: [values] METADATA_NODE = 2, // MDNODE: [n x (type num, value num)] - METADATA_NAME = 3, // STRING: [values] - METADATA_NAMED_NODE = 4, // NAMEDMDNODE: [n x mdnodes] - METADATA_KIND = 5, // [n x [id, name]] - METADATA_ATTACHMENT = 6 // [m x [value, [n x [id, mdnode]]] + METADATA_FN_NODE = 3, // FN_MDNODE: [n x (type num, value num)] + METADATA_NAME = 4, // STRING: [values] + METADATA_NAMED_NODE = 5, // NAMEDMDNODE: [n x mdnodes] + METADATA_KIND = 6, // [n x [id, name]] + METADATA_ATTACHMENT = 7 // [m x [value, [n x [id, mdnode]]] }; // The constants block (CONSTANTS_BLOCK_ID) describes emission for each // constant and maintains an implicit current type value. diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index 4d4e4999e9..282ee85e58 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -112,6 +112,13 @@ class MDNode : public MetadataBase, public FoldingSetNode { DestroyFlag = 1 << 2 }; + // FunctionLocal enums. + enum FunctionLocalness { + FL_Unknown = -1, + FL_No = 0, + FL_Yes = 1 + }; + // Replace each instance of F from the operand list of this node with T. void replaceOperand(MDNodeOperand *Op, Value *NewVal); ~MDNode(); @@ -119,10 +126,17 @@ class MDNode : public MetadataBase, public FoldingSetNode { protected: explicit MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals, bool isFunctionLocal); + + static MDNode *getMDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals, + FunctionLocalness FL); public: // Constructors and destructors. - static MDNode *get(LLVMContext &Context, Value *const *Vals, unsigned NumVals, - bool isFunctionLocal = false); + static MDNode *get(LLVMContext &Context, Value *const *Vals, + unsigned NumVals); + // getWhenValsUnresolved - Construct MDNode determining function-localness + // from isFunctionLocal argument, not by analyzing Vals. + static MDNode *getWhenValsUnresolved(LLVMContext &Context, Value *const *Vals, + unsigned NumVals, bool isFunctionLocal); /// getOperand - Return specified operand. Value *getOperand(unsigned i) const; |