[PATCH] D42190: Handle parsing AT(ADDR(.foo-bar))

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 13:14:27 PST 2018


ruiu added inline comments.


================
Comment at: ELF/ScriptParser.cpp:800
 Expr ScriptParser::readExpr() {
-  // Our lexer is context-aware. Set the in-expression bit so that
-  // they apply different tokenization rules.
-  bool Orig = InExpr;
-  InExpr = true;
-  Expr E = readExpr1(readPrimary(), 0);
-  InExpr = Orig;
-  return E;
+  RAIIInExpr R(&InExpr, true);
+  return readExpr1(readPrimary(), 0);
----------------
I think even if we have to repeat very similar code twice, that's still better than defining a new class for RAII.


https://reviews.llvm.org/D42190





More information about the llvm-commits mailing list