From 35c98cc4c00efcfe47ad0b716e7c50afb9c5ff75 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 3 Dec 2009 04:27:05 +0000 Subject: [PATCH] Minor cleanup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90411 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGCXX.cpp | 13 ++++--------- lib/CodeGen/CodeGenFunction.h | 4 ++-- lib/CodeGen/CodeGenModule.h | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index 2fa13eb12d..77d3a3eb42 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -829,7 +829,7 @@ const char *CodeGenModule::getMangledCXXDtorName(const CXXDestructorDecl *D, } llvm::Constant * -CodeGenFunction::GenerateThunk(llvm::Function *Fn, const GlobalDecl &GD, +CodeGenFunction::GenerateThunk(llvm::Function *Fn, GlobalDecl GD, bool Extern, const ThunkAdjustment &ThisAdjustment) { return GenerateCovariantThunk(Fn, GD, Extern, @@ -875,9 +875,8 @@ CodeGenFunction::DynamicTypeAdjust(llvm::Value *V, llvm::Constant * CodeGenFunction::GenerateCovariantThunk(llvm::Function *Fn, - const GlobalDecl &GD, bool Extern, + GlobalDecl GD, bool Extern, const CovariantThunkAdjustment &Adjustment) { - const CXXMethodDecl *MD = cast(GD.getDecl()); QualType ResultType = MD->getType()->getAs()->getResultType(); @@ -908,11 +907,7 @@ CodeGenFunction::GenerateCovariantThunk(llvm::Function *Fn, const llvm::Type *Ty = CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(MD), FPT->isVariadic()); - llvm::Value *Callee; - if (const CXXDestructorDecl *Dtor = dyn_cast(MD)) - Callee = CGM.GetAddrOfCXXDestructor(Dtor, GD.getDtorType()); - else - Callee = CGM.GetAddrOfFunction(MD, Ty); + llvm::Value *Callee = CGM.GetAddrOfFunction(GD, Ty); CallArgList CallArgs; @@ -990,7 +985,7 @@ CodeGenFunction::GenerateCovariantThunk(llvm::Function *Fn, } llvm::Constant * -CodeGenModule::BuildThunk(const GlobalDecl &GD, bool Extern, +CodeGenModule::BuildThunk(GlobalDecl GD, bool Extern, const ThunkAdjustment &ThisAdjustment) { const CXXMethodDecl *MD = cast(GD.getDecl()); llvm::SmallString<256> OutName; diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 43c968bb13..0838cf0f81 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -452,11 +452,11 @@ public: const ThunkAdjustment &Adjustment); /// GenerateThunk - Generate a thunk for the given method - llvm::Constant *GenerateThunk(llvm::Function *Fn, const GlobalDecl &GD, + llvm::Constant *GenerateThunk(llvm::Function *Fn, GlobalDecl GD, bool Extern, const ThunkAdjustment &ThisAdjustment); llvm::Constant * - GenerateCovariantThunk(llvm::Function *Fn, const GlobalDecl &GD, + GenerateCovariantThunk(llvm::Function *Fn, GlobalDecl GD, bool Extern, const CovariantThunkAdjustment &Adjustment); diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index dbe9c95bf9..b0e1b12ed9 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -234,7 +234,7 @@ public: llvm::Constant *GenerateRTTI(QualType Ty); /// BuildThunk - Build a thunk for the given method. - llvm::Constant *BuildThunk(const GlobalDecl &GD, bool Extern, + llvm::Constant *BuildThunk(GlobalDecl GD, bool Extern, const ThunkAdjustment &ThisAdjustment); /// BuildCoVariantThunk - Build a thunk for the given method