summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenTarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/TableGen/CodeGenTarget.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenTarget.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp
index 5c7be10cebc..5a9bc60ad29 100644
--- a/llvm/utils/TableGen/CodeGenTarget.cpp
+++ b/llvm/utils/TableGen/CodeGenTarget.cpp
@@ -495,9 +495,10 @@ ComplexPattern::ComplexPattern(Record *R) {
} else if (PropList[i]->getName() == "SDNPWantParent") {
Properties |= 1 << SDNPWantParent;
} else {
- PrintFatalError("Unsupported SD Node property '" +
- PropList[i]->getName() + "' on ComplexPattern '" +
- R->getName() + "'!");
+ PrintFatalError(R->getLoc(), "Unsupported SD Node property '" +
+ PropList[i]->getName() +
+ "' on ComplexPattern '" + R->getName() +
+ "'!");
}
}
@@ -533,6 +534,7 @@ CodeGenIntrinsicTable::CodeGenIntrinsicTable(const RecordKeeper &RC,
CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
TheDef = R;
std::string DefName = R->getName();
+ ArrayRef<SMLoc> DefLoc = R->getLoc();
ModRef = ReadWriteMem;
Properties = 0;
isOverloaded = false;
@@ -547,7 +549,8 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
if (DefName.size() <= 4 ||
std::string(DefName.begin(), DefName.begin() + 4) != "int_")
- PrintFatalError("Intrinsic '" + DefName + "' does not start with 'int_'!");
+ PrintFatalError(DefLoc,
+ "Intrinsic '" + DefName + "' does not start with 'int_'!");
EnumName = std::string(DefName.begin()+4, DefName.end());
@@ -569,7 +572,8 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
// Verify it starts with "llvm.".
if (Name.size() <= 5 ||
std::string(Name.begin(), Name.begin() + 5) != "llvm.")
- PrintFatalError("Intrinsic '" + DefName + "'s name does not start with 'llvm.'!");
+ PrintFatalError(DefLoc, "Intrinsic '" + DefName +
+ "'s name does not start with 'llvm.'!");
}
// If TargetPrefix is specified, make sure that Name starts with
@@ -578,8 +582,9 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
if (Name.size() < 6+TargetPrefix.size() ||
std::string(Name.begin() + 5, Name.begin() + 6 + TargetPrefix.size())
!= (TargetPrefix + "."))
- PrintFatalError("Intrinsic '" + DefName + "' does not start with 'llvm." +
- TargetPrefix + ".'!");
+ PrintFatalError(DefLoc, "Intrinsic '" + DefName +
+ "' does not start with 'llvm." +
+ TargetPrefix + ".'!");
}
// Parse the list of return types.
@@ -611,7 +616,8 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
// Reject invalid types.
if (VT == MVT::isVoid)
- PrintFatalError("Intrinsic '" + DefName + " has void in result type list!");
+ PrintFatalError(DefLoc, "Intrinsic '" + DefName +
+ " has void in result type list!");
IS.RetVTs.push_back(VT);
IS.RetTypeDefs.push_back(TyEl);
@@ -629,7 +635,8 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
PrintError(R->getLoc(),
"Parameter #" + Twine(i) + " has out of bounds matching "
"number " + Twine(MatchTy));
- PrintFatalError(Twine("ParamTypes is ") + TypeList->getAsString());
+ PrintFatalError(DefLoc,
+ Twine("ParamTypes is ") + TypeList->getAsString());
}
VT = OverloadedVTs[MatchTy];
// It only makes sense to use the extended and truncated vector element
@@ -650,7 +657,8 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
// Reject invalid types.
if (VT == MVT::isVoid && i != e-1 /*void at end means varargs*/)
- PrintFatalError("Intrinsic '" + DefName + " has void in result type list!");
+ PrintFatalError(DefLoc, "Intrinsic '" + DefName +
+ " has void in result type list!");
IS.ParamVTs.push_back(VT);
IS.ParamTypeDefs.push_back(TyEl);
OpenPOWER on IntegriCloud