mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 18:11:19 +00:00
[ELF] Drop const qualifier to fix -Wrange-loop-analysis. NFC
``` lld/ELF/Relocations.cpp:1622:56: warning: loop variable 'ts' of type 'const std::pair<ThunkSection *, uint32_t>' (aka 'const pair<lld:🧝:ThunkSection *, unsigned int>') creates a copy from type 'const std::pair<ThunkSection *, uint32_t>' [-Wrange-loop-analysis] for (const std::pair<ThunkSection *, uint32_t> ts : isd->thunkSections) ``` Drop const qualifier to fix -Wrange-loop-analysis. We can make -Wrange-loop-analysis warnings (DiagnoseForRangeConstVariableCopies) on `const A` more permissive on more types (e.g. POD -> trivially copyable), unfortunately it will not make std::pair good, because `constexpr pair& operator=(const pair& p);` is unfortunately user-defined. Reviewed By: Mordante Differential Revision: https://reviews.llvm.org/D72211
This commit is contained in:
parent
d12f2a2998
commit
085898d469
@ -1619,7 +1619,7 @@ void ThunkCreator::mergeThunks(ArrayRef<OutputSection *> outputSections) {
|
||||
// those inserted in previous passes. Extract the Thunks created this
|
||||
// pass and order them in ascending outSecOff.
|
||||
std::vector<ThunkSection *> newThunks;
|
||||
for (const std::pair<ThunkSection *, uint32_t> ts : isd->thunkSections)
|
||||
for (std::pair<ThunkSection *, uint32_t> ts : isd->thunkSections)
|
||||
if (ts.second == pass)
|
||||
newThunks.push_back(ts.first);
|
||||
llvm::stable_sort(newThunks,
|
||||
|
Loading…
x
Reference in New Issue
Block a user