void resizeOperands(unsigned NumOps);
public:
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue. This always returns false because getNullValue will never
- /// produce metadata.
- virtual bool isNullValue() const {
- return false;
- }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const MetadataBase *) { return true; }
StringRef getString() const { return Str; }
- unsigned length() const { return Str.size(); }
+ unsigned getLength() const { return Str.size(); }
+ typedef StringRef::iterator iterator;
+
/// begin() - Pointer to the first byte of the string.
///
- const char *begin() const { return Str.begin(); }
+ iterator begin() const { return Str.begin(); }
/// end() - Pointer to one byte past the end of the string.
///
- const char *end() const { return Str.end(); }
+ iterator end() const { return Str.end(); }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const MDString *) { return true; }
SmallVector<ElementVH, 4> Node;
protected:
- explicit MDNode(LLVMContext &C, Value*const* Vals, unsigned NumVals);
+ explicit MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals);
public:
// Do not allocate any space for operands.
void *operator new(size_t s) {
}
// Constructors and destructors.
static MDNode *get(LLVMContext &Context,
- Value* const* Vals, unsigned NumVals);
+ Value *const *Vals, unsigned NumVals);
/// dropAllReferences - Remove all uses and clear node vector.
void dropAllReferences();
/// getElement - Return specified element.
Value *getElement(unsigned i) const {
- assert (getNumElements() > i && "Invalid element number!");
+ assert(getNumElements() > i && "Invalid element number!");
return Node[i];
}
elem_iterator elem_begin() { return Node.begin(); }
elem_iterator elem_end() { return Node.end(); }
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue. This always returns false because getNullValue will never
- /// produce metadata.
- virtual bool isNullValue() const {
- return false;
- }
-
/// Profile - calculate a unique identifier for this MDNode to collapse
/// duplicates
void Profile(FoldingSetNodeID &ID) const;
- virtual void replaceUsesOfWithOnConstant(Value *, Value *, Use *) {
- llvm_unreachable("This should never be called because MDNodes have no ops");
- }
-
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const MDNode *) { return true; }
static bool classof(const Value *V) {
typedef SmallVectorImpl<WeakMetadataVH>::iterator elem_iterator;
protected:
- explicit NamedMDNode(LLVMContext &C, const Twine &N, MetadataBase*const* Vals,
+ explicit NamedMDNode(LLVMContext &C, const Twine &N, MetadataBase*const *Vals,
unsigned NumVals, Module *M = 0);
public:
// Do not allocate any space for operands.
return User::operator new(s, 0);
}
static NamedMDNode *Create(LLVMContext &C, const Twine &N,
- MetadataBase*const*MDs,
+ MetadataBase *const *MDs,
unsigned NumMDs, Module *M = 0) {
return new NamedMDNode(C, N, MDs, NumMDs, M);
}
/// getElement - Return specified element.
MetadataBase *getElement(unsigned i) const {
- assert (getNumElements() > i && "Invalid element number!");
+ assert(getNumElements() > i && "Invalid element number!");
return Node[i];
}
elem_iterator elem_begin() { return Node.begin(); }
elem_iterator elem_end() { return Node.end(); }
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue. This always returns false because getNullValue will never
- /// produce metadata.
- virtual bool isNullValue() const {
- return false;
- }
-
- virtual void replaceUsesOfWithOnConstant(Value *, Value *, Use *) {
- llvm_unreachable(
- "This should never be called because NamedMDNodes have no ops");
- }
-
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const NamedMDNode *) { return true; }
static bool classof(const Value *V) {