diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-31 01:22:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-31 01:22:29 +0000 |
commit | 5d0cacdbb6577f2449986f345858db17dc1bcf59 (patch) | |
tree | de365f7b73e384392ca19f8cb9bc0c9600712003 /include | |
parent | b76359e36e75dfe16c5153c3cac903efbb2cd8d7 (diff) | |
download | external_llvm-5d0cacdbb6577f2449986f345858db17dc1bcf59.zip external_llvm-5d0cacdbb6577f2449986f345858db17dc1bcf59.tar.gz external_llvm-5d0cacdbb6577f2449986f345858db17dc1bcf59.tar.bz2 |
rename "elements" of metadata to "operands". "Elements" are
things that occur in types. "operands" are things that occur
in values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/DebugInfo.h | 8 | ||||
-rw-r--r-- | include/llvm/IntrinsicInst.h | 8 | ||||
-rw-r--r-- | include/llvm/Metadata.h | 40 |
3 files changed, 28 insertions, 28 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index 252e388..f3d1b59 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/include/llvm/Analysis/DebugInfo.h @@ -369,19 +369,19 @@ namespace llvm { unsigned isDefinition() const { return getUnsignedField(10); } unsigned getVirtuality() const { - if (DbgNode->getNumElements() < 14) + if (DbgNode->getNumOperands() < 14) return 0; return getUnsignedField(11); } unsigned getVirtualIndex() const { - if (DbgNode->getNumElements() < 14) + if (DbgNode->getNumOperands() < 14) return 0; return getUnsignedField(12); } DICompositeType getContainingType() const { - assert (DbgNode->getNumElements() >= 14 && "Invalid type!"); + assert (DbgNode->getNumOperands() >= 14 && "Invalid type!"); return getFieldAs<DICompositeType>(13); } @@ -439,7 +439,7 @@ namespace llvm { return getNumAddrElements() > 0; } - unsigned getNumAddrElements() const { return DbgNode->getNumElements()-6; } + unsigned getNumAddrElements() const { return DbgNode->getNumOperands()-6; } uint64_t getAddrElement(unsigned Idx) const { return getUInt64Field(Idx+6); diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h index a516409..9893e1f 100644 --- a/include/llvm/IntrinsicInst.h +++ b/include/llvm/IntrinsicInst.h @@ -98,8 +98,8 @@ namespace llvm { return unsigned(cast<ConstantInt>(getOperand(2))->getZExtValue()); } - Value* getFileName() const; - Value* getDirectory() const; + Value *getFileName() const; + Value *getDirectory() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DbgStopPointInst *) { return true; } @@ -175,8 +175,8 @@ namespace llvm { /// DbgValueInst - This represents the llvm.dbg.value instruction. /// struct DbgValueInst : public DbgInfoIntrinsic { - Value *getValue() const { - return cast<MDNode>(getOperand(1))->getElement(0); + Value *getValue() const { + return cast<MDNode>(getOperand(1))->getOperand(0); } Value *getOffset() const { return getOperand(2); } MDNode *getVariable() const { return cast<MDNode>(getOperand(3)); } diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index 967a09a..ec6ba1b 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -26,7 +26,10 @@ class Instruction; class LLVMContext; class Module; template <typename T> class SmallVectorImpl; - +template<typename ValueSubClass, typename ItemParentClass> + class SymbolTableListTraits; + + //===----------------------------------------------------------------------===// // MetadataBase - A base class for MDNode, MDString and NamedMDNode. class MetadataBase : public Value { @@ -81,16 +84,16 @@ public: }; -class MDNodeElement; +class MDNodeOperand; //===----------------------------------------------------------------------===// /// MDNode - a tuple of other values. class MDNode : public MetadataBase, public FoldingSetNode { MDNode(const MDNode &); // DO NOT IMPLEMENT void operator=(const MDNode &); // DO NOT IMPLEMENT - friend class MDNodeElement; + friend class MDNodeOperand; - /// NumOperands - This many 'MDNodeElement' items are co-allocated onto the + /// NumOperands - This many 'MDNodeOperand' items are co-allocated onto the /// end of this MDNode. unsigned NumOperands; @@ -110,8 +113,8 @@ class MDNode : public MetadataBase, public FoldingSetNode { DestroyFlag = 1 << 2 }; - // Replace each instance of F from the element list of this node with T. - void replaceElement(MDNodeElement *Op, Value *NewVal); + // Replace each instance of F from the operand list of this node with T. + void replaceOperand(MDNodeOperand *Op, Value *NewVal); ~MDNode(); protected: @@ -122,11 +125,11 @@ public: static MDNode *get(LLVMContext &Context, Value *const *Vals, unsigned NumVals, bool isFunctionLocal = false); - /// getElement - Return specified element. - Value *getElement(unsigned i) const; + /// getOperand - Return specified operand. + Value *getOperand(unsigned i) const; - /// getNumElements - Return number of MDNode elements. - unsigned getNumElements() const { return NumOperands; } + /// getNumOperands - Return number of MDNode operands. + unsigned getNumOperands() const { return NumOperands; } /// isFunctionLocal - Return whether MDNode is local to a function. /// Note: MDNodes are designated as function-local when created, and keep @@ -165,10 +168,7 @@ private: //===----------------------------------------------------------------------===// /// NamedMDNode - a tuple of other metadata. -/// NamedMDNode is always named. All NamedMDNode element has a type of metadata. -template<typename ValueSubClass, typename ItemParentClass> - class SymbolTableListTraits; - +/// NamedMDNode is always named. All NamedMDNode operand has a type of metadata. class NamedMDNode : public MetadataBase, public ilist_node<NamedMDNode> { friend class SymbolTableListTraits<NamedMDNode, Module>; friend class LLVMContextImpl; @@ -205,14 +205,14 @@ public: inline Module *getParent() { return Parent; } inline const Module *getParent() const { return Parent; } - /// getElement - Return specified element. - MetadataBase *getElement(unsigned i) const; + /// getOperand - Return specified operand. + MetadataBase *getOperand(unsigned i) const; - /// getNumElements - Return number of NamedMDNode elements. - unsigned getNumElements() const; + /// getNumOperands - Return the number of NamedMDNode operands. + unsigned getNumOperands() const; - /// addElement - Add metadata element. - void addElement(MetadataBase *M); + /// addOperand - Add metadata operand. + void addOperand(MetadataBase *M); /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const NamedMDNode *) { return true; } |