diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-05 04:20:28 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-05 04:20:28 +0000 |
commit | 27a00970bf4ababdc115e54383e6252cc3276dfa (patch) | |
tree | 7cf3a0cd7845b5c8b909b047108e54f7a15b747f /lib/Sema/SemaCodeComplete.cpp | |
parent | ab41fe914f63bb470dfa7e400876ada72f57a931 (diff) |
Make BuiltinType::getName return a StringRef and introduce BuiltinType::getNameAsCString
to get a const char* if necessary.
This avoids unnecessary conversions when we want to use the result of getName as
a StringRef.
Part of rdar://10796159
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 6536d9f522..24f536fa06 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -1414,7 +1414,7 @@ static const char *GetCompletionTypeString(QualType T, if (!T.getLocalQualifiers()) { // Built-in type names are constant strings. if (const BuiltinType *BT = dyn_cast<BuiltinType>(T)) - return BT->getName(Policy); + return BT->getNameAsCString(Policy); // Anonymous tag types are constant strings. if (const TagType *TagT = dyn_cast<TagType>(T)) |