[PATCH] Use ".arch_extension" ARM directive to specify the additional CPU features
t.p.northover at gmail.com
Fri Feb 6 21:07:50 PST 2015
Comment at: include/llvm/MC/MCStreamer.h:142
@@ -141,2 +141,3 @@
virtual void emitArch(unsigned Arch);
+ virtual void emitArchExtension(StringRef StringValue);
virtual void emitObjectArch(unsigned Arch);
> sgundapa wrote:
> > t.p.northover wrote:
> > > rengolin wrote:
> > > > sgundapa wrote:
> > > > > t.p.northover wrote:
> > > > > > I think this either needs a generic implementation, or (probably better for now) moving to ARMELFStreamer.cpp entirely. OK, so it's not called, but
> > > > > p
> > > > ARMELFStreamer? But this is assembly only...
> > > Yep, but it's essentially en ELF-dialect assembly feature so the AsmStreamer seems to live in the same file.
> > A quick google on ".arch_extension" suggests that this directive is specific to ARM as.
> > It is fair to move it to the ARMELFStreamer.cpp file at this moment
> Ignore my previous comment as I thought I added the member to MCTargetStreamer.
> emitArchExtension is part of ARMTargetStreamer. My code is based on below comments in MCStreamer.h
> Any thing wrong here ?
> /// If target foo wants to use this, it should implement 3 classes:
> /// * FooTargetStreamer : public MCTargetStreamer
> /// * FooTargetAsmStreamer : public FooTargetStreamer
> /// * FooTargetELFStreamer : public FooTargetStreamer
> /// FooTargetStreamer should have a pure virtual method for each directive. For
> /// example, for a ".bar symbol_name" directive, it should have
> /// virtual emitBar(const MCSymbol &Symbol) = 0;
> /// The FooTargetAsmStreamer and FooTargetELFStreamer classes implement the
> /// method. The assembly streamer just prints ".bar symbol_name". The object
> /// streamer does whatever is needed to implement .bar in the object file.
Oh bother, looks like I was confused by what classes lived where. I assumed that because it was in MCStreamer.h, the definition belonged to "class MCStreamer". Sorry about that, you can ignore my comment.
More information about the llvm-commits