aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-24 04:59:43 +0000
committerChris Lattner <sabre@nondot.org>2009-07-24 04:59:43 +0000
commit4fe5e1459d85f5829b6e47637e7e0d8a216690f9 (patch)
tree75ffaea0796756889b2eef9175adb4a2f3ad15b2 /lib/Target
parente09c7d714325081ccc42440af8f207e338157911 (diff)
downloadexternal_llvm-4fe5e1459d85f5829b6e47637e7e0d8a216690f9.zip
external_llvm-4fe5e1459d85f5829b6e47637e7e0d8a216690f9.tar.gz
external_llvm-4fe5e1459d85f5829b6e47637e7e0d8a216690f9.tar.bz2
simplify code by making special case more obvious
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76950 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/PIC16/PIC16TargetAsmInfo.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Target/PIC16/PIC16TargetAsmInfo.cpp b/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
index c9ef45a..9adf63a 100644
--- a/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
+++ b/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
@@ -247,7 +247,6 @@ PIC16TargetAsmInfo::~PIC16TargetAsmInfo() {
// 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 @@ PIC16TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
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