[cfe-commits] r124983 - in /cfe/trunk/lib/CodeGen: CGVTables.cpp CodeGenModule.h
Anders Carlsson
andersca at mac.com
Sun Feb 6 09:15:44 PST 2011
Author: andersca
Date: Sun Feb 6 11:15:43 2011
New Revision: 124983
URL: http://llvm.org/viewvc/llvm-project?rev=124983&view=rev
Log:
Simplify thunks code.
Modified:
cfe/trunk/lib/CodeGen/CGVTables.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.h
Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=124983&r1=124982&r2=124983&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Sun Feb 6 11:15:43 2011
@@ -2451,8 +2451,7 @@
}
llvm::Constant *CodeGenModule::GetAddrOfThunk(GlobalDecl GD,
- const ThunkInfo &Thunk,
- bool ForVTable) {
+ const ThunkInfo &Thunk) {
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
// Compute the mangled name.
@@ -2464,7 +2463,7 @@
getCXXABI().getMangleContext().mangleThunk(MD, Thunk, Name);
const llvm::Type *Ty = getTypes().GetFunctionTypeForVTable(GD);
- return GetOrCreateLLVMFunction(Name, Ty, GD, ForVTable);
+ return GetOrCreateLLVMFunction(Name, Ty, GD, /*ForVTable=*/true);
}
static llvm::Value *PerformTypeAdjustment(CodeGenFunction &CGF,
@@ -2611,7 +2610,7 @@
const llvm::Type *Ty =
CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(GD),
FPT->isVariadic());
- llvm::Value *Callee = CGM.GetAddrOfFunction(GD, Ty);
+ llvm::Value *Callee = CGM.GetAddrOfFunction(GD, Ty, /*ForVTable=*/true);
const CGFunctionInfo &FnInfo =
CGM.getTypes().getFunctionInfo(ResultType, CallArgs,
@@ -2682,7 +2681,7 @@
void CodeGenVTables::EmitThunk(GlobalDecl GD, const ThunkInfo &Thunk)
{
- llvm::Constant *Entry = CGM.GetAddrOfThunk(GD, Thunk, /*ForVTable=*/false);
+ llvm::Constant *Entry = CGM.GetAddrOfThunk(GD, Thunk);
// Strip off a bitcast if we got one back.
if (llvm::ConstantExpr *CE = dyn_cast<llvm::ConstantExpr>(Entry)) {
@@ -2702,7 +2701,7 @@
// Remove the name from the old thunk function and get a new thunk.
OldThunkFn->setName(llvm::StringRef());
- Entry = CGM.GetAddrOfThunk(GD, Thunk, /*ForVTable=*/false);
+ Entry = CGM.GetAddrOfThunk(GD, Thunk);
// If needed, replace the old thunk with a bitcast.
if (!OldThunkFn->use_empty()) {
@@ -2913,7 +2912,7 @@
VTableThunks[NextVTableThunkIndex].first == I) {
const ThunkInfo &Thunk = VTableThunks[NextVTableThunkIndex].second;
- Init = CGM.GetAddrOfThunk(GD, Thunk, /*ForVTable=*/true);
+ Init = CGM.GetAddrOfThunk(GD, Thunk);
NextVTableThunkIndex++;
} else {
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=124983&r1=124982&r2=124983&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Sun Feb 6 11:15:43 2011
@@ -325,8 +325,7 @@
llvm::Constant *GetAddrOfRTTIDescriptor(QualType Ty, bool ForEH = false);
/// GetAddrOfThunk - Get the address of the thunk for the given global decl.
- llvm::Constant *GetAddrOfThunk(GlobalDecl GD, const ThunkInfo &Thunk,
- bool ForVTable);
+ llvm::Constant *GetAddrOfThunk(GlobalDecl GD, const ThunkInfo &Thunk);
/// GetWeakRefReference - Get a reference to the target of VD.
llvm::Constant *GetWeakRefReference(const ValueDecl *VD);
More information about the cfe-commits
mailing list