Add support for global initializers.

llvm-svn: 78515
This commit is contained in:
Anders Carlsson
2009-08-08 23:24:23 +00:00
parent cfed3005e5
commit b8be93fc92
7 changed files with 71 additions and 4 deletions

View File

@@ -173,7 +173,7 @@ void CodeGenFunction::StartFunction(const Decl *D, QualType RetTy,
// FIXME: The cast here is a huge hack.
if (CGDebugInfo *DI = getDebugInfo()) {
DI->setLocation(StartLoc);
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) {
DI->EmitFunctionStart(CGM.getMangledName(FD), RetTy, CurFn, Builder);
} else {
// Just use LLVM function name.