summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-07-15 22:43:04 +0000
committerChris Lattner <sabre@nondot.org>2005-07-15 22:43:04 +0000
commit3a6a4d37077a32ae79eac9c04fecff590c172978 (patch)
tree3d1a44ad53b80ab6d8678d394d43a832238f9310 /llvm/utils
parenta3f5110d5efab8d50c42b9a71fd44df0191a29dd (diff)
downloadbcm5719-llvm-3a6a4d37077a32ae79eac9c04fecff590c172978.tar.gz
bcm5719-llvm-3a6a4d37077a32ae79eac9c04fecff590c172978.zip
Fix PR595: These error messages should not be looking at CGI.Name, they
should be looking at CGI.TheDef->getName(). llvm-svn: 22445
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/AsmWriterEmitter.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/llvm/utils/TableGen/AsmWriterEmitter.cpp b/llvm/utils/TableGen/AsmWriterEmitter.cpp
index 34aaf15b5a7..12dc09994c6 100644
--- a/llvm/utils/TableGen/AsmWriterEmitter.cpp
+++ b/llvm/utils/TableGen/AsmWriterEmitter.cpp
@@ -116,7 +116,8 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant) {
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 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant) {
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 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant) {
} 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 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant) {
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 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant) {
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;
}
OpenPOWER on IntegriCloud