From 52e7fe421bb5bd8385306558097583a60349ab55 Mon Sep 17 00:00:00 2001 From: Yuri Iozzelli Date: Tue, 19 Nov 2024 15:43:43 +0100 Subject: [PATCH] fix(rtti): the rtti vtable is always in the default section --- clang/lib/CodeGen/ItaniumCXXABI.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp index 1a912f36d3c9..1f57a56dd1a0 100644 --- a/clang/lib/CodeGen/ItaniumCXXABI.cpp +++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp @@ -3952,12 +3952,7 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) { } if(!CGM.getTarget().isByteAddressable()) { - bool asmjs = false; - if (Ty->isRecordType()){ - asmjs = cast(cast(Ty)->getDecl())->hasAttr(); - } else { - asmjs = CGM.getContext().getTargetInfo().getTriple().getEnvironment() == llvm::Triple::WebAssembly; - } + bool asmjs = CGM.getContext().getTargetInfo().getTriple().isCheerpWasm(); llvm::Type* WrapperTypes[] = {CGM.getTypes().GetBasicVTableType(8, asmjs)}; llvm::Type* VTableType = llvm::StructType::get(CGM.getLLVMContext(), WrapperTypes, false, NULL, /*bytelayout*/false, asmjs); llvm::Constant *VTable = CGM.getModule().getOrInsertGlobal(VTableName, VTableType);