[lld] r296688 - Reduce nesting. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 1 14:02:57 PST 2017
Author: ruiu
Date: Wed Mar 1 16:02:57 2017
New Revision: 296688
URL: http://llvm.org/viewvc/llvm-project?rev=296688&view=rev
Log:
Reduce nesting. NFC.
Modified:
lld/trunk/ELF/GdbIndex.cpp
Modified: lld/trunk/ELF/GdbIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/GdbIndex.cpp?rev=296688&r1=296687&r2=296688&view=diff
==============================================================================
--- lld/trunk/ELF/GdbIndex.cpp (original)
+++ lld/trunk/ELF/GdbIndex.cpp Wed Mar 1 16:02:57 2017
@@ -79,15 +79,16 @@ class lld::elf::ObjInfoTy : public llvm:
};
template <class ELFT>
-GdbIndexBuilder<ELFT>::GdbIndexBuilder(InputSection *DebugInfoSec)
- : DebugInfoSec(DebugInfoSec), ObjInfo(new ObjInfoTy) {
- if (Expected<std::unique_ptr<object::ObjectFile>> Obj =
- object::ObjectFile::createObjectFile(
- DebugInfoSec->template getFile<ELFT>()->MB))
+GdbIndexBuilder<ELFT>::GdbIndexBuilder(InputSection *Sec)
+ : DebugInfoSec(Sec), ObjInfo(new ObjInfoTy) {
+ elf::ObjectFile<ELFT> *File = Sec->template getFile<ELFT>();
+ Expected<std::unique_ptr<object::ObjectFile>> Obj =
+ object::ObjectFile::createObjectFile(File->MB);
+
+ if (Obj)
Dwarf.reset(new DWARFContextInMemory(*Obj.get(), ObjInfo.get()));
else
- error(toString(DebugInfoSec->template getFile<ELFT>()) +
- ": error creating DWARF context");
+ error(toString(File) + ": error creating DWARF context");
}
template <class ELFT> GdbIndexBuilder<ELFT>::~GdbIndexBuilder() {}
More information about the llvm-commits
mailing list