r188492 - DebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type match the semantics
David Blaikie
dblaikie at gmail.com
Thu Aug 15 14:42:43 PDT 2013
Author: dblaikie
Date: Thu Aug 15 16:42:43 2013
New Revision: 188492
URL: http://llvm.org/viewvc/llvm-project?rev=188492&view=rev
Log:
DebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type match the semantics
Rather than having a cast immediately inside the function, push that
type requirement out to the callers.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.h
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=188492&r1=188491&r2=188492&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Aug 15 16:42:43 2013
@@ -3002,8 +3002,8 @@ void CGDebugInfo::EmitDeclareOfBlockLite
/// getStaticDataMemberDeclaration - If D is an out-of-class definition of
/// a static data member of a class, find its corresponding in-class
/// declaration.
-llvm::DIDerivedType CGDebugInfo::getStaticDataMemberDeclaration(const Decl *D) {
- if (cast<VarDecl>(D)->isStaticDataMember()) {
+llvm::DIDerivedType CGDebugInfo::getStaticDataMemberDeclaration(const VarDecl *D) {
+ if (D->isStaticDataMember()) {
llvm::DenseMap<const Decl *, llvm::WeakVH>::iterator
MI = StaticDataMemberCache.find(D->getCanonicalDecl());
if (MI != StaticDataMemberCache.end())
@@ -3093,10 +3093,9 @@ void CGDebugInfo::EmitGlobalVariable(con
// Do not use DIGlobalVariable for enums.
if (Ty.getTag() == llvm::dwarf::DW_TAG_enumeration_type)
return;
- llvm::DIGlobalVariable GV =
- DBuilder.createStaticVariable(Unit, Name, Name, Unit,
- getLineNumber(VD->getLocation()), Ty, true,
- Init, getStaticDataMemberDeclaration(VD));
+ llvm::DIGlobalVariable GV = DBuilder.createStaticVariable(
+ Unit, Name, Name, Unit, getLineNumber(VD->getLocation()), Ty, true, Init,
+ getStaticDataMemberDeclaration(cast<VarDecl>(VD)));
DeclCache.insert(std::make_pair(VD->getCanonicalDecl(), llvm::WeakVH(GV)));
}
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=188492&r1=188491&r2=188492&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Thu Aug 15 16:42:43 2013
@@ -357,7 +357,7 @@ private:
/// getStaticDataMemberDeclaration - Return debug info descriptor to
/// describe in-class static data member declaration for the given
/// out-of-class definition.
- llvm::DIDerivedType getStaticDataMemberDeclaration(const Decl *D);
+ llvm::DIDerivedType getStaticDataMemberDeclaration(const VarDecl *D);
/// getFunctionName - Get function name for the given FunctionDecl. If the
/// name is constructred on demand (e.g. C++ destructor) then the name
More information about the cfe-commits
mailing list