[llvm-branch-commits] [llvm-gcc-branch] r95276 - in /llvm-gcc-4.2/branches/Apple/Zoidberg/gcc: llvm-debug.cpp llvm-debug.h
Devang Patel
dpatel at apple.com
Wed Feb 3 17:52:44 PST 2010
Author: dpatel
Date: Wed Feb 3 19:52:44 2010
New Revision: 95276
URL: http://llvm.org/viewvc/llvm-project?rev=95276&view=rev
Log:
merge r94196 from mainline.
Modified:
llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp
llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.h
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=95276&r1=95275&r2=95276&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 Wed Feb 3 19:52:44 2010
@@ -208,6 +208,8 @@
, PrevFullPath("")
, PrevLineNo(0)
, PrevBB(NULL)
+, CurrentGCCLexicalBlock(NULL)
+, FwdTypeCount(0)
, RegionStack()
{}
@@ -582,10 +584,12 @@
// Create a place holder type first. The may be used as a context
// for the argument types.
+ char *FwdTypeName = (char *)alloca(65);
+ sprintf(FwdTypeName, "fwd.type.%d", FwdTypeCount++);
llvm::DIType FwdType =
DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_subroutine_type,
getOrCreateCompileUnit(NULL),
- StringRef(),
+ FwdTypeName,
getOrCreateCompileUnit(NULL),
0, 0, 0, 0, 0,
llvm::DIType(), llvm::DIArray());
Modified: llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.h?rev=95276&r1=95275&r2=95276&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.h (original)
+++ llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.h Wed Feb 3 19:52:44 2010
@@ -62,7 +62,15 @@
const char *PrevFullPath; // Previous location file encountered.
int PrevLineNo; // Previous location line# encountered.
BasicBlock *PrevBB; // Last basic block encountered.
- tree_node *CurrentGCCLexicalBlock; // Current GCC lexical block (or enclosing FUNCTION_DECL).
+
+ // Current GCC lexical block (or enclosing FUNCTION_DECL).
+ tree_node *CurrentGCCLexicalBlock;
+
+ // This counter counts debug info for forward referenced subroutine types.
+ // This counter is used to create unique name for such types so that their
+ // debug info (through MDNodes) is not shared accidently.
+ unsigned FwdTypeCount;
+
std::map<std::string, WeakVH > CUCache;
std::map<tree_node *, WeakVH > TypeCache;
// Cache of previously constructed
More information about the llvm-branch-commits
mailing list