Move code so that the code matches with a comment. NFC.
llvm-svn: 328739
This commit is contained in:
parent
c8f774b393
commit
6a1ca2627a
|
@ -162,6 +162,9 @@ template <class ELFT> static uint32_t getHash(InputSection *S) {
|
||||||
|
|
||||||
// Returns true if section S is subject of ICF.
|
// Returns true if section S is subject of ICF.
|
||||||
static bool isEligible(InputSection *S) {
|
static bool isEligible(InputSection *S) {
|
||||||
|
if (!S->Live || !(S->Flags & SHF_ALLOC) || (S->Flags & SHF_WRITE))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Don't merge read only data sections unless
|
// Don't merge read only data sections unless
|
||||||
// --ignore-data-address-equality was passed.
|
// --ignore-data-address-equality was passed.
|
||||||
if (!(S->Flags & SHF_EXECINSTR) && !Config->IgnoreDataAddressEquality)
|
if (!(S->Flags & SHF_EXECINSTR) && !Config->IgnoreDataAddressEquality)
|
||||||
|
@ -173,11 +176,12 @@ static bool isEligible(InputSection *S) {
|
||||||
if (isa<SyntheticSection>(S))
|
if (isa<SyntheticSection>(S))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// .init and .fini contains instructions that must be executed to
|
// .init and .fini contains instructions that must be executed to initialize
|
||||||
// initialize and finalize the process. They cannot and should not
|
// and finalize the process. They cannot and should not be merged.
|
||||||
// be merged.
|
if (S->Name == ".init" || S->Name == ".fini")
|
||||||
return S->Live && (S->Flags & SHF_ALLOC) && !(S->Flags & SHF_WRITE) &&
|
return false;
|
||||||
S->Name != ".init" && S->Name != ".fini";
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Split an equivalence class into smaller classes.
|
// Split an equivalence class into smaller classes.
|
||||||
|
|
Loading…
Reference in New Issue