[LLVMbugs] [Bug 137] NEW: [llvmg++] Code is generated for empty classes

bugzilla-daemon at zion.cs.uiuc.edu bugzilla-daemon at zion.cs.uiuc.edu
Wed Nov 19 14:01:13 PST 2003


           Summary: [llvmg++] Code is generated for empty classes
           Product: tools
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: llvm-g++
        AssignedTo: sabre at nondot.org
        ReportedBy: sabre at nondot.org

This testcase should not generate any stores in the function body:

struct X {};
X foo() { return X(); }

It currently generates:

        %struct.X = type { ubyte }
void %_Z3foov(%struct.X* %agg.result) {
        %tmp = getelementptr %struct.X* %agg.result, long 0, ubyte 0
        store ubyte 0, ubyte* %tmp
        ret void

The type is correct (empty classes in C++ have one byte), but the store is not
needed.  Empty classes come up a lot in C++ libraries, like the STL, these
stores are getting in the way.

Unfortunately this will require some changes in the front-end, so this will
probably happen after 1.1.


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