[llvm-commits] [llvm] r76950 - /llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp

Chris Lattner sabre at nondot.org
Thu Jul 23 21:59:44 PDT 2009


Author: lattner
Date: Thu Jul 23 23:59:43 2009
New Revision: 76950

URL: http://llvm.org/viewvc/llvm-project?rev=76950&view=rev
Log:
simplify code by making special case more obvious

Modified:
    llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp

Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp?rev=76950&r1=76949&r2=76950&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp Thu Jul 23 23:59:43 2009
@@ -247,7 +247,6 @@
 // which have a section name or address.
 const Section* 
 PIC16TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
-  const Section* S;
   // If GV has a sectin name or section address create that section now.
   if (GV->hasSection()) {
     std::string SectName = GV->getSection();
@@ -256,15 +255,12 @@
     std::string AddrStr = "Address=";
     if (SectName.compare(0, AddrStr.length(), AddrStr) == 0) {
       std::string SectAddr = SectName.substr(AddrStr.length());
-      S = CreateSectionForGlobal(GV, SectAddr);
-    } else {
-      S = CreateSectionForGlobal(GV);
-    } 
-  } else {
-    // Use section depending on the 'type' of variable
-    S = SelectSectionForGlobal(GV);
+      return CreateSectionForGlobal(GV, SectAddr);
+    }
   }
-  return S;
+  
+  // Use section depending on the 'type' of variable
+  return SelectSectionForGlobal(GV);
 }
 
 // Create a new section for global variable. If Addr is given then create





More information about the llvm-commits mailing list