summaryrefslogtreecommitdiff
path: root/utils/TableGen/TableGen.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-07-29 23:00:08 +0000
committerChris Lattner <sabre@nondot.org>2003-07-29 23:00:08 +0000
commit30709543d2463948d2b6e30a4411a29940cfde69 (patch)
tree10f7b1a546b89586f507066c3a39f5d50b25f335 /utils/TableGen/TableGen.cpp
parent92aa8ca9c5e749a010c33baff633343a48dcfec1 (diff)
downloadllvm-30709543d2463948d2b6e30a4411a29940cfde69.tar.gz
llvm-30709543d2463948d2b6e30a4411a29940cfde69.tar.bz2
llvm-30709543d2463948d2b6e30a4411a29940cfde69.tar.xz
Don't crash if there is no Inst class in the tablegen file!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7402 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/TableGen.cpp')
-rw-r--r--utils/TableGen/TableGen.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp
index 81529f0926..17f2b2e718 100644
--- a/utils/TableGen/TableGen.cpp
+++ b/utils/TableGen/TableGen.cpp
@@ -394,10 +394,12 @@ int main(int argc, char **argv) {
RemoveFileOnSignal(OutputFilename);
}
+ int ErrorCode = 0;
+
switch (Action) {
case Parse: ParseMachineCode(); break;
case GenEmitter:
- CodeEmitterGen(Records).createEmitter(*Out);
+ ErrorCode = CodeEmitterGen(Records).createEmitter(*Out);
break;
case PrintRecords:
*Out << Records; // No argument, dump all contents
@@ -421,5 +423,5 @@ int main(int argc, char **argv) {
}
if (Out != &std::cout) delete Out;
- return 0;
+ return ErrorCode;
}