[PATCH] D45164: [MC] Change AsmParser to leverage Assembler during evaluation

Rafael Avila de Espindola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 09:08:59 PDT 2018


espindola added a comment.

In https://reviews.llvm.org/D45164#1055716, @niravd wrote:

> In https://reviews.llvm.org/D45164#1055062, @espindola wrote:
>
> > > As a result the textual output may fail where the equivalent object generation would pass.
> >
> > I don't think that is OK.
>
>
> It's certainly not ideal but this is at least a somewhat reasonable intermediate point until the follow up patch is finished. The divergence between object and text only happens with preprocessor directives in assembly which should mostly happen with .S files which are probably being assembled directly to object.
>
> The follow up patch to requires merging the various ObjectStreamer and AsmStreamer paths and is rather large.


That would cause us to compute offsets when producing a .s file, right? If we must process .if directives instead of printing them, I don't think we have another option.

But I still don't think this is a reasonable intermediary step. Producing equivalent output is a big guarantee of MC with very few exceptions (bugs).

>> Why can't the asm streamer blindly print the entire if to the output?
> 
> The 'if' is a preprocessor directive and is only valid in the input (.S preprocessor assembly) and not the output (.s preprocessed assembly).

Is that a documented restriction?


Repository:
  rL LLVM

https://reviews.llvm.org/D45164





More information about the llvm-commits mailing list