diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2012-01-12 00:52:17 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2012-01-12 00:52:17 +0000 |
commit | 2afd23da0e33a8cd44c1c46b1651c677fdd27151 (patch) | |
tree | a0f60ded1741e04cff811f3583f29864c7a4e8e2 /lib/CodeGen/TargetInfo.cpp | |
parent | ed0b31f8474b60661de6cbb75fb04aa0de9bd1ef (diff) |
Call CodeGenTypes::ConvertType to get LLVM::Type*.
Remove function MipsABIInfo::GetFloatingPointTy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | lib/CodeGen/TargetInfo.cpp | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 4693fcb7e2..317cb44ce0 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -3040,7 +3040,6 @@ namespace { class MipsABIInfo : public ABIInfo { bool IsO32; unsigned MinABIStackAlignInBytes; - llvm::Type* GetFloatingPointTy(const BuiltinType *BT) const; llvm::Type* HandleAggregates(QualType Ty) const; llvm::Type* returnAggregateInRegs(QualType RetTy, uint64_t Size) const; llvm::Type* getPaddingType(uint64_t Align, uint64_t Offset) const; @@ -3075,35 +3074,14 @@ public: }; } -llvm::Type *MipsABIInfo::GetFloatingPointTy(const BuiltinType *BT) const { - switch (BT->getKind()) { - case BuiltinType::Float: - return llvm::Type::getFloatTy(getVMContext()); - case BuiltinType::Double: - return llvm::Type::getDoubleTy(getVMContext()); - case BuiltinType::LongDouble: - return llvm::Type::getFP128Ty(getVMContext()); - default: - assert(false && "Unexpected floating point type."); - return 0; - } -} - // In N32/64, an aligned double precision floating point field is passed in // a register. llvm::Type* MipsABIInfo::HandleAggregates(QualType Ty) const { if (IsO32) return 0; - SmallVector<llvm::Type*, 8> ArgList; - - if (Ty->isComplexType()) { - const ComplexType *CT = Ty->getAs<ComplexType>(); - const BuiltinType *BT = CT->getElementType()->getAs<BuiltinType>(); - llvm::Type *FT = GetFloatingPointTy(BT); - ArgList.append(2, FT); - return llvm::StructType::get(getVMContext(), ArgList); - } + if (Ty->isComplexType()) + return CGT.ConvertType(Ty); const RecordType *RT = Ty->getAsStructureType(); @@ -3118,6 +3096,7 @@ llvm::Type* MipsABIInfo::HandleAggregates(QualType Ty) const { uint64_t LastOffset = 0; unsigned idx = 0; llvm::IntegerType *I64 = llvm::IntegerType::get(getVMContext(), 64); + SmallVector<llvm::Type*, 8> ArgList; for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i, ++idx) { @@ -3225,7 +3204,7 @@ MipsABIInfo::returnAggregateInRegs(QualType RetTy, uint64_t Size) const { if (!BT || !BT->isFloatingPoint()) break; - RTList.push_back(GetFloatingPointTy(BT)); + RTList.push_back(CGT.ConvertType((*i)->getType())); } if (i == e) |