This makes us handle static locals in exported/imported functions correctly.
Details
Diff Detail
Event Timeline
lib/CodeGen/MicrosoftCXXABI.cpp | ||
---|---|---|
1429 | "class" | |
lib/Sema/SemaDecl.cpp | ||
9112 | There's already a getDLLAttr() function somewhere, but I guess it's not available here. Maybe this helper could be moved to SemaInternal.h? | |
test/CodeGenCXX/dllexport.cpp | ||
257 | These tests should be at the end of the section for globals (like in SemaCXX/dllexport.cpp) IMO. Same goes for the dllimport tests. | |
262 | These checks can be MSC-DAG. | |
267 | Superfluous ";" | |
269 | 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). |
Thanks for the review!
It would be nice to have similar tests for the Itanium ABI, but I suspect that you are less interested in that.
As Nico pointed out, they don't seem to export the static locals :/
lib/CodeGen/MicrosoftCXXABI.cpp | ||
---|---|---|
1429 | Done. | |
lib/Sema/SemaDecl.cpp | ||
9112 | Sounds good to me. | |
test/CodeGenCXX/dllexport.cpp | ||
257 | Done. | |
262 | Done. | |
267 | Removed. | |
269 | Done. |
lib/Sema/SemaDecl.cpp | ||
---|---|---|
9108 | Should this go before checkAttributesAfterMerging? Consider this obnoxious test case: int f(); inline __declspec(dllexport) int g() { static __declspec(dllimport) int x = f(); return x; } |
lib/Sema/SemaDecl.cpp | ||
---|---|---|
9108 | Local variables cannot have explicit dll attributes. They can only get them by inheriting from the function they're part of, so calling checkAttributesAfterMerging to check up on the attribute we just added seems redundant. |
lgtm
lib/Sema/SemaDecl.cpp | ||
---|---|---|
9108 | OK. I assume this is covered by Nico's extensive test cases. :) |
clsas -> class.