[llvm-commits] [llvm-gcc-4.2] r65475 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Devang Patel
dpatel at apple.com
Wed Feb 25 13:57:17 PST 2009
Author: dpatel
Date: Wed Feb 25 15:57:16 2009
New Revision: 65475
URL: http://llvm.org/viewvc/llvm-project?rev=65475&view=rev
Log:
(Try again) Use original name if it is available.
Use simpler code otherwise it may trip over g++-4.0 ;)
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=65475&r1=65474&r2=65475&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Wed Feb 25 15:57:16 2009
@@ -342,8 +342,15 @@
// Gather location information.
expanded_location Loc = expand_location(DECL_SOURCE_LOCATION(decl));
DIType TyD = getOrCreateType(TREE_TYPE(decl));
+ std::string DispName = GV->getNameStr();
+ if (DECL_NAME(decl)) {
+ if (IDENTIFIER_POINTER(DECL_NAME(decl)))
+ DispName = IDENTIFIER_POINTER(DECL_NAME(decl));
+ }
+
DebugFactory.CreateGlobalVariable(getOrCreateCompileUnit(Loc.file),
- GV->getNameStr(), GV->getNameStr(),
+ GV->getNameStr(),
+ DispName,
getLinkageName(decl),
getOrCreateCompileUnit(Loc.file), Loc.line,
TyD, GV->hasInternalLinkage(),
More information about the llvm-commits
mailing list