[llvm-branch-commits] [llvm-gcc-branch] r90485 - /llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp
Devang Patel
dpatel at apple.com
Thu Dec 3 13:43:29 PST 2009
Author: dpatel
Date: Thu Dec 3 15:43:29 2009
New Revision: 90485
URL: http://llvm.org/viewvc/llvm-project?rev=90485&view=rev
Log:
$ svn merge -c 90475 https://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk
--- Merging r90475 into '.':
U gcc/llvm-debug.cpp
Modified:
llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp
Modified: llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp?rev=90485&r1=90484&r2=90485&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp Thu Dec 3 15:43:29 2009
@@ -255,7 +255,14 @@
unsigned lineno = CurLineNo;
if (isCopyOrDestroyHelper(FnDecl))
lineno = 0;
-
+
+ unsigned Virtuality = 0;
+ unsigned VIndex = 0;
+ DIType ContainingType;
+ if (DECL_VINDEX (FnDecl)) {
+ Virtuality = dwarf::DW_VIRTUALITY_virtual;
+ ContainingType = getOrCreateType(DECL_CONTEXT (FnDecl));
+ }
DISubprogram SP =
DebugFactory.CreateSubprogram(findRegion(FnDecl),
lang_hooks.dwarf_name(FnDecl, 0),
@@ -264,7 +271,9 @@
getOrCreateCompileUnit(Loc.file), lineno,
FNType,
Fn->hasInternalLinkage(),
- true /*definition*/);
+ true /*definition*/,
+ Virtuality, VIndex, ContainingType);
+
SPCache[FnDecl] = WeakVH(SP.getNode());
@@ -714,18 +723,30 @@
llvm::SmallVector<llvm::DIDescriptor, 16> EltTys;
if (tree binfo = TYPE_BINFO(type)) {
+ VEC(tree,gc) *accesses = BINFO_BASE_ACCESSES (binfo);
+
for (unsigned i = 0, e = BINFO_N_BASE_BINFOS(binfo); i != e; ++i) {
tree BInfo = BINFO_BASE_BINFO(binfo, i);
tree BInfoType = BINFO_TYPE (BInfo);
DIType BaseClass = getOrCreateType(BInfoType);
-
+ unsigned Flags = 0;
+ if (BINFO_VIRTUAL_P (BInfo))
+ Flags = llvm::DIType::FlagVirtual;
+ if (accesses) {
+ tree access = VEC_index (tree, accesses, i);
+ if (access == access_protected_node)
+ Flags |= llvm::DIType::FlagProtected;
+ else if (access == access_private_node)
+ Flags |= llvm::DIType::FlagPrivate;
+ }
+
// FIXME : name, size, align etc...
DIType DTy =
DebugFactory.CreateDerivedType(DW_TAG_inheritance,
findRegion(type), StringRef(),
llvm::DICompileUnit(), 0,0,0,
- getINTEGER_CSTVal(BINFO_OFFSET(BInfo)),
- 0, BaseClass);
+ getINTEGER_CSTVal(BINFO_OFFSET(BInfo))*8,
+ Flags, BaseClass);
EltTys.push_back(DTy);
}
}
@@ -793,11 +814,19 @@
const char *MemberName = lang_hooks.dwarf_name(Member, 0);
StringRef LinkageName = getLinkageName(Member);
DIType SPTy = getOrCreateType(TREE_TYPE(Member));
+ unsigned Virtuality = 0;
+ unsigned VIndex = 0;
+ DIType ContainingType;
+ if (DECL_VINDEX (Member)) {
+ Virtuality = dwarf::DW_VIRTUALITY_virtual;
+ ContainingType = getOrCreateType(DECL_CONTEXT(Member));
+ }
DISubprogram SP =
DebugFactory.CreateSubprogram(findRegion(Member), MemberName, MemberName,
LinkageName,
getOrCreateCompileUnit(MemLoc.file),
- MemLoc.line, SPTy, false, false);
+ MemLoc.line, SPTy, false, false,
+ Virtuality, VIndex, ContainingType);
EltTys.push_back(SP);
SPCache[Member] = WeakVH(SP.getNode());
}
More information about the llvm-branch-commits
mailing list