diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-12-21 01:15:32 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-12-21 01:15:32 +0000 |
commit | ccf614c479ac93326a01e7b373b30759eed7807f (patch) | |
tree | 8af2d4c99e847f1a111494fdce59386d2c345a0e | |
parent | 97e0179f1ae545e07d9f5e7c1d2ef5c5bab06676 (diff) |
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
-rw-r--r-- | lib/CodeGen/CGStmt.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 = |