[dragonegg] r174819 - As the identifier length is available, we might as well use it.
Duncan Sands
baldrick at free.fr
Sat Feb 9 13:36:03 PST 2013
Author: baldrick
Date: Sat Feb 9 15:36:03 2013
New Revision: 174819
URL: http://llvm.org/viewvc/llvm-project?rev=174819&view=rev
Log:
As the identifier length is available, we might as well use it.
Modified:
dragonegg/trunk/src/Backend.cpp
Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=174819&r1=174818&r2=174819&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Sat Feb 9 15:36:03 2013
@@ -1475,16 +1475,16 @@ const char *extractRegisterName(tree dec
/// getLLVMAssemblerName - Get the assembler name (DECL_ASSEMBLER_NAME) for the
/// declaration, with any leading star replaced by '\1'.
-std::string getLLVMAssemblerName(union tree_node *decl) {
+std::string getLLVMAssemblerName(tree decl) {
tree Ident = DECL_ASSEMBLER_NAME(decl);
if (!Ident)
return std::string();
const char *Name = IDENTIFIER_POINTER(Ident);
if (*Name != '*')
- return std::string(Name);
+ return std::string(Name, IDENTIFIER_LENGTH(Ident));
- return "\1" + std::string(Name + 1);
+ return "\1" + std::string(Name + 1, IDENTIFIER_LENGTH(Ident) - 1);
}
/// FinalizePlugin - Shutdown the plugin.
More information about the llvm-commits
mailing list