Fix up a couple of review comments:
authorEric Christopher <echristo@gmail.com>
Thu, 2 Jan 2014 21:03:28 +0000 (21:03 +0000)
committerEric Christopher <echristo@gmail.com>
Thu, 2 Jan 2014 21:03:28 +0000 (21:03 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198351 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.h

index acb25ccaaf173b339454a3f48c8c8623c4812f5e..aa2a1f757083c861c905ac395f05cc0c93eb5128 100644 (file)
@@ -822,14 +822,14 @@ DwarfCompileUnit *DwarfDebug::constructDwarfCompileUnit(DICompileUnit DIUnit) {
   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));
index 808c9c25ed35b91ac878e5f66856897b34529bc5..524cdc1b59f4c8d7cf08f6919a699e8673a4ef4f 100644 (file)
@@ -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 {