aboutsummaryrefslogtreecommitdiff
path: root/gold/script.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2006-11-29 17:56:40 +0000
committerIan Lance Taylor <iant@google.com>2006-11-29 17:56:40 +0000
commita3ad94edd406b9abc26493761764d4034dda69fa (patch)
tree96485e8bba91a4aa51f34b0d3738ef3e7ddcbac3 /gold/script.cc
parente1da3f5b9645750e966e471ff0db480d6450dcb7 (diff)
downloadgdb-a3ad94edd406b9abc26493761764d4034dda69fa.zip
gdb-a3ad94edd406b9abc26493761764d4034dda69fa.tar.gz
gdb-a3ad94edd406b9abc26493761764d4034dda69fa.tar.bz2
Hash tables, dynamic section, i386 PLT, gold_assert.
Diffstat (limited to 'gold/script.cc')
-rw-r--r--gold/script.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/gold/script.cc b/gold/script.cc
index b22611f..f5584d9 100644
--- a/gold/script.cc
+++ b/gold/script.cc
@@ -4,7 +4,6 @@
#include <string>
#include <vector>
-#include <cassert>
#include <cstdio>
#include <cstdlib>
@@ -50,14 +49,20 @@ class Token
Token(Classification classification, int lineno, int charpos)
: classification_(classification), value_(), opcode_(0),
lineno_(lineno), charpos_(charpos)
- { assert(classification == TOKEN_INVALID || classification == TOKEN_EOF); }
+ {
+ gold_assert(classification == TOKEN_INVALID
+ || classification == TOKEN_EOF);
+ }
// A general token with a value.
Token(Classification classification, const std::string& value,
int lineno, int charpos)
: classification_(classification), value_(value), opcode_(0),
lineno_(lineno), charpos_(charpos)
- { assert(classification != TOKEN_INVALID && classification != TOKEN_EOF); }
+ {
+ gold_assert(classification != TOKEN_INVALID
+ && classification != TOKEN_EOF);
+ }
// A token representing a string of characters.
Token(const std::string& s, int lineno, int charpos)
@@ -101,21 +106,21 @@ class Token
const std::string&
string_value() const
{
- assert(this->classification_ == TOKEN_STRING);
+ gold_assert(this->classification_ == TOKEN_STRING);
return this->value_;
}
int
operator_value() const
{
- assert(this->classification_ == TOKEN_OPERATOR);
+ gold_assert(this->classification_ == TOKEN_OPERATOR);
return this->opcode_;
}
int64_t
integer_value() const
{
- assert(this->classification_ == TOKEN_INTEGER);
+ gold_assert(this->classification_ == TOKEN_INTEGER);
return strtoll(this->value_.c_str(), NULL, 0);
}
@@ -1097,7 +1102,7 @@ yylex(YYSTYPE* lvalp, void* closurev)
default:
case Token::TOKEN_INVALID:
case Token::TOKEN_EOF:
- abort();
+ gold_unreachable();
case Token::TOKEN_STRING:
{