Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "gas parser: In directives, look up special symbols even if no…

…t '@' prefixed."

This reverts commit ea72125.

This breaks things like .size expressions with variable names that overlap
special symbol names.  Need to figure out a better way to do this.
  • Loading branch information...
commit c870eda2b9232ca3043e58688635cfeacce2a5f2 1 parent 8989164
@PeterJohnson PeterJohnson authored
Showing with 2 additions and 40 deletions.
  1. +2 −40 modules/parsers/gas/GasParser_parse.cpp
View
42 modules/parsers/gas/GasParser_parse.cpp
@@ -1597,42 +1597,6 @@ GasParser::ParseInsn()
return Insn::Ptr(0);
}
-// Directive expression term: only difference from normal is that we look
-// at unescaped (no @ sign) labels to see if they're special.
-namespace {
-class ParseDirectiveExprTerm : public ParseExprTerm
-{
- Object& m_object;
-public:
- ParseDirectiveExprTerm(Object& object) : m_object(object) {}
- ~ParseDirectiveExprTerm() {}
-
- bool operator() (Expr& e, ParserImpl& parser, bool* handled) const;
-};
-} // anonymous namespace
-
-bool
-ParseDirectiveExprTerm::operator()
- (Expr& e, ParserImpl& parser, bool* handled) const
-{
- if (parser.m_token.is(GasToken::identifier) ||
- parser.m_token.is(GasToken::label))
- {
- IdentifierInfo* ii = parser.m_token.getIdentifierInfo();
- SymbolRef sym = m_object.FindSpecialSymbol(ii->getName());
- if (sym)
- {
- SourceLocation id_source = parser.ConsumeToken();
- e = Expr(sym, id_source);
- *handled = true;
- return true;
- }
- }
-
- *handled = false;
- return true;
-}
-
bool
GasParser::ParseDirective(NameValues* nvs)
{
@@ -1657,8 +1621,7 @@ GasParser::ParseDirective(NameValues* nvs)
{
SourceLocation e_src = m_token.getLocation();
Expr::Ptr e(new Expr);
- ParseDirectiveExprTerm parse_term(*m_object);
- if (!ParseExpr(*e, &parse_term))
+ if (!ParseExpr(*e))
return false;
nvs->push_back(new NameValue(e));
nvs->back().setValueRange(
@@ -1754,8 +1717,7 @@ GasParser::ParseDirective(NameValues* nvs)
{
SourceLocation e_src = m_token.getLocation();
Expr::Ptr e(new Expr);
- ParseDirectiveExprTerm parse_term(*m_object);
- if (!ParseExpr(*e, &parse_term))
+ if (!ParseExpr(*e))
return false;
nvs->push_back(new NameValue(e));
nvs->back().setValueRange(
Please sign in to comment.
Something went wrong with that request. Please try again.