[llvm] r199418 - Reduce nesting.

Rui Ueyama ruiu at google.com
Thu Jan 16 12:22:55 PST 2014


Author: ruiu
Date: Thu Jan 16 14:22:55 2014
New Revision: 199418

URL: http://llvm.org/viewvc/llvm-project?rev=199418&view=rev
Log:
Reduce nesting.

Modified:
    llvm/trunk/lib/Object/COFFObjectFile.cpp

Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=199418&r1=199417&r2=199418&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Thu Jan 16 14:22:55 2014
@@ -145,21 +145,19 @@ error_code COFFObjectFile::getSymbolType
   if (Symb->StorageClass == COFF::IMAGE_SYM_CLASS_EXTERNAL &&
       Symb->SectionNumber == COFF::IMAGE_SYM_UNDEFINED) {
     Result = SymbolRef::ST_Unknown;
+  } else if (Symb->getComplexType() == COFF::IMAGE_SYM_DTYPE_FUNCTION) {
+    Result = SymbolRef::ST_Function;
   } else {
-    if (Symb->getComplexType() == COFF::IMAGE_SYM_DTYPE_FUNCTION) {
-      Result = SymbolRef::ST_Function;
-    } else {
-      uint32_t Characteristics = 0;
-      if (Symb->SectionNumber > 0) {
-        const coff_section *Section = NULL;
-        if (error_code EC = getSection(Symb->SectionNumber, Section))
-          return EC;
-        Characteristics = Section->Characteristics;
-      }
-      if (Characteristics & COFF::IMAGE_SCN_MEM_READ &&
-          ~Characteristics & COFF::IMAGE_SCN_MEM_WRITE) // Read only.
-        Result = SymbolRef::ST_Data;
+    uint32_t Characteristics = 0;
+    if (Symb->SectionNumber > 0) {
+      const coff_section *Section = NULL;
+      if (error_code EC = getSection(Symb->SectionNumber, Section))
+        return EC;
+      Characteristics = Section->Characteristics;
     }
+    if (Characteristics & COFF::IMAGE_SCN_MEM_READ &&
+        ~Characteristics & COFF::IMAGE_SCN_MEM_WRITE) // Read only.
+      Result = SymbolRef::ST_Data;
   }
   return object_error::success;
 }





More information about the llvm-commits mailing list