summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-01-13 19:48:18 +0000
committerHans Wennborg <hans@hanshq.net>2014-01-13 19:48:18 +0000
commit980448201aaee0406ce4b6beff0020f176fdbbcd (patch)
tree297645e06ebc9f675c779fb7a357b511fd415a0c /lib/Frontend/CompilerInvocation.cpp
parent8bba0059bf07a3061a0ac51b494459a85fd78414 (diff)
downloadclang-980448201aaee0406ce4b6beff0020f176fdbbcd.tar.gz
Use the MS ABI for Win32 targets by default
In addition to being a sensible default, this is a huge improvement in test coverage for the MS ABI: any bot that targets Win32 will now run the test suite using the MS ABI by default. Differential Revision: http://llvm-reviews.chandlerc.com/D2401 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199131 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--lib/Frontend/CompilerInvocation.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index dc4aad74b9..131f5e8d94 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -1628,9 +1628,12 @@ static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args) {
// Use the default target triple if unspecified.
if (Opts.Triple.empty())
Opts.Triple = llvm::sys::getDefaultTargetTriple();
-}
-//
+ // Use the MS ABI for Win32 targets unless otherwise specified.
+ if (Opts.CXXABI.empty() &&
+ llvm::Triple(Opts.Triple).getOS() == llvm::Triple::Win32)
+ Opts.CXXABI = "microsoft";
+}
bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
const char *const *ArgBegin,