]> granicus.if.org Git - clang/commit
[MC] Change AsmParser to leverage Assembler during evaluation
authorNirav Dave <niravd@google.com>
Mon, 30 Apr 2018 19:22:40 +0000 (19:22 +0000)
committerNirav Dave <niravd@google.com>
Mon, 30 Apr 2018 19:22:40 +0000 (19:22 +0000)
commit12850bf731681a2c32ee5d06ad2b8c411f7e2162
tree5f586f2fc880b2991832722a045602e196a891a8
parent10efc3167720d8d20a73d2f7fa9434e9e93499bd
[MC] Change AsmParser to leverage Assembler during evaluation

Teach AsmParser to check with Assembler for when evaluating constant
expressions.  This improves the handing of preprocessor expressions
that must be resolved at parse time. This idiom can be found as
assembling-time assertion checks in source-level assemblers. Note that
this relies on the MCStreamer to keep sufficient tabs on Section /
Fragment information which the MCAsmStreamer does not. As a result the
textual output may fail where the equivalent object generation would
pass. This can most easily be resolved by folding the MCAsmStreamer
and MCObjectStreamer together which is planned for in a separate
patch.

Currently, this feature is only enabled for assembly input, keeping IR
compilation consistent between assembly and object generation.

Reviewers: echristo, rnk, probinson, espindola, peter.smith

Reviewed By: peter.smith

Subscribers: eraman, peter.smith, arichardson, jyknight, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D45164

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331218 91177308-0d34-0410-b5e6-96231b3b80d8
test/CodeGen/asm-parser-info.S [new file with mode: 0644]
tools/driver/cc1as_main.cpp