[Mips] Do not use llvm::Optional for GP0 value and TLS section address

Use of llvm::Optional is redundant here. Initializing by default value 0
is enough.

No functional changes.

llvm-svn: 233549
This commit is contained in:
Simon Atanasyan 2015-03-30 15:07:11 +00:00
parent a341e38e39
commit 6dec97f2c3
1 changed files with 6 additions and 6 deletions

View File

@ -136,11 +136,11 @@ public:
}
/// \brief gp register value stored in the .reginfo section.
int64_t getGP0() const { return _gp0 ? *_gp0 : 0; }
int64_t getGP0() const { return _gp0; }
/// \brief .tdata section address plus fixed offset.
uint64_t getTPOffset() const { return *_tpOff; }
uint64_t getDTPOffset() const { return *_dtpOff; }
uint64_t getTPOffset() const { return _tpOff; }
uint64_t getDTPOffset() const { return _dtpOff; }
protected:
std::error_code doParse() override {
@ -163,9 +163,9 @@ private:
static const bool _isMips64EL =
ELFT::Is64Bits && ELFT::TargetEndianness == llvm::support::little;
llvm::Optional<int64_t> _gp0;
llvm::Optional<uint64_t> _tpOff;
llvm::Optional<uint64_t> _dtpOff;
int64_t _gp0 = 0;
uint64_t _tpOff = 0;
uint64_t _dtpOff = 0;
ErrorOr<ELFDefinedAtom<ELFT> *> handleDefinedSymbol(
StringRef symName, StringRef sectionName, const Elf_Sym *sym,