[cfe-commits] r91119 - in /cfe/trunk/lib: CodeGen/CGCXX.cpp CodeGen/CodeGenModule.cpp Sema/SemaDeclCXX.cpp

Benjamin Kramer benny.kra at googlemail.com
Fri Dec 11 05:33:20 PST 2009


Author: d0k
Date: Fri Dec 11 07:33:18 2009
New Revision: 91119

URL: http://llvm.org/viewvc/llvm-project?rev=91119&view=rev
Log:
Random string-related cleanups.

Modified:
    cfe/trunk/lib/CodeGen/CGCXX.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=91119&r1=91118&r2=91119&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Fri Dec 11 07:33:18 2009
@@ -479,10 +479,9 @@
   const llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FI, false);
   llvm::Function *Fn =
     llvm::Function::Create(FTy, llvm::GlobalValue::InternalLinkage,
-                           Name.c_str(),
+                           Name.str(),
                            &CGM.getModule());
-  IdentifierInfo *II
-    = &CGM.getContext().Idents.get(Name.c_str());
+  IdentifierInfo *II = &CGM.getContext().Idents.get(Name.str());
   FunctionDecl *FD = FunctionDecl::Create(getContext(),
                                           getContext().getTranslationUnitDecl(),
                                           SourceLocation(), II, R, 0,

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=91119&r1=91118&r2=91119&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Fri Dec 11 07:33:18 2009
@@ -1689,14 +1689,13 @@
 
   case Decl::FileScopeAsm: {
     FileScopeAsmDecl *AD = cast<FileScopeAsmDecl>(D);
-    std::string AsmString(AD->getAsmString()->getStrData(),
-                          AD->getAsmString()->getByteLength());
+    llvm::StringRef AsmString = AD->getAsmString()->getString();
 
     const std::string &S = getModule().getModuleInlineAsm();
     if (S.empty())
       getModule().setModuleInlineAsm(AsmString);
     else
-      getModule().setModuleInlineAsm(S + '\n' + AsmString);
+      getModule().setModuleInlineAsm(S + '\n' + AsmString.str());
     break;
   }
 

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=91119&r1=91118&r2=91119&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri Dec 11 07:33:18 2009
@@ -4941,10 +4941,8 @@
     }
 
     if (Value == 0) {
-      std::string str(AssertMessage->getStrData(),
-                      AssertMessage->getByteLength());
       Diag(AssertLoc, diag::err_static_assert_failed)
-        << str << AssertExpr->getSourceRange();
+        << AssertMessage->getString() << AssertExpr->getSourceRange();
     }
   }
 





More information about the cfe-commits mailing list