summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-10 23:38:47 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-10 23:38:47 +0000
commit38988d7ee0b8ae70331a90e90c706ba0524679f3 (patch)
treea742d34fd2de476723ead254e315a4d64ce6a3a0 /clang/lib/CodeGen/CodeGenModule.cpp
parent8d6298b2724342240abefafd01621942fe554812 (diff)
downloadbcm5719-llvm-38988d7ee0b8ae70331a90e90c706ba0524679f3.tar.gz
bcm5719-llvm-38988d7ee0b8ae70331a90e90c706ba0524679f3.zip
Add stricter GlobalDecl constructors.
llvm-svn: 81480
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index fbd8521e193..37e283a9b63 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -141,7 +141,7 @@ void CodeGenModule::setGlobalVisibility(llvm::GlobalValue *GV,
}
const char *CodeGenModule::getMangledName(const GlobalDecl &GD) {
- const NamedDecl *ND = GD.getDecl();
+ const NamedDecl *ND = cast<NamedDecl>(GD.getDecl());
if (const CXXConstructorDecl *D = dyn_cast<CXXConstructorDecl>(ND))
return getMangledCXXCtorName(D, GD.getCtorType());
@@ -545,7 +545,7 @@ bool CodeGenModule::MayDeferGeneration(const ValueDecl *Global) {
}
void CodeGenModule::EmitGlobal(GlobalDecl GD) {
- const ValueDecl *Global = GD.getDecl();
+ const ValueDecl *Global = cast<ValueDecl>(GD.getDecl());
// If this is an alias definition (which otherwise looks like a declaration)
// emit it now.
@@ -594,7 +594,7 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
}
void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) {
- const ValueDecl *D = GD.getDecl();
+ const ValueDecl *D = cast<ValueDecl>(GD.getDecl());
if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(D))
EmitCXXConstructor(CD, GD.getCtorType());
@@ -810,7 +810,7 @@ llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD,
const llvm::Type *Ty) {
// If there was no specific requested type, just convert it now.
if (!Ty)
- Ty = getTypes().ConvertType(GD.getDecl()->getType());
+ Ty = getTypes().ConvertType(cast<ValueDecl>(GD.getDecl())->getType());
return GetOrCreateLLVMFunction(getMangledName(GD), Ty, GD);
}
@@ -1643,7 +1643,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
// Fall through
case Decl::Var:
- EmitGlobal(GlobalDecl(cast<ValueDecl>(D)));
+ EmitGlobal(GlobalDecl(cast<VarDecl>(D)));
break;
// C++ Decls
OpenPOWER on IntegriCloud