summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-06-18 02:46:29 +0000
committerJohn McCall <rjmccall@apple.com>2013-06-18 02:46:29 +0000
commit1fe2a8c87ee6d18682ffa6d8a07e2ed30bfb6d35 (patch)
treeb1d0be28a962f43dfe39a352aac590c9e16c59dd /clang/lib/Frontend/CompilerInvocation.cpp
parent9f380c55cef00cf5446691fca7720d0ada17c18a (diff)
downloadbcm5719-llvm-1fe2a8c87ee6d18682ffa6d8a07e2ed30bfb6d35.tar.gz
bcm5719-llvm-1fe2a8c87ee6d18682ffa6d8a07e2ed30bfb6d35.zip
Add support for -fpcc-struct-return. Patch by Arthur O'Dwyer!
llvm-svn: 184166
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 4e62fda4a34..1407e105f24 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -478,6 +478,15 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val;
}
+ if (Arg *A = Args.getLastArg(OPT_fpcc_struct_return, OPT_freg_struct_return)) {
+ if (A->getOption().matches(OPT_fpcc_struct_return)) {
+ Opts.setStructReturnConvention(CodeGenOptions::SRCK_OnStack);
+ } else {
+ assert(A->getOption().matches(OPT_freg_struct_return));
+ Opts.setStructReturnConvention(CodeGenOptions::SRCK_InRegs);
+ }
+ }
+
return Success;
}
OpenPOWER on IntegriCloud