diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-05-06 18:47:45 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-05-06 18:47:45 +0000 |
commit | 5d754bfa320c558cbebded328454b75134f2cfee (patch) | |
tree | eccb38603ba8bf732499f67f06e3ddbc7400236b /utils | |
parent | 96883ec7002890b949e369cc6e0a5043c110a462 (diff) | |
download | external_llvm-5d754bfa320c558cbebded328454b75134f2cfee.zip external_llvm-5d754bfa320c558cbebded328454b75134f2cfee.tar.gz external_llvm-5d754bfa320c558cbebded328454b75134f2cfee.tar.bz2 |
Improve diagnostics for some parse errors. Not asserting when a user input
error is detected is a good thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/Record.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp index abbbafe..c427b76 100644 --- a/utils/TableGen/Record.cpp +++ b/utils/TableGen/Record.cpp @@ -583,9 +583,7 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) { if (Record *D = (CurRec->getRecords()).getDef(Name)) return new DefInit(D); - errs() << "Variable not defined: '" + Name + "'\n"; - assert(0 && "Variable not found"); - return 0; + throw TGError(CurRec->getLoc(), "Undefined reference:'" + Name + "'\n"); } } break; @@ -813,15 +811,13 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type, OpInit *RHSo = dynamic_cast<OpInit*>(RHS); if (!RHSo) { - errs() << "!foreach requires an operator\n"; - assert(0 && "No operator for !foreach"); + throw TGError(CurRec->getLoc(), "!foreach requires an operator\n"); } TypedInit *LHSt = dynamic_cast<TypedInit*>(LHS); if (!LHSt) { - errs() << "!foreach requires typed variable\n"; - assert(0 && "No typed variable for !foreach"); + throw TGError(CurRec->getLoc(), "!foreach requires typed variable\n"); } if ((MHSd && DagType) || (MHSl && ListType)) { |