summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/utils/TableGen/AsmMatcherEmitter.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index 04c9472c708..c047a5d9936 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -1466,13 +1466,17 @@ static std::string GetAliasRequiredFeatures(Record *R,
std::string Result;
unsigned NumFeatures = 0;
for (unsigned i = 0, e = ReqFeatures.size(); i != e; ++i) {
- if (SubtargetFeatureInfo *F = Info.getSubtargetFeature(ReqFeatures[i])) {
- if (NumFeatures)
- Result += '|';
+ SubtargetFeatureInfo *F = Info.getSubtargetFeature(ReqFeatures[i]);
- Result += F->getEnumName();
- ++NumFeatures;
- }
+ if (F == 0)
+ throw TGError(R->getLoc(), "Predicate '" + ReqFeatures[i]->getName() +
+ "' is not marked as an AssemblerPredicate!");
+
+ if (NumFeatures)
+ Result += '|';
+
+ Result += F->getEnumName();
+ ++NumFeatures;
}
if (NumFeatures > 1)
OpenPOWER on IntegriCloud