[PATCH] CodeGen: Emit some functions as weak_odr under -fms-extensions

Reid Kleckner rnk at google.com
Thu Mar 27 16:28:34 PDT 2014


  Yep, this is basically what I had in mind.

  Should this be under extensions of compatibility?  Do you consider this a conforming extension or a compatibility quirk?  I believe there are people out there using -fms-extensions with mingw headers, and they probably want C99 or gnu inline semantics, which do different stuff with 'extern inline'.


================
Comment at: lib/CodeGen/CodeGenModule.cpp:558
@@ +557,3 @@
+
+    // Functions specified with extern and inline in -fmicrosoft-extensions mode
+    // forcibly get emitted.  While the body of the function cannot be later
----------------
s/-fmicrosoft-extensions/-fms-extensions/

================
Comment at: test/CodeGen/inline.c:55
@@ -54,2 +54,3 @@
 // RUN: echo "MS C Mode tests:"
 // RUN: %clang_cc1 %s -triple i386-unknown-unknown -O1 -disable-llvm-optzns -emit-llvm -o - -std=c99 -fms-compatibility | FileCheck %s --check-prefix=CHECK4
+// CHECK4-LABEL: define weak_odr i32 @ei()
----------------
This is -fms-compatibility.  Does that imply -fms-extensions?


http://llvm-reviews.chandlerc.com/D3207



More information about the cfe-commits mailing list