aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/Targets/PPC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/Targets/PPC.cpp')
-rw-r--r--clang/lib/CodeGen/Targets/PPC.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/Targets/PPC.cpp b/clang/lib/CodeGen/Targets/PPC.cpp
index 9cdd2aa07791..40dddde508c1 100644
--- a/clang/lib/CodeGen/Targets/PPC.cpp
+++ b/clang/lib/CodeGen/Targets/PPC.cpp
@@ -431,7 +431,7 @@ Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAList,
llvm::Type *DirectTy = CGF.ConvertType(Ty), *ElementTy = DirectTy;
if (isIndirect)
- DirectTy = llvm::PointerType::getUnqual(CGF.getLLVMContext());
+ DirectTy = CGF.UnqualPtrTy;
// Case 1: consume registers.
Address RegAddr = Address::invalid();
@@ -620,6 +620,9 @@ public:
bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
llvm::Value *Address) const override;
+ void emitTargetMetadata(CodeGen::CodeGenModule &CGM,
+ const llvm::MapVector<GlobalDecl, StringRef>
+ &MangledDeclNames) const override;
};
class PPC64TargetCodeGenInfo : public TargetCodeGenInfo {
@@ -940,6 +943,24 @@ PPC64_SVR4_TargetCodeGenInfo::initDwarfEHRegSizeTable(
/*IsAIX*/ false);
}
+void PPC64_SVR4_TargetCodeGenInfo::emitTargetMetadata(
+ CodeGen::CodeGenModule &CGM,
+ const llvm::MapVector<GlobalDecl, StringRef> &MangledDeclNames) const {
+ if (CGM.getTypes().isLongDoubleReferenced()) {
+ llvm::LLVMContext &Ctx = CGM.getLLVMContext();
+ const auto *flt = &CGM.getTarget().getLongDoubleFormat();
+ if (flt == &llvm::APFloat::PPCDoubleDouble())
+ CGM.getModule().addModuleFlag(llvm::Module::Error, "float-abi",
+ llvm::MDString::get(Ctx, "doubledouble"));
+ else if (flt == &llvm::APFloat::IEEEquad())
+ CGM.getModule().addModuleFlag(llvm::Module::Error, "float-abi",
+ llvm::MDString::get(Ctx, "ieeequad"));
+ else if (flt == &llvm::APFloat::IEEEdouble())
+ CGM.getModule().addModuleFlag(llvm::Module::Error, "float-abi",
+ llvm::MDString::get(Ctx, "ieeedouble"));
+ }
+}
+
bool
PPC64TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
llvm::Value *Address) const {