diff options
author | Rui Ueyama <ruiu@google.com> | 2014-01-31 04:57:03 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2014-01-31 04:57:03 +0000 |
commit | 8851d45cbfefaa02e2d25e6fe7b9f9a6c698f6f0 (patch) | |
tree | d1f9fac8812f3f8e0879a3bb058413c757e41ae0 | |
parent | ea7e9306c15ff0ae702544d06339cc986eeee490 (diff) | |
download | bcm5719-llvm-8851d45cbfefaa02e2d25e6fe7b9f9a6c698f6f0.tar.gz bcm5719-llvm-8851d45cbfefaa02e2d25e6fe7b9f9a6c698f6f0.zip |
Replace magic numbers with enums.
llvm-svn: 200512
-rw-r--r-- | lld/include/lld/ReaderWriter/PECOFFLinkingContext.h | 6 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h b/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h index 7de6f6d6cba..fdc8c10c9a6 100644 --- a/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h +++ b/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h @@ -250,7 +250,11 @@ protected: virtual std::unique_ptr<File> createUndefinedSymbolFile() const; private: - enum { invalidBaseAddress = UINT64_MAX }; + enum { + invalidBaseAddress = UINT64_MAX, + pe32DefaultBaseAddress = 0x400000UL, + pe32PlusDefaultBaseAddress = 0x140000000UL + }; // The start address for the program. The default value for the executable is // 0x400000, but can be altered using /base command line option. diff --git a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp index 067fd5ccd24..c727ab8df58 100644 --- a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp +++ b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp @@ -203,7 +203,7 @@ StringRef PECOFFLinkingContext::undecorateSymbol(StringRef name) const { uint64_t PECOFFLinkingContext::getBaseAddress() const { if (_baseAddress == invalidBaseAddress) - return is64Bit() ? 0x140000000UL : 0x400000UL; + return is64Bit() ? pe32PlusDefaultBaseAddress : pe32DefaultBaseAddress; return _baseAddress; } |