[llvm] r232478 - Convert the easy cases of GetTempSymbol to createTempSymbol.

David Blaikie dblaikie at gmail.com
Tue Mar 17 08:39:56 PDT 2015


On Tue, Mar 17, 2015 at 7:22 AM, Rafael Espindola <
rafael.espindola at gmail.com> wrote:

> Author: rafael
> Date: Tue Mar 17 09:22:31 2015
> New Revision: 232478
>
> URL: http://llvm.org/viewvc/llvm-project?rev=232478&view=rev
> Log:
> Convert the easy cases of GetTempSymbol to createTempSymbol.
>
> In these cases no code was depending on GetTempSymbol finding an existing
> symbol.
>

Is it possible/are you planning to remove GetTempSymbol entirely? I had
some aspirations of doing that at one point - to avoid
spooky-action-at-a-distance stuff where one bit of code would create a
label and some otherwise unrelated bit of code would use/rely on that label
- seemed like bad design whenever that cropped up (sort of like using
global hashmaps rather than actually passing the required data from source
to destination)


>
> Modified:
>     llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
>     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp
>     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
>     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
>     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
>     llvm/trunk/lib/Target/AArch64/AArch64AsmPrinter.cpp
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=232478&r1=232477&r2=232478&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Mar 17 09:22:31
> 2015
> @@ -1575,7 +1575,7 @@ void AsmPrinter::EmitLabelDifference(con
>    }
>
>    // Otherwise, emit with .set (aka assignment).
> -  MCSymbol *SetLabel = GetTempSymbol("set", SetCounter++);
> +  MCSymbol *SetLabel = createTempSymbol("set", SetCounter++);
>    OutStreamer.EmitAssignment(SetLabel, Diff);
>    OutStreamer.EmitSymbolValue(SetLabel, Size);
>  }
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp?rev=232478&r1=232477&r2=232478&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp Tue Mar 17
> 09:22:31 2015
> @@ -96,7 +96,7 @@ void DwarfAccelTable::FinalizeTable(AsmP
>    for (size_t i = 0, e = Data.size(); i < e; ++i) {
>      uint32_t bucket = Data[i]->HashValue % Header.bucket_count;
>      Buckets[bucket].push_back(Data[i]);
> -    Data[i]->Sym = Asm->GetTempSymbol(Prefix, i);
> +    Data[i]->Sym = Asm->createTempSymbol(Prefix, i);
>    }
>
>    // Sort the contents of the buckets by hash value so that hash
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=232478&r1=232477&r2=232478&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue Mar 17
> 09:22:31 2015
> @@ -380,7 +380,7 @@ void DwarfCompileUnit::addScopeRangeList
>        TLOF.getDwarfRangesSection()->getBeginSymbol();
>
>    RangeSpanList List(
> -      Asm->GetTempSymbol("debug_ranges", DD->getNextRangeNumber()),
> +      Asm->createTempSymbol("debug_ranges", DD->getNextRangeNumber()),
>        std::move(Range));
>
>    // Under fission, ranges are specified by constant offsets relative to
> the
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=232478&r1=232477&r2=232478&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Mar 17 09:22:31
> 2015
> @@ -927,7 +927,7 @@ DwarfDebug::collectVariableInfo(DwarfCom
>      DebugLocList &LocList = DotDebugLocEntries.back();
>      LocList.CU = &TheCU;
>      LocList.Label =
> -        Asm->GetTempSymbol("debug_loc", DotDebugLocEntries.size() - 1);
> +        Asm->createTempSymbol("debug_loc", DotDebugLocEntries.size() - 1);
>
>      // Build the location list for this variable.
>      buildLocationList(LocList.List, Ranges);
> @@ -1669,7 +1669,7 @@ void DwarfDebug::emitDebugARanges() {
>        // if we know the section name up-front. For user-created sections,
> the
>        // resulting label may not be valid to use as a label. (section
> names can
>        // use a greater set of characters on some systems)
> -      Sym = Asm->GetTempSymbol("debug_end", ID);
> +      Sym = Asm->createTempSymbol("debug_end", ID);
>        Asm->OutStreamer.SwitchSection(Section);
>        Asm->OutStreamer.EmitLabel(Sym);
>      }
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp?rev=232478&r1=232477&r2=232478&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp Tue Mar 17
> 09:22:31 2015
> @@ -19,7 +19,7 @@ getEntry(AsmPrinter &Asm,
>    std::pair<MCSymbol *, unsigned> &Entry = Pool[Str];
>    if (!Entry.first) {
>      Entry.second = Pool.size() - 1;
> -    Entry.first = Asm.GetTempSymbol(Prefix, Entry.second);
> +    Entry.first = Asm.createTempSymbol(Prefix, Entry.second);
>    }
>    return Entry;
>  }
>
> Modified: llvm/trunk/lib/Target/AArch64/AArch64AsmPrinter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64AsmPrinter.cpp?rev=232478&r1=232477&r2=232478&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/AArch64/AArch64AsmPrinter.cpp (original)
> +++ llvm/trunk/lib/Target/AArch64/AArch64AsmPrinter.cpp Tue Mar 17
> 09:22:31 2015
> @@ -464,7 +464,7 @@ void AArch64AsmPrinter::EmitInstruction(
>
>    if (AArch64FI->getLOHRelated().count(MI)) {
>      // Generate a label for LOH related instruction
> -    MCSymbol *LOHLabel = GetTempSymbol("loh", LOHLabelCounter++);
> +    MCSymbol *LOHLabel = createTempSymbol("loh", LOHLabelCounter++);
>      // Associate the instruction with the label
>      LOHInstToLabel[MI] = LOHLabel;
>      OutStreamer.EmitLabel(LOHLabel);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150317/223b12c5/attachment.html>


More information about the llvm-commits mailing list