[llvm-commits] CVS: llvm/utils/TableGen/AsmWriterEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Jul 15 15:43:15 PDT 2005
Changes in directory llvm/utils/TableGen:
AsmWriterEmitter.cpp updated: 1.20 -> 1.21
---
Log message:
Fix PR595: http://llvm.cs.uiuc.edu/PR595 : These error messages should not be looking at CGI.Name, they
should be looking at CGI.TheDef->getName().
---
Diffs of the changes: (+13 -9)
AsmWriterEmitter.cpp | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
Index: llvm/utils/TableGen/AsmWriterEmitter.cpp
diff -u llvm/utils/TableGen/AsmWriterEmitter.cpp:1.20 llvm/utils/TableGen/AsmWriterEmitter.cpp:1.21
--- llvm/utils/TableGen/AsmWriterEmitter.cpp:1.20 Thu Jul 14 17:50:30 2005
+++ llvm/utils/TableGen/AsmWriterEmitter.cpp Fri Jul 15 17:43:04 2005
@@ -116,7 +116,8 @@
LastEmitted = DollarPos;
} else if (AsmString[DollarPos] == '{') {
if (inVariant)
- throw "Nested variants found for instruction '" + CGI.Name + "'!";
+ throw "Nested variants found for instruction '" +
+ CGI.TheDef->getName() + "'!";
LastEmitted = DollarPos+1;
inVariant = true; // We are now inside of the variant!
for (unsigned i = 0; i != Variant; ++i) {
@@ -126,7 +127,8 @@
std::string::size_type NP =
AsmString.find_first_of("|}", LastEmitted);
if (NP == std::string::npos)
- throw "Incomplete variant for instruction '" + CGI.Name + "'!";
+ throw "Incomplete variant for instruction '" +
+ CGI.TheDef->getName() + "'!";
LastEmitted = NP+1;
if (AsmString[NP] == '}') {
inVariant = false; // No text for this variant.
@@ -136,17 +138,18 @@
} else if (AsmString[DollarPos] == '|') {
if (!inVariant)
throw "'|' character found outside of a variant in instruction '"
- + CGI.Name + "'!";
+ + CGI.TheDef->getName() + "'!";
// Move to the end of variant list.
std::string::size_type NP = AsmString.find('}', LastEmitted);
if (NP == std::string::npos)
- throw "Incomplete variant for instruction '" + CGI.Name + "'!";
+ throw "Incomplete variant for instruction '" +
+ CGI.TheDef->getName() + "'!";
LastEmitted = NP+1;
inVariant = false;
} else if (AsmString[DollarPos] == '}') {
if (!inVariant)
throw "'}' character found outside of a variant in instruction '"
- + CGI.Name + "'!";
+ + CGI.TheDef->getName() + "'!";
LastEmitted = DollarPos+1;
inVariant = false;
} else if (DollarPos+1 != AsmString.size() &&
@@ -178,14 +181,15 @@
if (hasCurlyBraces) {
if (VarEnd >= AsmString.size())
throw "Reached end of string before terminating curly brace in '"
- + CGI.Name + "'";
+ + CGI.TheDef->getName() + "'";
if (AsmString[VarEnd] != '}')
throw "Variant name beginning with '{' did not end with '}' in '"
- + CGI.Name + "'";
+ + CGI.TheDef->getName() + "'";
++VarEnd;
}
if (VarName.empty())
- throw "Stray '$' in '" + CGI.Name + "' asm string, maybe you want $$?";
+ throw "Stray '$' in '" + CGI.TheDef->getName() +
+ "' asm string, maybe you want $$?";
unsigned OpNo = CGI.getOperandNamed(VarName);
CodeGenInstruction::OperandInfo OpInfo = CGI.OperandList[OpNo];
@@ -196,7 +200,7 @@
if (CGI.isTwoAddress && MIOp != 0) {
if (MIOp == 1)
throw "Should refer to operand #0 instead of #1 for two-address"
- " instruction '" + CGI.Name + "'!";
+ " instruction '" + CGI.TheDef->getName() + "'!";
--MIOp;
}
More information about the llvm-commits
mailing list