summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
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,