[llvm] r198351 - Fix up a couple of review comments:
Eric Christopher
echristo at gmail.com
Thu Jan 2 13:03:28 PST 2014
Author: echristo
Date: Thu Jan 2 15:03:28 2014
New Revision: 198351
URL: http://llvm.org/viewvc/llvm-project?rev=198351&view=rev
Log:
Fix up a couple of review comments:
Use an if statement instead of a pair of ternary operators checking
the same condition.
Use a cheap method call rather than returning the local symbol.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=198351&r1=198350&r2=198351&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Jan 2 15:03:28 2014
@@ -822,14 +822,14 @@ DwarfCompileUnit *DwarfDebug::constructD
if (!FirstCU)
FirstCU = NewCU;
- NewCU->initSection(
- useSplitDwarf() ? Asm->getObjFileLowering().getDwarfInfoDWOSection()
- : Asm->getObjFileLowering().getDwarfInfoSection(),
- useSplitDwarf() ? DwarfInfoDWOSectionSym : DwarfInfoSectionSym);
-
- // If we're splitting the dwarf then construct the skeleton CU now.
- if (useSplitDwarf())
+ if (useSplitDwarf()) {
+ NewCU->initSection(Asm->getObjFileLowering().getDwarfInfoDWOSection(),
+ DwarfInfoDWOSectionSym);
+ // If we're splitting the dwarf then construct the skeleton CU now.
NewCU->setSkeleton(constructSkeletonCU(NewCU));
+ } else
+ NewCU->initSection(Asm->getObjFileLowering().getDwarfInfoSection(),
+ DwarfInfoSectionSym);
CUMap.insert(std::make_pair(DIUnit, NewCU));
CUDieMap.insert(std::make_pair(Die, NewCU));
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=198351&r1=198350&r2=198351&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Thu Jan 2 15:03:28 2014
@@ -185,7 +185,7 @@ public:
MCSymbol *getLocalSectionSym() const {
if (Skeleton)
return Skeleton->getSectionSym();
- return SectionSym;
+ return getSectionSym();
}
MCSymbol *getSectionSym() const {
@@ -198,7 +198,7 @@ public:
MCSymbol *getLocalLabelBegin() const {
if (Skeleton)
return Skeleton->getLabelBegin();
- return LabelBegin;
+ return getLabelBegin();
}
MCSymbol *getLabelBegin() const {
More information about the llvm-commits
mailing list