[PATCH] D35621: X86 Asm can't work properly with symbolic Scale

coby via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 04:13:54 PDT 2017


coby added a comment.

few minors + add fixes in clang tests to adopt the added diagnostics.
nothing else has caught my eye



================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:580
+    bool checkSetScale(int64_t _Scale, StringRef &ErrMsg) {
+      State = IES_INTEGER;
+      if (checkIndexReg(ErrMsg))
----------------
You don't need this line


================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:593
+                          StringRef &ErrMsg) {
+      IntelExprState CurrState = State;
       switch (State) {
----------------
CurrState is redundant, you can use 'PrevState = State' as in the original code.


================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:1440
+          Val->evaluateAsAbsolute(TmpInt);
+          StringRef ErrMsg;
+          if (SM.onInteger(TmpInt, ErrMsg))
----------------
line is redundant (ErrMsg is defined on the encapsulating function's scope)


https://reviews.llvm.org/D35621





More information about the llvm-commits mailing list