[LLVMbugs] [Bug 277] NEW: [llvmgcc] C front-end emits declarations much too aggressively

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Mar 9 14:22:12 PST 2004


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=277

           Summary: [llvmgcc] C front-end emits declarations much too
                    aggressively
           Product: tools
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org


The C front-end is currently much too aggressive about emitting declarations
that it doesn't need.  The most obvious example of this is how it outputs
declarations for all of the silly builtin functions that GCC supports, most of
which are never used.

I believe the reason for this problem is that calling llvm_make_decl_llvm causes
the created LLVM function or global to be added to the current program, which,
in turns, causes it to be emitted by the CFE.  This is due to its reliance on 
llvm_assemble_external to generate the label.

It looks like llvm_assemble_external should be split into two parts: the part
that creates the global and the part that inserts it into the program.  Globals
can then be created, but only lazily inserted into the program as they are used.
 This more closely matches what the CFE is doing with its native code expander.

This change will speed up the C/C++ front-end substantially, but it probably
shouldn't happen before 1.2, because it will probably be destabilizing...

-Chris



------- 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