[lld] r234431 - Native: Simplify expressions. NFC.
Rui Ueyama
ruiu at google.com
Wed Apr 8 13:40:45 PDT 2015
Author: ruiu
Date: Wed Apr 8 15:40:45 2015
New Revision: 234431
URL: http://llvm.org/viewvc/llvm-project?rev=234431&view=rev
Log:
Native: Simplify expressions. NFC.
Modified:
lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
Modified: lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp?rev=234431&r1=234430&r2=234431&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp Wed Apr 8 15:40:45 2015
@@ -641,31 +641,28 @@ private:
this->_targetsTable = new const Atom*[chunk->elementCount];
for (uint32_t i=0; i < chunk->elementCount; ++i) {
const uint32_t index = targetIndexes[i];
- if ( index < _definedAtoms._elementCount ) {
+ if (index < _definedAtoms._elementCount) {
const uint8_t* p = _definedAtoms._arrayStart
+ index * _definedAtoms._elementSize;
this->_targetsTable[i] = reinterpret_cast<const DefinedAtom*>(p);
continue;
}
const uint32_t undefIndex = index - _definedAtoms._elementCount;
- if ( undefIndex < _undefinedAtoms._elementCount ) {
+ if (undefIndex < _undefinedAtoms._elementCount) {
const uint8_t* p = _undefinedAtoms._arrayStart
+ undefIndex * _undefinedAtoms._elementSize;
this->_targetsTable[i] = reinterpret_cast<const UndefinedAtom*>(p);
continue;
}
- const uint32_t slIndex = index - _definedAtoms._elementCount
- - _undefinedAtoms._elementCount;
- if ( slIndex < _sharedLibraryAtoms._elementCount ) {
+ const uint32_t slIndex = undefIndex - _undefinedAtoms._elementCount;
+ if (slIndex < _sharedLibraryAtoms._elementCount) {
const uint8_t* p = _sharedLibraryAtoms._arrayStart
+ slIndex * _sharedLibraryAtoms._elementSize;
this->_targetsTable[i] = reinterpret_cast<const SharedLibraryAtom*>(p);
continue;
}
- const uint32_t abIndex = index - _definedAtoms._elementCount
- - _undefinedAtoms._elementCount
- - _sharedLibraryAtoms._elementCount;
- if ( abIndex < _absoluteAtoms._elementCount ) {
+ const uint32_t abIndex = slIndex - _sharedLibraryAtoms._elementCount;
+ if (abIndex < _absoluteAtoms._elementCount) {
const uint8_t* p = _absoluteAtoms._arrayStart
+ abIndex * _absoluteAtoms._elementSize;
this->_targetsTable[i] = reinterpret_cast<const AbsoluteAtom*>(p);
More information about the llvm-commits
mailing list