[PATCH] D20777: Unbreak gcc.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Sat May 28 16:20:34 PDT 2016
davide created this revision.
davide added a reviewer: ruiu.
davide added a subscriber: llvm-commits.
```
../tools/lld/ELF/InputSection.h: In constructor ‘lld::elf::SectionPiece::SectionPiece(size_t, llvm::ArrayRef<unsigned char>)’:
../tools/lld/ELF/InputSection.h:90:50: warning: cast from type ‘const unsigned char*’ to type ‘uint8_t* {aka unsigned char*}’ casts away qualifiers [-Wcast-qual]
: InputOff(Off), Data((uint8_t *)Data.data()), Size(Data.size()),
^
```
http://reviews.llvm.org/D20777
Files:
ELF/InputSection.h
Index: ELF/InputSection.h
===================================================================
--- ELF/InputSection.h
+++ ELF/InputSection.h
@@ -87,7 +87,7 @@
// SectionPiece represents a piece of splittable section contents.
struct SectionPiece {
SectionPiece(size_t Off, ArrayRef<uint8_t> Data)
- : InputOff(Off), Data((uint8_t *)Data.data()), Size(Data.size()),
+ : InputOff(Off), Data((const uint8_t *)Data.data()), Size(Data.size()),
Live(!Config->GcSections) {}
ArrayRef<uint8_t> data() { return {Data, Size}; }
@@ -100,7 +100,7 @@
// We use bitfields because SplitInputSection is accessed by
// std::upper_bound very often.
// We want to save bits to make it cache friendly.
- uint8_t *Data;
+ const uint8_t *Data;
uint32_t Size : 31;
public:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20777.58907.patch
Type: text/x-patch
Size: 795 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160528/d3e5bf94/attachment.bin>
More information about the llvm-commits
mailing list