[llvm-commits] [llvm-gcc-4.2] r46281 - in /llvm-gcc-4.2/trunk/gcc: config/darwin.h objc/objc-act.c

Bill Wendling isanbard at gmail.com
Thu Jan 24 10:46:13 PST 2008


On Jan 24, 2008 3:31 AM, Duncan Sands <baldrick at free.fr> wrote:
>
> On Thursday 24 January 2008 08:45:28 Bill Wendling wrote:
> > Hi Duncan,
> >
> > >> GCC barfs this to the .s file directly:
> > >>
> > >>     .objc_class_name_CrashTestPlugin=0
> > >>     .globl .objc_class_name_CrashTestPlugin
> > >
> > > it looks like you write this directly to a file
> > > containing LLVM IR.  I guess this is OK as long
> > > as no-one is using the global in the IR (otherwise
> > > the verifier will barf).  Is that the case?
> > >
> > This is what I understand to be happening. The GCC version of this
> > doesn't even create a tree node for these, so it shouldn't be
> > generating a use of it. I'm taking that to imply that the GCC to LLVM
> > converter won't create a use of it.
>
> Does this work whether writing LLVM assembler or
> LLVM bitcode?
>
This is how it's output to the .ll file:

module asm "\09.objc_class_name_Sub2=0"
module asm "\09.globl .objc_class_name_Sub2"

So yes. Note that this is something already being done. See the
ASM_DECLARE_UNRESOLVED_REFERENCE macro in the gcc/config/darwin.h
file.

-bw



More information about the llvm-commits mailing list