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

Richard Smith richard at metafoo.co.uk
Wed Apr 2 15:12:00 PDT 2014


  LGTM with a comment tweak.


================
Comment at: lib/AST/Decl.cpp:2619-2621
@@ -2587,5 +2618,5 @@
 ///
 /// Specifically, this determines if adding the current declaration to the set
 /// of redeclarations of the given functions causes
 /// isInlineDefinitionExternallyVisible to change from false to true.
 bool FunctionDecl::doesDeclarationForceExternallyVisibleDefinition() const {
----------------
This comment is incorrect; please fix it. Maybe s/Specifically/For instance, for functions using C99 or GNU inline rules/?

================
Comment at: test/CodeGenCXX/inline-functions.cpp:119-124
@@ +118,7 @@
+
+struct TypeWithInlineMethods {
+  // CHECK-NOT: _ZN21TypeWithInlineMethods9StaticFunEv
+  static void StaticFun() {}
+  // CHECK-NOT: _ZN21TypeWithInlineMethods12NonStaticFunEv
+  void NonStaticFun() { StaticFun(); }
+};
----------------
Does MS allow this sort of thing:

  struct Foo {
    void bar() {}
  };
  extern void Foo::bar();

?


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

BRANCH
  master

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list