aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-29 01:14:09 +0000
committerChris Lattner <sabre@nondot.org>2010-06-29 01:14:09 +0000
commita159c2e83942b7dae64457d4fff265bb74550cac (patch)
tree968c6e538abcf0672d54c776f56ec097acbc74c4 /lib/CodeGen/TargetInfo.cpp
parent8640cd6bf077e007fdb9bc8c9c5e319f7d70da96 (diff)
plumb preferred types down into X86_64ABIInfo::classifyArgumentType,
no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r--lib/CodeGen/TargetInfo.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index 3bdfbf641c..292f58eef4 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -747,7 +747,8 @@ class X86_64ABIInfo : public ABIInfo {
ASTContext &Context,
llvm::LLVMContext &VMContext,
unsigned &neededInt,
- unsigned &neededSSE) const;
+ unsigned &neededSSE,
+ const llvm::Type *PrefType) const;
public:
virtual void computeInfo(CGFunctionInfo &FI, ASTContext &Context,
@@ -1292,7 +1293,8 @@ classifyReturnType(QualType RetTy, ASTContext &Context,
ABIArgInfo X86_64ABIInfo::classifyArgumentType(QualType Ty, ASTContext &Context,
llvm::LLVMContext &VMContext,
unsigned &neededInt,
- unsigned &neededSSE) const {
+ unsigned &neededSSE,
+ const llvm::Type *PrefType)const{
X86_64ABIInfo::Class Lo, Hi;
classify(Ty, Context, 0, Lo, Hi);
@@ -1397,9 +1399,17 @@ void X86_64ABIInfo::computeInfo(CGFunctionInfo &FI, ASTContext &Context,
// get assigned (in left-to-right order) for passing as follows...
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
it != ie; ++it) {
+ // If the client specified a preferred IR type to use, pass it down to
+ // classifyArgumentType.
+ const llvm::Type *PrefType = 0;
+ if (NumPrefTypes) {
+ PrefType = *PrefTypes++;
+ --NumPrefTypes;
+ }
+
unsigned neededInt, neededSSE;
it->info = classifyArgumentType(it->type, Context, VMContext,
- neededInt, neededSSE);
+ neededInt, neededSSE, PrefType);
// AMD64-ABI 3.2.3p3: If there are no registers available for any
// eightbyte of an argument, the whole argument is passed on the
@@ -1480,7 +1490,7 @@ llvm::Value *X86_64ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
Ty = CGF.getContext().getCanonicalType(Ty);
ABIArgInfo AI = classifyArgumentType(Ty, CGF.getContext(), VMContext,
- neededInt, neededSSE);
+ neededInt, neededSSE, 0);
// AMD64-ABI 3.5.7p5: Step 1. Determine whether type may be passed
// in the registers. If not go to step 7.