On 15 Jan 2009, at 01:44, Ian Lance Taylor wrote:
I need to make a test expanded from ASM_OUTPUT_LABEL_REF that is
language dependent (on objc/objcxx).
It's pretty hard to think of any reason why something as low-level as
ASM_OUTPUT_LABEL_REF would want to look at anything in the frontend.
You are probably working at the wrong level.
I'm entirely prepared to believe that...
The problem is this (on darwin):
(currently) ASM_OUTPUT_LABELREF modifies the generated label in
certain cases (where the symbols are internal to OBJC)
When these symbols are mangled in obj-c++ it makes it a much more
difficult to detect them reliably.
"knowing" that the symbols have been mangled improves that.
Without the change to the label name we get wrong generated code
which causes a ld fail (responsible for a fair number of the 'new
rash' of obj-c++ testsuite fails on darwin9)
So options:
1/ Do something target-specific in the generation of the labels and
their subsequent mangling...
maybe this is the Right Way ...
However, I don't know my way around well enough to know how hard
that would be - and it does seem quite intrusive.
2/ assume that no sensible user will make an intention external
symbol named ZLnnnn_OBJC_xxxxxx
perhaps that's not too unreasonable... OBJC_xxxxx are effectively
reserved identifiers - so perhaps mangled file scope variants of
those could be too.
3/ tell the backend that the names have been mangled
the idea here was to generalize the c_language enum to a
"gcc_language" enum and export it from each gcc language.
4/ some other way ... any input is most appreciated,
Iain