[llvm-commits] [dragonegg] r88790 - /dragonegg/trunk/llvm-debug.cpp
Duncan Sands
baldrick at free.fr
Sat Nov 14 06:10:09 PST 2009
Author: baldrick
Date: Sat Nov 14 08:10:09 2009
New Revision: 88790
URL: http://llvm.org/viewvc/llvm-project?rev=88790&view=rev
Log:
Port commit 88701 (dpatel) from llvm-gcc:
Avoid using c_str() on temp. string.
Modified:
dragonegg/trunk/llvm-debug.cpp
Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=88790&r1=88789&r2=88790&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Sat Nov 14 08:10:09 2009
@@ -361,7 +361,8 @@
// Gather location information.
expanded_location Loc = expand_location(DECL_SOURCE_LOCATION(decl));
DIType TyD = getOrCreateType(TREE_TYPE(decl));
- const char *DispName = GV->getNameStr().c_str();
+ std::string DispNameStr = GV->getNameStr();
+ const char *DispName = DispNameStr.c_str();
if (DECL_NAME(decl)) {
if (IDENTIFIER_POINTER(DECL_NAME(decl)))
DispName = IDENTIFIER_POINTER(DECL_NAME(decl));
More information about the llvm-commits
mailing list