diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2006-11-28 22:25:32 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2006-11-28 22:25:32 +0000 |
commit | 85f222845429bbab2b3a03ef9e6cd19f7f7654e2 (patch) | |
tree | 79c0d7d31f02e4842a1ec10a6c620a5ec3ccb3ec | |
parent | b5ebf15b2b2ce8989caf1a1114b05d80b0f9bd48 (diff) | |
download | external_llvm-85f222845429bbab2b3a03ef9e6cd19f7f7654e2.zip external_llvm-85f222845429bbab2b3a03ef9e6cd19f7f7654e2.tar.gz external_llvm-85f222845429bbab2b3a03ef9e6cd19f7f7654e2.tar.bz2 |
Make identity default, and fix PR1020
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31979 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 10 | ||||
-rw-r--r-- | lib/Target/CBackend/Writer.cpp | 10 |
2 files changed, 6 insertions, 14 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 18c4d06..89ed2ad 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -2265,10 +2265,6 @@ std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) { assert(c.Codes.size() == 1 && "Too many asm constraint codes to handle"); - //catch numeric constraints - if (c.Codes[0].find_first_not_of("0123456789") >= c.Codes[0].size()) - return c.Codes[0]; - const char** table = 0; //Grab the translation table from TargetAsmInfo if it exists @@ -2291,8 +2287,8 @@ std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) { if (c.Codes[0] == table[i]) return table[i+1]; - assert(0 && "Unknown Asm Constraint"); - return ""; + //default is identity + return c.Codes[0]; } //TODO: import logic from AsmPrinter.cpp @@ -2383,7 +2379,7 @@ void CWriter::visitInlineAsm(CallInst &CI) { if (I + 1 != E) Out << ","; } - Out << "\n :" << Clobber.substr(1) << ")\n"; + Out << "\n :" << (Clobber.size() ? Clobber.substr(1) : "") << ")\n"; } void CWriter::visitMallocInst(MallocInst &I) { diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 18c4d06..89ed2ad 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -2265,10 +2265,6 @@ std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) { assert(c.Codes.size() == 1 && "Too many asm constraint codes to handle"); - //catch numeric constraints - if (c.Codes[0].find_first_not_of("0123456789") >= c.Codes[0].size()) - return c.Codes[0]; - const char** table = 0; //Grab the translation table from TargetAsmInfo if it exists @@ -2291,8 +2287,8 @@ std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) { if (c.Codes[0] == table[i]) return table[i+1]; - assert(0 && "Unknown Asm Constraint"); - return ""; + //default is identity + return c.Codes[0]; } //TODO: import logic from AsmPrinter.cpp @@ -2383,7 +2379,7 @@ void CWriter::visitInlineAsm(CallInst &CI) { if (I + 1 != E) Out << ","; } - Out << "\n :" << Clobber.substr(1) << ")\n"; + Out << "\n :" << (Clobber.size() ? Clobber.substr(1) : "") << ")\n"; } void CWriter::visitMallocInst(MallocInst &I) { |