From: Eli Friedman Date: Sun, 21 Dec 2008 01:15:32 +0000 (+0000) Subject: Fix for PR3246: an empty clobber list is the empty string, not a null X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ccf614c479ac93326a01e7b373b30759eed7807f;p=clang Fix for PR3246: an empty clobber list is the empty string, not a null 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 --- diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index f84f6a630f..794d7cb272 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -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 =