ArgTys.data(), ArgTys.size());
FunctionInfos.InsertNode(FI, InsertPos);
- // ABI lowering wants to know what our preferred type for the argument is in
- // various situations, pass it in.
- llvm::SmallVector<const llvm::Type *, 8> PreferredArgTypes;
- for (llvm::SmallVectorImpl<CanQualType>::const_iterator
- I = ArgTys.begin(), E = ArgTys.end(); I != E; ++I) {
- // If this is being called from the guts of the ConvertType loop, make sure
- // to call ConvertTypeRecursive so we don't get into issues with cyclic
- // pointer type structures.
- PreferredArgTypes.push_back(ConvertTypeRecursive(*I));
- }
-
// Compute ABI information.
- getABIInfo().computeInfo(*FI, PreferredArgTypes.data(),
- PreferredArgTypes.size());
+ getABIInfo().computeInfo(*FI);
// If this is a top-level call and ConvertTypeRecursive hit unresolved pointer
// types, resolve them now. These pointers may point to this function, which
// we *just* filled in the FunctionInfo for.
- if (!IsRecursive && !PointersToResolve.empty()) {
- // Use PATypeHolder's so that our preferred types don't dangle under
- // refinement.
- llvm::SmallVector<llvm::PATypeHolder, 8> Handles(PreferredArgTypes.begin(),
- PreferredArgTypes.end());
+ if (!IsRecursive && !PointersToResolve.empty())
HandleLateResolvedPointers();
- PreferredArgTypes.clear();
- PreferredArgTypes.append(Handles.begin(), Handles.end());
- }
-
return *FI;
}
ABIArgInfo classifyReturnType(QualType RetTy) const;
ABIArgInfo classifyArgumentType(QualType RetTy) const;
- virtual void computeInfo(CGFunctionInfo &FI,
- const llvm::Type *const *PrefTypes,
- unsigned NumPrefTypes) const {
+ virtual void computeInfo(CGFunctionInfo &FI) const {
FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
it != ie; ++it)
ABIArgInfo classifyReturnType(QualType RetTy) const;
ABIArgInfo classifyArgumentType(QualType RetTy) const;
- virtual void computeInfo(CGFunctionInfo &FI,
- const llvm::Type *const *PrefTypes,
- unsigned NumPrefTypes) const {
+ virtual void computeInfo(CGFunctionInfo &FI) const {
FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
it != ie; ++it)
public:
X86_64ABIInfo(CodeGen::CodeGenTypes &CGT) : ABIInfo(CGT) {}
- virtual void computeInfo(CGFunctionInfo &FI,
- const llvm::Type *const *PrefTypes,
- unsigned NumPrefTypes) const;
+ virtual void computeInfo(CGFunctionInfo &FI) const;
virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
CodeGenFunction &CGF) const;
return getCoerceResult(Ty, ResType);
}
-void X86_64ABIInfo::computeInfo(CGFunctionInfo &FI,
- const llvm::Type *const *PrefTypes,
- unsigned NumPrefTypes) const {
+void X86_64ABIInfo::computeInfo(CGFunctionInfo &FI) const {
FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
// Keep track of the number of assigned registers.
// 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
+ // Determine the preferred IR type to use and pass it down to
// classifyArgumentType.
- const llvm::Type *PrefType = 0;
- if (NumPrefTypes) {
- PrefType = *PrefTypes++;
- --NumPrefTypes;
- }
+ const llvm::Type *PrefType = CGT.ConvertTypeRecursive(it->type);
unsigned neededInt, neededSSE;
it->info = classifyArgumentType(it->type, neededInt, neededSSE, PrefType);
ABIArgInfo classifyArgumentType(QualType RetTy) const;
- virtual void computeInfo(CGFunctionInfo &FI,
- const llvm::Type *const *PrefTypes,
- unsigned NumPrefTypes) const {
+ virtual void computeInfo(CGFunctionInfo &FI) const {
FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
it != ie; ++it)
ABIArgInfo classifyReturnType(QualType RetTy) const;
ABIArgInfo classifyArgumentType(QualType RetTy) const;
- virtual void computeInfo(CGFunctionInfo &FI,
- const llvm::Type *const *PrefTypes,
- unsigned NumPrefTypes) const;
+ virtual void computeInfo(CGFunctionInfo &FI) const;
virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
CodeGenFunction &CGF) const;
}
-void ARMABIInfo::computeInfo(CGFunctionInfo &FI,
- const llvm::Type *const *PrefTypes,
- unsigned NumPrefTypes) const {
+void ARMABIInfo::computeInfo(CGFunctionInfo &FI) const {
FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
it != ie; ++it)
ABIArgInfo classifyReturnType(QualType RetTy) const;
ABIArgInfo classifyArgumentType(QualType RetTy) const;
- virtual void computeInfo(CGFunctionInfo &FI,
- const llvm::Type *const *PrefTypes,
- unsigned NumPrefTypes) const {
+ virtual void computeInfo(CGFunctionInfo &FI) const {
FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
it != ie; ++it)