aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/FileParser.y
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-13 16:37:43 +0000
committerChris Lattner <sabre@nondot.org>2004-02-13 16:37:43 +0000
commitf5761a5e68fa805d58422ca0db5f32f049e77551 (patch)
treebd8b64975fcfdd0b1ffbdda709e50628b660b326 /utils/TableGen/FileParser.y
parent83fe91797ace489c28ebc02be09c27f6e6168912 (diff)
downloadexternal_llvm-f5761a5e68fa805d58422ca0db5f32f049e77551.zip
external_llvm-f5761a5e68fa805d58422ca0db5f32f049e77551.tar.gz
external_llvm-f5761a5e68fa805d58422ca0db5f32f049e77551.tar.bz2
exit(1) instead of abort()'ing on error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/FileParser.y')
-rw-r--r--utils/TableGen/FileParser.y46
1 files changed, 23 insertions, 23 deletions
diff --git a/utils/TableGen/FileParser.y b/utils/TableGen/FileParser.y
index e95e597..af8d3d4 100644
--- a/utils/TableGen/FileParser.y
+++ b/utils/TableGen/FileParser.y
@@ -51,7 +51,7 @@ static void addValue(const RecordVal &RV) {
err() << "New definition of '" << RV.getName() << "' of type '"
<< *RV.getType() << "' is incompatible with previous "
<< "definition of type '" << *ERV->getType() << "'!\n";
- abort();
+ exit(1);
}
} else {
CurRec->addValue(RV);
@@ -61,7 +61,7 @@ static void addValue(const RecordVal &RV) {
static void addSuperClass(Record *SC) {
if (CurRec->isSubClassOf(SC)) {
err() << "Already subclass of '" << SC->getName() << "'!\n";
- abort();
+ exit(1);
}
CurRec->addSuperClass(SC);
}
@@ -73,7 +73,7 @@ static void setValue(const std::string &ValName,
RecordVal *RV = CurRec->getValue(ValName);
if (RV == 0) {
err() << "Value '" << ValName << "' unknown!\n";
- abort();
+ exit(1);
}
// If we are assigning to a subset of the bits in the value... then we must be
@@ -84,7 +84,7 @@ static void setValue(const std::string &ValName,
BitsInit *CurVal = dynamic_cast<BitsInit*>(RV->getValue());
if (CurVal == 0) {
err() << "Value '" << ValName << "' is not a bits type!\n";
- abort();
+ exit(1);
}
// Convert the incoming value to a bits type of the appropriate size...
@@ -92,7 +92,7 @@ static void setValue(const std::string &ValName,
if (BI == 0) {
V->convertInitializerTo(new BitsRecTy(BitList->size()));
err() << "Initializer '" << *V << "' not compatible with bit range!\n";
- abort();
+ exit(1);
}
// We should have a BitsInit type now...
@@ -107,7 +107,7 @@ static void setValue(const std::string &ValName,
if (NewVal->getBit(Bit)) {
err() << "Cannot set bit #" << Bit << " of value '" << ValName
<< "' more than once!\n";
- abort();
+ exit(1);
}
NewVal->setBit(Bit, BInit->getBit(i));
}
@@ -122,7 +122,7 @@ static void setValue(const std::string &ValName,
if (RV->setValue(V)) {
err() << "Value '" << ValName << "' of type '" << *RV->getType()
<< "' is incompatible with initializer '" << *V << "'!\n";
- abort();
+ exit(1);
}
}
@@ -137,7 +137,7 @@ static void addSubClass(Record *SC, const std::vector<Init*> &TemplateArgs) {
// Ensure that an appropriate number of template arguments are specified...
if (TArgs.size() < TemplateArgs.size()) {
err() << "ERROR: More template args specified than expected!\n";
- abort();
+ exit(1);
} else { // This class expects template arguments...
// Loop over all of the template arguments, setting them to the specified
// value or leaving them as the default as necessary.
@@ -149,7 +149,7 @@ static void addSubClass(Record *SC, const std::vector<Init*> &TemplateArgs) {
err() << "ERROR: Value not specified for template argument #"
<< i << " (" << TArgs[i] << ") of subclass '" << SC->getName()
<< "'!\n";
- abort();
+ exit(1);
}
}
}
@@ -206,7 +206,7 @@ ClassID : ID {
$$ = Records.getClass(*$1);
if ($$ == 0) {
err() << "Couldn't find class '" << *$1 << "'!\n";
- abort();
+ exit(1);
}
delete $1;
};
@@ -252,7 +252,7 @@ Value : INTVAL {
if (Bit == 0) {
err() << "Element #" << i << " (" << *(*$2)[i]
<< ") is not convertable to a bit!\n";
- abort();
+ exit(1);
}
Init->setBit($2->size()-i-1, Bit);
}
@@ -265,7 +265,7 @@ Value : INTVAL {
$$ = new DefInit(D);
} else {
err() << "Variable not defined: '" << *$1 << "'!\n";
- abort();
+ exit(1);
}
delete $1;
@@ -273,7 +273,7 @@ Value : INTVAL {
$$ = $1->convertInitializerBitRange(*$3);
if ($$ == 0) {
err() << "Invalid bit range for value '" << *$1 << "'!\n";
- abort();
+ exit(1);
}
delete $3;
} | '[' ValueList ']' {
@@ -282,7 +282,7 @@ Value : INTVAL {
} | Value '.' ID {
if (!$1->getFieldType(*$3)) {
err() << "Cannot access field '" << *$3 << "' of value '" << *$1 << "!\n";
- abort();
+ exit(1);
}
$$ = new FieldInit($1, *$3);
delete $3;
@@ -290,7 +290,7 @@ Value : INTVAL {
Record *D = Records.getDef(*$2);
if (D == 0) {
err() << "Invalid def '" << *$2 << "'!\n";
- abort();
+ exit(1);
}
$$ = new DagInit(D, *$3);
delete $2; delete $3;
@@ -326,7 +326,7 @@ RBitList : INTVAL {
} | INTVAL '-' INTVAL {
if ($1 < $3 || $1 < 0 || $3 < 0) {
err() << "Invalid bit range: " << $1 << "-" << $3 << "!\n";
- abort();
+ exit(1);
}
$$ = new std::vector<unsigned>();
for (int i = $1; i >= $3; --i)
@@ -335,7 +335,7 @@ RBitList : INTVAL {
$2 = -$2;
if ($1 < $2 || $1 < 0 || $2 < 0) {
err() << "Invalid bit range: " << $1 << "-" << $2 << "!\n";
- abort();
+ exit(1);
}
$$ = new std::vector<unsigned>();
for (int i = $1; i >= $2; --i)
@@ -345,7 +345,7 @@ RBitList : INTVAL {
} | RBitList ',' INTVAL '-' INTVAL {
if ($3 < $5 || $3 < 0 || $5 < 0) {
err() << "Invalid bit range: " << $3 << "-" << $5 << "!\n";
- abort();
+ exit(1);
}
$$ = $1;
for (int i = $3; i >= $5; --i)
@@ -354,7 +354,7 @@ RBitList : INTVAL {
$4 = -$4;
if ($3 < $4 || $3 < 0 || $4 < 0) {
err() << "Invalid bit range: " << $3 << "-" << $4 << "!\n";
- abort();
+ exit(1);
}
$$ = $1;
for (int i = $3; i >= $4; --i)
@@ -472,7 +472,7 @@ ObjectBody : OptID {
ClassInst : CLASS ObjectBody {
if (Records.getClass($2->getName())) {
err() << "Class '" << $2->getName() << "' already defined!\n";
- abort();
+ exit(1);
}
Records.addClass($$ = $2);
};
@@ -481,12 +481,12 @@ DefInst : DEF ObjectBody {
if (!$2->getTemplateArgs().empty()) {
err() << "Def '" << $2->getName()
<< "' is not permitted to have template arguments!\n";
- abort();
+ exit(1);
}
// If ObjectBody has template arguments, it's an error.
if (Records.getDef($2->getName())) {
err() << "Def '" << $2->getName() << "' already defined!\n";
- abort();
+ exit(1);
}
Records.addDef($$ = $2);
};
@@ -520,5 +520,5 @@ File : ObjectList {};
int yyerror(const char *ErrorMsg) {
err() << "Error parsing: " << ErrorMsg << "\n";
- abort();
+ exit(1);
}