Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
@rnk what are your thoughts on adding a new LangOpts maybe called WindowsExt which can be shared across MSVC and Mingw?
I will also add a test case once I know how best to proceed
updated to fix test cases.
needs more work,
I see that I can have an array of language opts so I will add a mingw one rather then a combined one
Using TargetSpecificAttr<TargetWindws> sounds good to me.
include/clang/Basic/Attr.td | ||
---|---|---|
2245 ↗ | (On Diff #95305) | This is at least consistent with what we do for dllexport/dllimport, which is the other major attribute/declspec that GCC and MSVC share, so let's do that for now. |
test/Sema/attr-selectany.c | ||
2 ↗ | (On Diff #95305) | Ditto, can we remove -fms-extensions? |
test/SemaCXX/attr-selectany.cpp | ||
1 ↗ | (On Diff #95305) | Does the test still pass if you remove -fms-extensions? If it does, let's remove it to simplify the test. |
I got a little carried away and submitted too early before I realised they were comma separated arguments.
Also note that now we have to add the target to non msvc default hosts.
The test case was updated to reflect that.
reverted back based on comments by @rnk
We can't just simply remove -fms-extensions because
'__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
mingw passes -fdeclspec.
Test cases are updated to test both -fdeclspec and -fms-extensions because the cpp testcase does a lot more then just test selectany