Patch for bug #27711
Details
Diff Detail
Event Timeline
include/clang/Basic/LangOptions.def | ||
---|---|---|
219–220 | Let's get rid of this and have it use a single DefaultCallingConv LangOpt. | |
include/clang/Driver/CC1Options.td | ||
613 | Let's unify the -cc1 layer with -mrtd, and just have a single -fdefault-calling-convention=stdcall/etc flag. | |
lib/AST/ASTContext.cpp | ||
8627 | I don't think we need to guard this on MSVCCompat, it'll be unset usually. It will also help us avoid a special path for MRTD. | |
8633–8636 | Neither fastcall nor stdcall can be applied to variadic functions. |
lib/AST/ASTContext.cpp | ||
---|---|---|
8604–8606 | Do these flags not have an effect on methods? |
lib/AST/ASTContext.cpp | ||
---|---|---|
8604–8606 | Nope: |
lib/AST/ASTContext.cpp | ||
---|---|---|
8604–8606 | Yeah, that's what the documentation says. But do they really have no effect? :) |
lib/AST/ASTContext.cpp | ||
---|---|---|
8604–8606 | Yes, I've checked. Member functions are not affected =) |
lib/AST/ASTContext.cpp | ||
---|---|---|
8633–8636 | As I've got from MSDN, vectorcall and stdcall cannot be applied to vararg functions. Are you sure about fastcall?) |
Thanks for the review! I've updated the patch, please take a look.
Modifications:
- the dependency from MS compatibility mode is removed;
- the option is renamed into '-fdefault-calling-conv' (since it's not in MS compatibility mode);
- the '-mrtd' option is now an alias for '-fdefault-calling-conv=stdcall';
- 'stdcall' is now ignored for variadic functions;
- since 'vectorcall' requires SSE2 or higher (https://msdn.microsoft.com/en-us/library/dn375768.aspx) the necessary check is added
include/clang/Basic/LangOptions.def | ||
---|---|---|
175 | I'd remove the "MS" from this langopt now that it helps implement -mrtd. |
Renamed option 'DefaultMSCallingConv' into 'DefaultCallingConv' and enum 'DefaultMSCallingConvention' into 'DefaultCallingConvention'.
I'd remove the "MS" from this langopt now that it helps implement -mrtd.