[PATCH] Inherit dll attributes to static locals
Nico Rieck
nico.rieck at gmail.com
Fri Jun 13 11:27:21 PDT 2014
================
Comment at: lib/CodeGen/MicrosoftCXXABI.cpp:1429
@@ -1430,1 +1428,3 @@
+ // Create the guard variable with a zero-initializer. Just absorb linkage,
+ // visibility and dll storage clsas from the guarded variable.
GI->Guard =
----------------
Saleem Abdulrasool wrote:
> clsas -> class.
"class"
================
Comment at: lib/Sema/SemaDecl.cpp:9112
@@ +9111,3 @@
+ dyn_cast<FunctionDecl>(VD->getParentFunctionOrMethod())) {
+ Attr *A = FD->getAttr<DLLImportAttr>();
+ if (!A)
----------------
There's already a getDLLAttr() function somewhere, but I guess it's not available here. Maybe this helper could be moved to SemaInternal.h?
================
Comment at: test/CodeGenCXX/dllexport.cpp:257
@@ -256,1 +256,3 @@
+//===----------------------------------------------------------------------===//
+// Static locals
----------------
These tests should be at the end of the section for globals (like in SemaCXX/dllexport.cpp) IMO. Same goes for the dllimport tests.
================
Comment at: test/CodeGenCXX/dllexport.cpp:262
@@ +261,3 @@
+int f();
+// M32-DAG: @"\01?x@?0??nonInlineStaticLocalsFunc@@YAHXZ at 4HA" = internal {{(unnamed_addr )*}}global i32 0
+// M32-DAG: @"\01?$S1@?0??nonInlineStaticLocalsFunc@@YAHXZ at 4IA" = internal {{(unnamed_addr )*}}global i32 0
----------------
These checks can be MSC-DAG.
================
Comment at: test/CodeGenCXX/dllexport.cpp:267
@@ +266,3 @@
+ return x++;
+};
+
----------------
Superfluous ";"
================
Comment at: test/CodeGenCXX/dllexport.cpp:269
@@ +268,3 @@
+
+// M32-DAG: @"\01?x@?1??inlineStaticLocalsFunc@@YAHXZ at 4HA" = weak_odr dllexport global i32 0
+// M32-DAG: @"\01??_B?1??inlineStaticLocalsFunc@@YAHXZ at 51" = weak_odr dllexport global i32 0
----------------
These checks can be MSC-DAG, and please add a comment that MinGW doesn't do this and is not just forgotten here (at least my tests with GCC show this to be true).
http://reviews.llvm.org/D4136
More information about the cfe-commits
mailing list