summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-01-16 20:22:55 +0000
committerRui Ueyama <ruiu@google.com>2014-01-16 20:22:55 +0000
commit5efa665f7bda1e4e6afb415ce05f847d0ffe00b5 (patch)
treea6b8e9e855548655434a029975436a17323f5907 /llvm/lib/Object/COFFObjectFile.cpp
parent8ff24d25de174da838e79b4f7363a30c3732f16b (diff)
downloadbcm5719-llvm-5efa665f7bda1e4e6afb415ce05f847d0ffe00b5.tar.gz
bcm5719-llvm-5efa665f7bda1e4e6afb415ce05f847d0ffe00b5.zip
Reduce nesting.
llvm-svn: 199418
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index d0ef1b3bbd3..007d28e6bdf 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -145,21 +145,19 @@ error_code COFFObjectFile::getSymbolType(DataRefImpl Ref,
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;
}
OpenPOWER on IntegriCloud