[lld] r196992 - [PECOFF] WriterPECOFF: Rename getCharacteristics -> computeCharacteristics.

Rui Ueyama ruiu at google.com
Tue Dec 10 17:17:11 PST 2013


Author: ruiu
Date: Tue Dec 10 19:17:11 2013
New Revision: 196992

URL: http://llvm.org/viewvc/llvm-project?rev=196992&view=rev
Log:
[PECOFF] WriterPECOFF: Rename getCharacteristics -> computeCharacteristics.

The base class has a member function with the same name. We should avoid it
being shadowed.

Modified:
    lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp

Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=196992&r1=196991&r2=196992&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Tue Dec 10 19:17:11 2013
@@ -267,10 +267,9 @@ public:
 protected:
   SectionChunk(StringRef sectionName, uint32_t characteristics);
 
+private:
   StringRef _sectionName;
   const uint32_t _characteristics;
-
-private:
   mutable llvm::BumpPtrAllocator _alloc;
 };
 
@@ -282,15 +281,15 @@ public:
 
   GenericSectionChunk(const PECOFFLinkingContext &ctx, StringRef name,
                       const std::vector<const DefinedAtom *> &atoms)
-      : SectionChunk(name, getCharacteristics(ctx, name, atoms)) {
+      : SectionChunk(name, computeCharacteristics(ctx, name, atoms)) {
     for (auto *a : atoms)
       appendAtom(a);
   }
 
 private:
   uint32_t
-  getCharacteristics(const PECOFFLinkingContext &ctx, StringRef name,
-                     const std::vector<const DefinedAtom *> &atoms) const {
+  computeCharacteristics(const PECOFFLinkingContext &ctx, StringRef name,
+                         const std::vector<const DefinedAtom *> &atoms) const {
     return ctx.getSectionAttributes(name, getDefaultCharacteristics(name, atoms));
   }
 
@@ -605,9 +604,9 @@ SectionChunk::SectionChunk(StringRef sec
 void GenericSectionChunk::write(uint8_t *buffer) {
   if (_atomLayouts.empty())
     return;
-  if (_characteristics & llvm::COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA)
+  if (getCharacteristics() & llvm::COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA)
     return;
-  if (_characteristics & llvm::COFF::IMAGE_SCN_CNT_CODE) {
+  if (getCharacteristics() & llvm::COFF::IMAGE_SCN_CNT_CODE) {
     // Fill the section with INT 3 (0xCC) rather than NUL, so that the
     // disassembler will not interpret a garbage between atoms as the beginning
     // of multi-byte machine code. This does not change the behavior of





More information about the llvm-commits mailing list