aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-07-23 02:00:51 +0000
committerDevang Patel <dpatel@apple.com>2009-07-23 02:00:51 +0000
commit5417dcf1695dc0d3169d3fb69d5481a483c914c6 (patch)
tree05f0d304147132f0a0c1ac6da9be0895790ffa32 /include/llvm
parentaf884c861164d93eab5f44b0bd86b30fa7297c3c (diff)
downloadexternal_llvm-5417dcf1695dc0d3169d3fb69d5481a483c914c6.zip
external_llvm-5417dcf1695dc0d3169d3fb69d5481a483c914c6.tar.gz
external_llvm-5417dcf1695dc0d3169d3fb69d5481a483c914c6.tar.bz2
MDString
- Rename member function size(). New name is length(). - Store string beginning and length. Earlier it used to store string end. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76841 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/LLVMContext.h2
-rw-r--r--include/llvm/MDNode.h11
2 files changed, 7 insertions, 6 deletions
diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h
index 134311e..0751ccd 100644
--- a/include/llvm/LLVMContext.h
+++ b/include/llvm/LLVMContext.h
@@ -232,7 +232,7 @@ public:
MDNode* getMDNode(Value* const* Vals, unsigned NumVals);
// MDString accessors
- MDString* getMDString(const char *StrBegin, const char *StrEnd);
+ MDString* getMDString(const char *StrBegin, unsigned Length);
MDString* getMDString(const std::string &Str);
// FunctionType accessors
diff --git a/include/llvm/MDNode.h b/include/llvm/MDNode.h
index 14bfe57..06cc909 100644
--- a/include/llvm/MDNode.h
+++ b/include/llvm/MDNode.h
@@ -64,16 +64,17 @@ public:
///
class MDString : public MetadataBase {
MDString(const MDString &); // DO NOT IMPLEMENT
- const char *StrBegin, *StrEnd;
+ const char *StrBegin;
+ unsigned StrLength;
friend class LLVMContextImpl;
protected:
- explicit MDString(const char *begin, const char *end)
+ explicit MDString(const char *begin, unsigned l)
: MetadataBase(Type::MetadataTy, Value::MDStringVal),
- StrBegin(begin), StrEnd(end) {}
+ StrBegin(begin), StrLength(l) {}
public:
- intptr_t size() const { return StrEnd - StrBegin; }
+ unsigned length() const { return StrLength; }
/// begin() - Pointer to the first byte of the string.
///
@@ -81,7 +82,7 @@ public:
/// end() - Pointer to one byte past the end of the string.
///
- const char *end() const { return StrEnd; }
+ const char *end() const { return StrBegin + length(); }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const MDString *) { return true; }