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
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 6536d9f..24f536f 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -1414,7 +1414,7 @@
   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))