Use StringRef for MemoryBuffer identifier API (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283043 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mehdi Amini
2016-10-01 16:38:28 +00:00
parent 089e03e79a
commit 793d2a4ced
5 changed files with 9 additions and 11 deletions
+5 -5
View File
@@ -90,9 +90,9 @@ public:
/// tail-allocated data.
void operator delete(void *p) { ::operator delete(p); }
const char *getBufferIdentifier() const override {
// The name is stored after the class itself.
return reinterpret_cast<const char*>(this + 1);
StringRef getBufferIdentifier() const override {
// The name is stored after the class itself.
return StringRef(reinterpret_cast<const char *>(this + 1));
}
BufferKind getBufferKind() const override {
@@ -221,9 +221,9 @@ public:
/// tail-allocated data.
void operator delete(void *p) { ::operator delete(p); }
const char *getBufferIdentifier() const override {
StringRef getBufferIdentifier() const override {
// The name is stored after the class itself.
return reinterpret_cast<const char *>(this + 1);
return StringRef(reinterpret_cast<const char *>(this + 1));
}
BufferKind getBufferKind() const override {