reject instructions that contain a \n in their asmstring. Mark

various X86 and ARM instructions that are bitten by this as isCodeGenOnly,
as they are.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117884 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner committed 2010-11-01 00:46:16 +00:00
1 parent 25592eb52c
commit 4d1189f385
3 files changed
+23 -15

No files matched your search

+10 -7
View File
@@ -229,19 +229,21 @@ static bool IsAssemblerInstruction(StringRef Name,
if (StringRef(Name).startswith("Int_") || StringRef(Name).endswith("_Int"))
return false;
// Ignore instructions with no .s string.
//
// FIXME: What are these?
// Reject instructions with no .s string.
if (CGI.AsmString.empty()) {
PrintError(CGI.TheDef->getLoc(),
"instruction with empty asm string");
throw std::string("ERROR: Invalid instruction for asm matcher");
}
// FIXME: Hack; ignore any instructions with a newline in them.
if (std::find(CGI.AsmString.begin(),
CGI.AsmString.end(), '\n') != CGI.AsmString.end())
return false;
// Reject any instructions with a newline in them, they should be marked
// isCodeGenOnly if they are pseudo instructions.
if (CGI.AsmString.find('\n') != std::string::npos) {
PrintError(CGI.TheDef->getLoc(),
"multiline instruction is not valid for the asmparser, "
"mark it isCodeGenOnly");
throw std::string("ERROR: Invalid instruction");
}
// Reject instructions with attributes, these aren't something we can handle,
// the target should be refactored to use operands instead of modifiers.
@@ -258,6 +260,7 @@ static bool IsAssemblerInstruction(StringRef Name,
throw std::string("ERROR: Invalid instruction");
}
// FIXME: Should reject these.
if (Tokens[i][0] == '$' && !OperandNames.insert(Tokens[i]).second) {
DEBUG({
errs() << "warning: '" << Name << "': "