diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2012-01-12 01:10:09 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2012-01-12 01:10:09 +0000 |
commit | 32604a97088b5add8ce9ad21be8b53d2e78f89af (patch) | |
tree | 205b9213f86904b2b22aaf3b6532be623b4e63d0 /clang/lib/CodeGen/TargetInfo.cpp | |
parent | 02e13e5005d93a9970a942bb1d0be43bc655c932 (diff) | |
download | bcm5719-llvm-32604a97088b5add8ce9ad21be8b53d2e78f89af.tar.gz bcm5719-llvm-32604a97088b5add8ce9ad21be8b53d2e78f89af.zip |
Take into account the pointer to an aggregate that is passed as a hidden
argument when Offset is initialized.
llvm-svn: 147986
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 317cb44ce0d..e9f88b7aaf1 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -3248,8 +3248,12 @@ ABIArgInfo MipsABIInfo::classifyReturnType(QualType RetTy) const { } void MipsABIInfo::computeInfo(CGFunctionInfo &FI) const { - FI.getReturnInfo() = classifyReturnType(FI.getReturnType()); - uint64_t Offset = 0; + ABIArgInfo &RetInfo = FI.getReturnInfo(); + RetInfo = classifyReturnType(FI.getReturnType()); + + // Check if a pointer to an aggregate is passed as a hidden argument. + uint64_t Offset = RetInfo.isIndirect() ? 8 : 0; + for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end(); it != ie; ++it) it->info = classifyArgumentType(it->type, Offset); |