summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-01-09 19:08:06 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-01-09 19:08:06 +0000
commit18334dd9e9941fea937ad9f3ef9c6415fa1c7ebd (patch)
tree217355bfb88f7053a6e0308e68e7c44db72b49ab /clang/lib
parent4dc3eff5aec0edbc579b0ef22ea40043f7140eb5 (diff)
downloadbcm5719-llvm-18334dd9e9941fea937ad9f3ef9c6415fa1c7ebd.tar.gz
bcm5719-llvm-18334dd9e9941fea937ad9f3ef9c6415fa1c7ebd.zip
Move the piece of code up that skips the padding argument. Without this change,
padding insertion will not work if the coerced type is not a structure. llvm-svn: 147786
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 962339ab77a..72b40d3d595 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -988,6 +988,10 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
case ABIArgInfo::Extend:
case ABIArgInfo::Direct: {
+ // Skip the dummy padding argument.
+ if (ArgI.getPaddingType())
+ ++AI;
+
// If we have the trivial case, handle it with no muss and fuss.
if (!isa<llvm::StructType>(ArgI.getCoerceToType()) &&
ArgI.getCoerceToType() == ConvertType(Ty) &&
@@ -1030,10 +1034,6 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
llvm::PointerType::getUnqual(ArgI.getCoerceToType()));
}
- // Skip the dummy padding argument.
- if (ArgI.getPaddingType())
- ++AI;
-
// If the coerce-to type is a first class aggregate, we flatten it and
// pass the elements. Either way is semantically identical, but fast-isel
// and the optimizer generally likes scalar values better than FCAs.
OpenPOWER on IntegriCloud