]> granicus.if.org Git - clang/commitdiff
StringRefize and take out an old FIXME
authorAlp Toker <alp@nuanti.com>
Mon, 5 May 2014 12:38:48 +0000 (12:38 +0000)
committerAlp Toker <alp@nuanti.com>
Mon, 5 May 2014 12:38:48 +0000 (12:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207962 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h
include/clang/AST/Type.h
lib/AST/Type.cpp
lib/Sema/SemaDeclCXX.cpp

index 443ac2782af522118b3689fe2ac14662198a6290..f854118d04e43facff0bfd9e0a01e7e1b3fe1caa 100644 (file)
@@ -2693,8 +2693,7 @@ public:
     IsCompleteDefinitionRequired = V;
   }
 
-  // FIXME: Return StringRef;
-  const char *getKindName() const {
+  StringRef getKindName() const {
     return TypeWithKeyword::getTagTypeKindName(getTagKind());
   }
 
index 001a87ec28344ff0869b7d320491b927a4123458..45a0c2e689be7099ebbdb909cfdc94bd52a6ef65 100644 (file)
@@ -3980,9 +3980,9 @@ public:
 
   static bool KeywordIsTagTypeKind(ElaboratedTypeKeyword Keyword);
 
-  static const char *getKeywordName(ElaboratedTypeKeyword Keyword);
+  static StringRef getKeywordName(ElaboratedTypeKeyword Keyword);
 
-  static const char *getTagTypeKindName(TagTypeKind Kind) {
+  static StringRef getTagTypeKindName(TagTypeKind Kind) {
     return getKeywordName(getKeywordForTagTypeKind(Kind));
   }
 
index dc3fcc8c78b2ac6a98e6def1fa7b5f55392a189f..e9002b4e87394f1239aaf9f145c5ed195fab93c4 100644 (file)
@@ -1431,8 +1431,7 @@ TypeWithKeyword::KeywordIsTagTypeKind(ElaboratedTypeKeyword Keyword) {
   llvm_unreachable("Unknown elaborated type keyword.");
 }
 
-const char*
-TypeWithKeyword::getKeywordName(ElaboratedTypeKeyword Keyword) {
+StringRef TypeWithKeyword::getKeywordName(ElaboratedTypeKeyword Keyword) {
   switch (Keyword) {
   case ETK_None: return "";
   case ETK_Typename: return "typename";
index 34954a8eeb8a3ac4c4544d91fad4f5c3cb531554..54a332aa99eb996d93d79ec57b27ecc72f7b24ab 100644 (file)
@@ -11390,9 +11390,10 @@ FriendDecl *Sema::CheckFriendTypeDecl(SourceLocation LocStart,
       // a tag in front.
       if (const RecordType *RT = T->getAs<RecordType>()) {
         RecordDecl *RD = RT->getDecl();
-      
-        std::string InsertionText = std::string(" ") + RD->getKindName();
-      
+
+        SmallString<16> InsertionText(" ");
+        InsertionText += RD->getKindName();
+
         Diag(TypeRange.getBegin(),
              getLangOpts().CPlusPlus11 ?
                diag::warn_cxx98_compat_unelaborated_friend_type :