[LLVMbugs] [Bug 9392] New: Feature request: linkonce inline functions in C

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 3 11:56:43 PST 2011


           Summary: Feature request: linkonce inline functions in C
           Product: clang
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: lennox at cs.columbia.edu
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=6268)
 --> (http://llvm.org/bugs/attachment.cgi?id=6268)
Header file for test program that compiles on Microsoft Visual C.

Microsoft Visual C++ has the feature that inline (technically, __inline)
functions in C are emitted in COMDAT sections, in the same manner as in C++, so
they have linkonce semantics.

Thus, neither a C99 "extern inline declaration" nor a GNU C "non-inline
definition" needs to be provided to handle cases where the function cannot be
inlined -- the compiler simply handles it automatically.  This significantly
simplifies code maintenance.

Would it be possible to add this feature as a Clang extension?  Looking over
the Clang Bugzilla it appears that Clang used to implement inlining this way,
but it was fixed to implement the correct C99 semantics instead, so presumably
the infrastructure support is there.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list