aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/StringMap.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-14 18:31:43 +0000
committerChris Lattner <sabre@nondot.org>2011-07-14 18:31:43 +0000
commitd7c027322ebccd9666c3f46d9a5236ba76fda434 (patch)
tree6a38fd534fb91d40d986508cbe090e71696c770c /include/llvm/ADT/StringMap.h
parent154c535888e41a0ee822a2ff76edc57ef91c7aeb (diff)
downloadexternal_llvm-d7c027322ebccd9666c3f46d9a5236ba76fda434.tar.gz
external_llvm-d7c027322ebccd9666c3f46d9a5236ba76fda434.tar.bz2
external_llvm-d7c027322ebccd9666c3f46d9a5236ba76fda434.zip
The key of a StringMap can contain nul's in it, so having first() return
const char* doesn't make sense. Have it return StringRef instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135167 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringMap.h')
-rw-r--r--include/llvm/ADT/StringMap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h
index 95c973bcc9..3507787935 100644
--- a/include/llvm/ADT/StringMap.h
+++ b/include/llvm/ADT/StringMap.h
@@ -140,7 +140,7 @@ public:
/// StringMapEntry object.
const char *getKeyData() const {return reinterpret_cast<const char*>(this+1);}
- const char *first() const { return getKeyData(); }
+ StringRef first() const { return StringRef(getKeyData(), getKeyLength()); }
/// Create - Create a StringMapEntry for the specified key and default
/// construct the value.