[llvm-commits] [llvm-gcc-4.2] r68848 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Devang Patel
dpatel at apple.com
Mon Apr 13 13:05:40 PDT 2009
On Apr 13, 2009, at 12:59 PM, Dan Gohman wrote:
>
> On Apr 10, 2009, at 5:17 PM, Devang Patel wrote:
>
>> Author: dpatel
>> Date: Fri Apr 10 19:17:54 2009
>> New Revision: 68848
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=68848&view=rev
>> Log:
>> If linkage name is not available then use function display name as
>> linkage name.
>
> Hi Devang,
>
> What does this fix? Why is a bogus linkage name better than no
> linkage name?
In C, linkage name is same as name.
This info is used during FastISel to decide whether we are at the
beginning of inlined subroutine or not.
std::string SPName;
Subprogram.getLinkageName(SPName);
if (!SPName.empty()
&& strcmp(SPName.c_str(), MF.getFunction()-
>getNameStart())) {
-
Devang
>
>
> Dan
>
>>
>>
>> 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=68848&r1=68847&r2=68848&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
>> +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Apr 10 19:17:54 2009
>> @@ -190,7 +190,7 @@
>> return IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(Node));
>> }
>> }
>> - return "";
>> + return NULL;
>> }
>>
>> DebugInfo::DebugInfo(Module *m)
>> @@ -211,12 +211,11 @@
>> // Gather location information.
>> expanded_location Loc = GetNodeLocation(FnDecl, false);
>> const char *LinkageName = getLinkageName(FnDecl);
>> -
>> + const char *FnName = lang_hooks.dwarf_name(FnDecl, 0);
>> DISubprogram SP =
>> DebugFactory.CreateSubprogram(findRegion(FnDecl),
>> - lang_hooks.dwarf_name(FnDecl, 0),
>> - lang_hooks.dwarf_name(FnDecl, 0),
>> - LinkageName,
>> + FnName, FnName,
>> + LinkageName ? LinkageName :
>> FnName,
>> getOrCreateCompileUnit(Loc.file),
>> CurLineNo,
>> getOrCreateType(TREE_TYPE(FnDecl)),
>> Fn->hasInternalLinkage(),
>> @@ -345,11 +344,11 @@
>> if (IDENTIFIER_POINTER(DECL_NAME(decl)))
>> DispName = IDENTIFIER_POINTER(DECL_NAME(decl));
>> }
>> -
>> + const char *LinkageName = getLinkageName(decl);
>> DebugFactory.CreateGlobalVariable(getOrCreateCompileUnit(Loc.file),
>> GV->getNameStr(),
>> DispName,
>> - getLinkageName(decl),
>> + LinkageName ? LinkageName :
>> DispName,
>>
>> getOrCreateCompileUnit(Loc.file), Loc.line,
>> TyD, GV->hasInternalLinkage(),
>> true/*definition*/, GV);
>> @@ -668,7 +667,7 @@
>> DIType SPTy = getOrCreateType(TREE_TYPE(Member));
>> DISubprogram SP =
>> DebugFactory.CreateSubprogram(findRegion(Member), MemberName,
>> MemberName,
>> - LinkageName,
>> + LinkageName ? LinkageName :
>> MemberName,
>>
>> getOrCreateCompileUnit(MemLoc.file),
>> MemLoc.line, SPTy, false, false);
>> EltTys.push_back(SP);
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list