]> granicus.if.org Git - clang/commitdiff
Fix for PR3246: an empty clobber list is the empty string, not a null
authorEli Friedman <eli.friedman@gmail.com>
Sun, 21 Dec 2008 01:15:32 +0000 (01:15 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Sun, 21 Dec 2008 01:15:32 +0000 (01:15 +0000)
string.

That said, we should probably try and track down the correct clobber
lists for the targets that don't have them (PPC, ARM, and Sparc),
so that we can generate correct code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61298 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGStmt.cpp

index f84f6a630f39f5216dacdc89bc5f225e7707ae8c..794d7cb272a83689c4521dc4bc9ae02e116cedb8 100644 (file)
@@ -1004,10 +1004,11 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
   }
   
   // Add machine specific clobbers
-  if (const char *C = Target.getClobbers()) {
+  std::string MachineClobbers = Target.getClobbers();
+  if (!MachineClobbers.empty()) {
     if (!Constraints.empty())
       Constraints += ',';
-    Constraints += C;
+    Constraints += MachineClobbers;
   }
     
   const llvm::FunctionType *FTy =