This is an archive of the discontinued LLVM Phabricator instance.

[ms] [llvm-ml] Standardize blocking of lexical substitution
ClosedPublic

Authored by epastor on Jun 13 2021, 8:19 AM.

Details

Summary

In MASM, the ifdef family of directives treats its argument literally, without expanding it as a text macro. Add support for this, and also replace the special handling that was previously used for echo.

Diff Detail

Event Timeline

epastor created this revision.Jun 13 2021, 8:19 AM
epastor requested review of this revision.Jun 13 2021, 8:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2021, 8:19 AM
thakis accepted this revision.Jul 1 2021, 12:15 PM

Nice! lg with clang-tidy addressed.

llvm/lib/MC/MCParser/MasmParser.cpp
495–497

nit: Consider instead:

enum ExpandKind { ExpandMacros, DoNotExpandMacros };
const AsmToken &Lex(ExpandKind);

Then the call sites are much easier to read. (Also something similar for the other method below taking a bool below)

1127

Why is this a pointer? You never set it to anything else and it can't be null -- make it a reference?

1143

no else after return…oh, clang-tidy already said that. Do what clang-tidy says :) (also above)

This revision is now accepted and ready to land.Jul 1 2021, 12:15 PM
epastor updated this revision to Diff 356198.Jul 2 2021, 9:47 AM
epastor marked 3 inline comments as done.

Address feedback (including clang-tidy)

This revision was landed with ongoing or failed builds.Jul 2 2021, 11:20 AM
This revision was automatically updated to reflect the committed changes.