On Mon, Feb 13, 2012 at 2:51 PM, Gabor Greif <[email protected]> wrote: > llvm.order sounds a bit hackish to me. A cleaner solution might be to > add a 'placebefore' attribute to global variables (or maybe a > 'placeafter' attribute on functions) naming the related entity. > Something like this: > >> @foo_D = common global %struct.Descr zeroinitializer, align 8, placebefore >> @foo >> >> define i32 @foo() nounwind uwtable readnone { >> ret i32 undef >> }
Hm, this sounds essentially like the David's other suggestion: >>> 2. Make it possible to explicitly attach a variable to a function, so >>> that it eventually gets right before the code of the function. > PS: I am weighing in, because if we start out with a hack now, the > hacky semantics must be dragged all through the lifetime of LLVM 3.x > bitcode formats. Personally, I like the idea of attaching a global to function better than having llvm.order, but David is concerned with having the patches accepted upstream. On the one hand, llvm.order might be less code to add, but, on the other hand, a hacky solution might be much harder to convince the LLVM developers to include, precisely because of the reasons you are stating. I'll write an E-mail to the LLVM developers in a couple hours, and CC both of you and cvs-ghc. Sergiu _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
