[llvm] r326810 - [Asm] Fix another layering violation in assmebly macro dumping

Roger Pau Monné via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 07:41:33 PDT 2018


Hello,

Sorry for the delay, I'm finally back home.

On Tue, Mar 06, 2018 at 05:33:18PM +0000, Oliver Stannard wrote:
> Ah, I see what you mean.
> 
> The layering violation wasn’t added by my patch, I just turned it into a build failure when doing a shared-libraries build.
> 
> The original layering violation it was committed a few weeks ago: https://reviews.llvm.org/rL325139, I’ve added the author and committer of that patch.
> 
> Oliver
> 
> From: David Blaikie [mailto:dblaikie at gmail.com]
> Sent: 06 March 2018 17:28
> To: Pavel Labath
> Cc: Oliver Stannard; Pavel Labath via llvm-commits
> Subject: Re: [llvm] r326810 - [Asm] Fix another layering violation in assmebly macro dumping
> 
> Agreed - this is still a layering violation. Including an MCParser header from MC violates the dependencies (MCParser depends on MC, not the other way around).

So I've been looking into this, and AFAICT the problem is that
MCAsmMacro.h includes MCParser/MCAsmLexer.h in order to get the
definition of AsmToken.

Would it be fine to move the definition of AsmToken into
MC/MCAsmToken.h (and rename AsmToken to MCAsmToken)? I don't see
AsmToken itself depending on any other MCParser definitions.

Thanks, Roger.


More information about the llvm-commits mailing list