[LLVMbugs] [Bug 700] NEW: [llvm-g++] Templates instantiated on internal classes should be internal

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Jan 22 15:53:00 PST 2006


           Summary: [llvm-g++] Templates instantiated on internal classes
                    should be internal
           Product: tools
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: llvm-g++
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org


template <typename foo>
void bar() {}

namespace { class C {};}
void (*FP)() = bar<C>;

Because C is in an anonymous namespace, there is no reason for the template instantiation of bar here 
to be marked linkonce.  Instead, it should be marked internal, allowing IPO at compile time.

We currently compile it to:

%FP = global void ()* %_Z3barIN11_GLOBAL__N_1CEEvv              ; <void ()**> [#uses=0]

linkonce void %_Z3barIN11_GLOBAL__N_1CEEvv() {
        ret void

This occurs with pass registration functions in LLVM, which are templates instantiated on mostly 
internal classes.


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the llvm-bugs mailing list