[PATCH] D24839: [MC] Prevent out of order HashDirective lexing in AsmLexer.

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 10:07:30 PDT 2016


rnk added inline comments.


> AsmLexer.h:30-35
>    const char *CurPtr;
>    StringRef CurBuf;
>    bool IsAtStartOfLine;
>    bool IsAtStartOfStatement;
>    bool IsParsingMSInlineAsm;
> +  bool IsPeeking;

We should give all these scalars default member initializers and delete the assignments in the ctor.

> AsmLexer.cpp:496
>    bool SavedSkipSpace = SkipSpace;
> +  bool SavedIsPeeking = IsPeeking;
> +  IsPeeking = true;

Do you think this would be improved with our SaveAndRestore<bool> RAII helper? Same for the rest of the saved local copies.

https://reviews.llvm.org/D24839





More information about the llvm-commits mailing list