1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Sanity check error handling for TokenAlias.

llvm-svn: 154951
This commit is contained in:
Jim Grosbach 2012-04-17 21:23:52 +00:00
parent 8b77bb6238
commit d32ea4a8a9

View File

@ -1329,6 +1329,9 @@ void AsmMatcherInfo::BuildInfo() {
Record *Rec = AllTokenAliases[i];
ClassInfo *FromClass = getTokenClass(Rec->getValueAsString("FromToken"));
ClassInfo *ToClass = getTokenClass(Rec->getValueAsString("ToToken"));
if (FromClass == ToClass)
throw TGError(Rec->getLoc(),
"error: Destination value identical to source value.");
FromClass->SuperClasses.push_back(ToClass);
}