From 4269ad98c81ba9e630c334fc299aae6fc2b7786a Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Mon, 7 Jul 2014 06:20:47 +0000 Subject: CodeGen: Refactor RTTI emission Let's not expose ABI specific minutia inside of CodeGenModule and Type. Instead, let's abstract it through CXXABI. This gets rid of: CodeGenModule::getCompleteObjectLocator, CodeGenModule::EmitFundamentalTypeDescriptor{s,}, CodeGenModule::getMSTypeDescriptor, CodeGenModule::getMSCompleteObjectLocator, CGCXXABI::shouldRTTIBeUnique, CGCXXABI::classifyRTTIUniqueness. CGRTTI was *almost* entirely centered around providing Itanium-style RTTI information. Instead of providing interfaces that only it consumes, move it to the ItaniumCXXABI implementation file. This allows it to have access to Itanium-specific implementation details without providing useless expansion points for the Microsoft ABI side. Differential Revision: http://reviews.llvm.org/D4261 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212435 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGCXXABI.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'lib/CodeGen/CGCXXABI.cpp') diff --git a/lib/CodeGen/CGCXXABI.cpp b/lib/CodeGen/CGCXXABI.cpp index ee65d77d4b..55ddd666c4 100644 --- a/lib/CodeGen/CGCXXABI.cpp +++ b/lib/CodeGen/CGCXXABI.cpp @@ -325,31 +325,3 @@ LValue CGCXXABI::EmitThreadLocalVarDeclLValue(CodeGenFunction &CGF, bool CGCXXABI::NeedsVTTParameter(GlobalDecl GD) { return false; } - -/// What sort of uniqueness rules should we use for the RTTI for the -/// given type? -CGCXXABI::RTTIUniquenessKind -CGCXXABI::classifyRTTIUniqueness(QualType CanTy, - llvm::GlobalValue::LinkageTypes Linkage) { - if (shouldRTTIBeUnique()) - return RUK_Unique; - - // It's only necessary for linkonce_odr or weak_odr linkage. - if (Linkage != llvm::GlobalValue::LinkOnceODRLinkage && - Linkage != llvm::GlobalValue::WeakODRLinkage) - return RUK_Unique; - - // It's only necessary with default visibility. - if (CanTy->getVisibility() != DefaultVisibility) - return RUK_Unique; - - // If we're not required to publish this symbol, hide it. - if (Linkage == llvm::GlobalValue::LinkOnceODRLinkage) - return RUK_NonUniqueHidden; - - // If we're required to publish this symbol, as we might be under an - // explicit instantiation, leave it with default visibility but - // enable string-comparisons. - assert(Linkage == llvm::GlobalValue::WeakODRLinkage); - return RUK_NonUniqueVisible; -} -- cgit v1.2.1