diff options
author | Amir Ayupov <aaupov@fb.com> | 2023-01-18 14:21:28 -0800 |
---|---|---|
committer | Amir Ayupov <aaupov@fb.com> | 2023-01-18 14:53:07 -0800 |
commit | 69a9bbf106eb3832a4a02ec84f2522a4079f3dec (patch) | |
tree | 8ed364aba384aff5500c7a4b1abb6ebb8a7aac81 /bolt/include | |
parent | c5abe893120b115907376359a5809229a9f9608a (diff) | |
download | llvm-69a9bbf106eb3832a4a02ec84f2522a4079f3dec.tar.gz |
[BOLT][NFC] Replace ambiguous BinarySection::isReadOnly with isWritable
Address feedback in https://reviews.llvm.org/D102284#2755060
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D141733
Diffstat (limited to 'bolt/include')
-rw-r--r-- | bolt/include/bolt/Core/BinarySection.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/bolt/include/bolt/Core/BinarySection.h b/bolt/include/bolt/Core/BinarySection.h index 1160f719e0e0..20b4b5c92576 100644 --- a/bolt/include/bolt/Core/BinarySection.h +++ b/bolt/include/bolt/Core/BinarySection.h @@ -232,8 +232,8 @@ public: return isText() > Other.isText(); // Read-only before writable. - if (isReadOnly() != Other.isReadOnly()) - return isReadOnly() > Other.isReadOnly(); + if (isWritable() != Other.isWritable()) + return isWritable() < Other.isWritable(); // BSS at the end. if (isBSS() != Other.isBSS()) @@ -275,10 +275,7 @@ public: bool isTBSS() const { return isBSS() && isTLS(); } bool isVirtual() const { return ELFType == ELF::SHT_NOBITS; } bool isRela() const { return ELFType == ELF::SHT_RELA; } - bool isReadOnly() const { - return ((ELFFlags & ELF::SHF_ALLOC) && !(ELFFlags & ELF::SHF_WRITE) && - ELFType == ELF::SHT_PROGBITS); - } + bool isWritable() const { return (ELFFlags & ELF::SHF_WRITE); } bool isAllocatable() const { if (isELF()) { return (ELFFlags & ELF::SHF_ALLOC) && !isTBSS(); |