diff options
author | Jim Grosbach <grosbach@apple.com> | 2012-04-17 21:23:52 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2012-04-17 21:23:52 +0000 |
commit | 67cd20d0396a68e61858736b7943dd352f1b0d0b (patch) | |
tree | 1326876300c04ac1b33fa01a74d7f62dfabc3fb2 /utils/TableGen | |
parent | ab427334f54fed51ed721672a6d0fd1ca0802dd4 (diff) | |
download | external_llvm-67cd20d0396a68e61858736b7943dd352f1b0d0b.zip external_llvm-67cd20d0396a68e61858736b7943dd352f1b0d0b.tar.gz external_llvm-67cd20d0396a68e61858736b7943dd352f1b0d0b.tar.bz2 |
Sanity check error handling for TokenAlias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154951 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index 503d073..dc92a6c 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -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); } |