diff options
| author | John McCall <rjmccall@apple.com> | 2013-06-18 02:46:29 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2013-06-18 02:46:29 +0000 |
| commit | b8b52972c72b2ba6fe171c522e5d3d7d69503021 (patch) | |
| tree | f3a85a95ef107765d4e72afeb220f0ffbc4d8f5a /lib/Frontend/CompilerInvocation.cpp | |
| parent | 0bb5199941d6058b866afe01956cca36e64cc247 (diff) | |
| download | clang-b8b52972c72b2ba6fe171c522e5d3d7d69503021.tar.gz clang-b8b52972c72b2ba6fe171c522e5d3d7d69503021.tar.bz2 clang-b8b52972c72b2ba6fe171c522e5d3d7d69503021.tar.xz | |
Add support for -fpcc-struct-return. Patch by Arthur O'Dwyer!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
| -rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 4e62fda4a3..1407e105f2 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/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; } |
