[lld] r365605 - Make functions and member variables distinguishable even after the name style change. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 02:10:01 PDT 2019


Author: ruiu
Date: Wed Jul 10 02:10:01 2019
New Revision: 365605

URL: http://llvm.org/viewvc/llvm-project?rev=365605&view=rev
Log:
Make functions and member variables distinguishable even after the name style change. NFC.

Modified:
    lld/trunk/COFF/Chunks.cpp
    lld/trunk/COFF/Chunks.h
    lld/trunk/COFF/Driver.cpp
    lld/trunk/COFF/InputFiles.cpp
    lld/trunk/COFF/SymbolTable.cpp
    lld/trunk/COFF/Symbols.h
    lld/trunk/COFF/Writer.cpp
    lld/trunk/wasm/InputChunks.h
    lld/trunk/wasm/OutputSections.cpp
    lld/trunk/wasm/OutputSections.h
    lld/trunk/wasm/SymbolTable.cpp
    lld/trunk/wasm/SyntheticSections.cpp
    lld/trunk/wasm/SyntheticSections.h
    lld/trunk/wasm/Writer.cpp

Modified: lld/trunk/COFF/Chunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Chunks.cpp?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/COFF/Chunks.cpp (original)
+++ lld/trunk/COFF/Chunks.cpp Wed Jul 10 02:10:01 2019
@@ -348,7 +348,7 @@ static void maybeReportRelocationToDisca
 }
 
 void SectionChunk::writeTo(uint8_t *Buf) const {
-  if (!hasData())
+  if (!HasData)
     return;
   // Copy section contents from source object file to output file.
   ArrayRef<uint8_t> A = getContents();

Modified: lld/trunk/COFF/Chunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Chunks.h?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/COFF/Chunks.h (original)
+++ lld/trunk/COFF/Chunks.h Wed Jul 10 02:10:01 2019
@@ -90,11 +90,6 @@ public:
     assert(RVA == V && "RVA truncated");
   }
 
-  // Returns true if this has non-zero data. BSS chunks return
-  // false. If false is returned, the space occupied by this chunk
-  // will be filled with zeros.
-  bool hasData() const { return HasData; }
-
   // Returns readable/writable/executable bits.
   uint32_t getOutputCharacteristics() const;
 
@@ -126,10 +121,14 @@ protected:
 
   const Kind ChunkKind;
 
-  // True if the section has data. Corresponds to the
+public:
+  // Returns true if this has non-zero data. BSS chunks return
+  // false. If false is returned, the space occupied by this chunk
+  // will be filled with zeros. Corresponds to the
   // IMAGE_SCN_CNT_UNINITIALIZED_DATA section characteristic bit.
   uint8_t HasData : 1;
 
+public:
   // The alignment of this chunk, stored in log2 form. The writer uses the
   // value.
   uint8_t P2Align : 7;

Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Wed Jul 10 02:10:01 2019
@@ -210,7 +210,7 @@ void LinkerDriver::enqueuePath(StringRef
   enqueueTask([=]() {
     auto MBOrErr = Future->get();
     if (MBOrErr.second) {
-      std::string Error =
+      std::string Msg =
           "could not open '" + PathStr + "': " + MBOrErr.second.message();
       // Check if the filename is a typo for an option flag. OptTable thinks
       // that all args that are not known options and that start with / are
@@ -219,9 +219,9 @@ void LinkerDriver::enqueuePath(StringRef
       // directory.
       std::string Nearest;
       if (COFFOptTable().findNearest(PathStr, Nearest) > 1)
-        error(Error);
+        error(Msg);
       else
-        error(Error + "; did you mean '" + Nearest + "'");
+        error(Msg + "; did you mean '" + Nearest + "'");
     } else
       Driver->addBuffer(std::move(MBOrErr.first), WholeArchive);
   });

Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Wed Jul 10 02:10:01 2019
@@ -582,7 +582,7 @@ Optional<Symbol *> ObjFile::createDefine
     }
     COMDATType Selection = (COMDATType)Def->Selection;
 
-    if (Leader->isCOMDAT())
+    if (Leader->IsCOMDAT)
       handleComdatSelection(Sym, Selection, Prevailing, Leader);
 
     if (Prevailing) {

Modified: lld/trunk/COFF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/SymbolTable.cpp?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/COFF/SymbolTable.cpp (original)
+++ lld/trunk/COFF/SymbolTable.cpp Wed Jul 10 02:10:01 2019
@@ -458,7 +458,7 @@ SymbolTable::addComdat(InputFile *F, Str
     return {cast<DefinedRegular>(S), true};
   }
   auto *ExistingSymbol = cast<DefinedRegular>(S);
-  if (!ExistingSymbol->isCOMDAT())
+  if (!ExistingSymbol->IsCOMDAT)
     reportDuplicate(S, F);
   return {ExistingSymbol, false};
 }

Modified: lld/trunk/COFF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Symbols.h?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/COFF/Symbols.h (original)
+++ lld/trunk/COFF/Symbols.h Wed Jul 10 02:10:01 2019
@@ -59,9 +59,6 @@ public:
 
   Kind kind() const { return static_cast<Kind>(SymbolKind); }
 
-  // Returns true if this is an external symbol.
-  bool isExternal() { return IsExternal; }
-
   // Returns the symbol name.
   StringRef getName();
 
@@ -85,10 +82,10 @@ protected:
   const unsigned SymbolKind : 8;
   unsigned IsExternal : 1;
 
+public:
   // This bit is used by the \c DefinedRegular subclass.
   unsigned IsCOMDAT : 1;
 
-public:
   // This bit is used by Writer::createSymbolAndStringTable() to prevent
   // symbols from being written to the symbol table more than once.
   unsigned WrittenToSymtab : 1;
@@ -172,7 +169,6 @@ public:
   }
 
   uint64_t getRVA() const { return (*Data)->getRVA() + Sym->Value; }
-  bool isCOMDAT() const { return IsCOMDAT; }
   SectionChunk *getChunk() const { return *Data; }
   uint32_t getValue() const { return Sym->Value; }
 

Modified: lld/trunk/COFF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Writer.cpp?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/COFF/Writer.cpp (original)
+++ lld/trunk/COFF/Writer.cpp Wed Jul 10 02:10:01 2019
@@ -1202,7 +1202,7 @@ void Writer::assignAddresses() {
       VirtualSize = alignTo(VirtualSize, C->getAlignment());
       C->setRVA(RVA + VirtualSize);
       VirtualSize += C->getSize();
-      if (C->hasData())
+      if (C->HasData)
         RawSize = alignTo(VirtualSize, Config->FileAlign);
     }
     if (VirtualSize > UINT32_MAX)
@@ -1377,7 +1377,7 @@ template <typename PEHeaderTy> void Writ
       SectionChunk *SC = B->getChunk();
       assert(B->getRVA() >= SC->getRVA());
       uint64_t OffsetInChunk = B->getRVA() - SC->getRVA();
-      if (!SC->hasData() || OffsetInChunk + 4 > SC->getSize())
+      if (!SC->HasData || OffsetInChunk + 4 > SC->getSize())
         fatal("_load_config_used is malformed");
 
       ArrayRef<uint8_t> SecContents = SC->getContents();

Modified: lld/trunk/wasm/InputChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/InputChunks.h?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/wasm/InputChunks.h (original)
+++ lld/trunk/wasm/InputChunks.h Wed Jul 10 02:10:01 2019
@@ -53,7 +53,7 @@ public:
   StringRef getComdatName() const;
   virtual uint32_t getInputSectionOffset() const = 0;
 
-  size_t NumRelocations() const { return Relocations.size(); }
+  size_t getNumRelocations() const { return Relocations.size(); }
   void writeRelocations(llvm::raw_ostream &OS) const;
 
   ObjFile *File;

Modified: lld/trunk/wasm/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/OutputSections.cpp?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/wasm/OutputSections.cpp (original)
+++ lld/trunk/wasm/OutputSections.cpp Wed Jul 10 02:10:01 2019
@@ -113,10 +113,10 @@ void CodeSection::writeTo(uint8_t *Buf)
     Chunk->writeTo(Buf);
 }
 
-uint32_t CodeSection::numRelocations() const {
+uint32_t CodeSection::getNumRelocations() const {
   uint32_t Count = 0;
   for (const InputChunk *Func : Functions)
-    Count += Func->NumRelocations();
+    Count += Func->getNumRelocations();
   return Count;
 }
 
@@ -190,11 +190,11 @@ void DataSection::writeTo(uint8_t *Buf)
   }
 }
 
-uint32_t DataSection::numRelocations() const {
+uint32_t DataSection::getNumRelocations() const {
   uint32_t Count = 0;
   for (const OutputSegment *Seg : Segments)
     for (const InputChunk *InputSeg : Seg->InputSegments)
-      Count += InputSeg->NumRelocations();
+      Count += InputSeg->getNumRelocations();
   return Count;
 }
 
@@ -237,10 +237,10 @@ void CustomSection::writeTo(uint8_t *Buf
     Section->writeTo(Buf);
 }
 
-uint32_t CustomSection::numRelocations() const {
+uint32_t CustomSection::getNumRelocations() const {
   uint32_t Count = 0;
   for (const InputSection *InputSect : InputSections)
-    Count += InputSect->NumRelocations();
+    Count += InputSect->getNumRelocations();
   return Count;
 }
 

Modified: lld/trunk/wasm/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/OutputSections.h?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/wasm/OutputSections.h (original)
+++ lld/trunk/wasm/OutputSections.h Wed Jul 10 02:10:01 2019
@@ -42,7 +42,7 @@ public:
   virtual size_t getSize() const = 0;
   virtual void writeTo(uint8_t *Buf) = 0;
   virtual void finalizeContents() = 0;
-  virtual uint32_t numRelocations() const { return 0; }
+  virtual uint32_t getNumRelocations() const { return 0; }
   virtual void writeRelocations(raw_ostream &OS) const {}
 
   std::string Header;
@@ -62,7 +62,7 @@ public:
 
   size_t getSize() const override { return Header.size() + BodySize; }
   void writeTo(uint8_t *Buf) override;
-  uint32_t numRelocations() const override;
+  uint32_t getNumRelocations() const override;
   void writeRelocations(raw_ostream &OS) const override;
   bool isNeeded() const override { return Functions.size() > 0; }
   void finalizeContents() override;
@@ -80,7 +80,7 @@ public:
 
   size_t getSize() const override { return Header.size() + BodySize; }
   void writeTo(uint8_t *Buf) override;
-  uint32_t numRelocations() const override;
+  uint32_t getNumRelocations() const override;
   void writeRelocations(raw_ostream &OS) const override;
   bool isNeeded() const override { return Segments.size() > 0; }
   void finalizeContents() override;
@@ -107,7 +107,7 @@ public:
     return Header.size() + NameData.size() + PayloadSize;
   }
   void writeTo(uint8_t *Buf) override;
-  uint32_t numRelocations() const override;
+  uint32_t getNumRelocations() const override;
   void writeRelocations(raw_ostream &OS) const override;
   void finalizeContents() override;
 

Modified: lld/trunk/wasm/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/SymbolTable.cpp?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/wasm/SymbolTable.cpp (original)
+++ lld/trunk/wasm/SymbolTable.cpp Wed Jul 10 02:10:01 2019
@@ -274,7 +274,7 @@ Symbol *SymbolTable::addDefinedFunction(
   bool WasInserted;
   std::tie(S, WasInserted) = insert(Name, File);
 
-  auto Replace = [&](Symbol* Sym) {
+  auto ReplaceSym = [&](Symbol *Sym) {
     // If the new defined function doesn't have signture (i.e. bitcode
     // functions) but the old symbol does, then preserve the old signature
     const WasmSignature *OldSig = S->getSignature();
@@ -284,7 +284,7 @@ Symbol *SymbolTable::addDefinedFunction(
   };
 
   if (WasInserted || S->isLazy()) {
-    Replace(S);
+    ReplaceSym(S);
     return S;
   }
 
@@ -302,10 +302,10 @@ Symbol *SymbolTable::addDefinedFunction(
     Symbol* Variant;
     if (getFunctionVariant(S, &Function->Signature, File, &Variant))
       // New variant, always replace
-      Replace(Variant);
+      ReplaceSym(Variant);
     else if (shouldReplace(S, File, Flags))
       // Variant already exists, replace it after checking shouldReplace
-      Replace(Variant);
+      ReplaceSym(Variant);
 
     // This variant we found take the place in the symbol table as the primary
     // variant.
@@ -315,7 +315,7 @@ Symbol *SymbolTable::addDefinedFunction(
 
   // Existing function with matching signature.
   if (shouldReplace(S, File, Flags))
-    Replace(S);
+    ReplaceSym(S);
 
   return S;
 }
@@ -329,19 +329,19 @@ Symbol *SymbolTable::addDefinedData(Stri
   bool WasInserted;
   std::tie(S, WasInserted) = insert(Name, File);
 
-  auto Replace = [&]() {
+  auto ReplaceSym = [&]() {
     replaceSymbol<DefinedData>(S, Name, Flags, File, Segment, Address, Size);
   };
 
   if (WasInserted || S->isLazy()) {
-    Replace();
+    ReplaceSym();
     return S;
   }
 
   checkDataType(S, File);
 
   if (shouldReplace(S, File, Flags))
-    Replace();
+    ReplaceSym();
   return S;
 }
 
@@ -353,19 +353,19 @@ Symbol *SymbolTable::addDefinedGlobal(St
   bool WasInserted;
   std::tie(S, WasInserted) = insert(Name, File);
 
-  auto Replace = [&]() {
+  auto ReplaceSym = [&]() {
     replaceSymbol<DefinedGlobal>(S, Name, Flags, File, Global);
   };
 
   if (WasInserted || S->isLazy()) {
-    Replace();
+    ReplaceSym();
     return S;
   }
 
   checkGlobalType(S, File, &Global->getType());
 
   if (shouldReplace(S, File, Flags))
-    Replace();
+    ReplaceSym();
   return S;
 }
 
@@ -377,19 +377,19 @@ Symbol *SymbolTable::addDefinedEvent(Str
   bool WasInserted;
   std::tie(S, WasInserted) = insert(Name, File);
 
-  auto Replace = [&]() {
+  auto ReplaceSym = [&]() {
     replaceSymbol<DefinedEvent>(S, Name, Flags, File, Event);
   };
 
   if (WasInserted || S->isLazy()) {
-    Replace();
+    ReplaceSym();
     return S;
   }
 
   checkEventType(S, File, &Event->getType(), &Event->Signature);
 
   if (shouldReplace(S, File, Flags))
-    Replace();
+    ReplaceSym();
   return S;
 }
 
@@ -408,13 +408,13 @@ Symbol *SymbolTable::addUndefinedFunctio
   if (S->Traced)
     printTraceSymbolUndefined(Name, File);
 
-  auto Replace = [&]() {
+  auto ReplaceSym = [&]() {
     replaceSymbol<UndefinedFunction>(S, Name, ImportName, ImportModule, Flags,
                                      File, Sig, IsCalledDirectly);
   };
 
   if (WasInserted)
-    Replace();
+    ReplaceSym();
   else if (auto *Lazy = dyn_cast<LazySymbol>(S))
     Lazy->fetch();
   else {
@@ -427,7 +427,7 @@ Symbol *SymbolTable::addUndefinedFunctio
       ExistingFunction->Signature = Sig;
     if (IsCalledDirectly && !signatureMatches(ExistingFunction, Sig))
       if (getFunctionVariant(S, Sig, File, &S))
-        Replace();
+        ReplaceSym();
   }
 
   return S;
@@ -623,13 +623,13 @@ void SymbolTable::handleWeakUndefines()
 
 static void reportFunctionSignatureMismatch(StringRef SymName,
                                             FunctionSymbol *A,
-                                            FunctionSymbol *B, bool Error) {
+                                            FunctionSymbol *B, bool IsError) {
   std::string msg = ("function signature mismatch: " + SymName +
                      "\n>>> defined as " + toString(*A->Signature) + " in " +
                      toString(A->getFile()) + "\n>>> defined as " +
                      toString(*B->Signature) + " in " + toString(B->getFile()))
                         .str();
-  if (Error)
+  if (IsError)
     error(msg);
   else
     warn(msg);

Modified: lld/trunk/wasm/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/SyntheticSections.cpp?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/wasm/SyntheticSections.cpp (original)
+++ lld/trunk/wasm/SyntheticSections.cpp Wed Jul 10 02:10:01 2019
@@ -91,7 +91,7 @@ void TypeSection::writeBody() {
     writeSig(BodyOutputStream, *Sig);
 }
 
-uint32_t ImportSection::numImports() const {
+uint32_t ImportSection::getNumImports() const {
   assert(IsSealed);
   uint32_t NumImports = ImportedSymbols.size() + GOTSymbols.size();
   if (Config->ImportMemory)
@@ -123,7 +123,7 @@ void ImportSection::addImport(Symbol *Sy
 void ImportSection::writeBody() {
   raw_ostream &OS = BodyOutputStream;
 
-  writeUleb128(OS, numImports(), "import count");
+  writeUleb128(OS, getNumImports(), "import count");
 
   if (Config->ImportMemory) {
     WasmImport Import;
@@ -205,7 +205,7 @@ void FunctionSection::addFunction(InputF
   if (!Func->Live)
     return;
   uint32_t FunctionIndex =
-      Out.ImportSec->numImportedFunctions() + InputFunctions.size();
+      Out.ImportSec->getNumImportedFunctions() + InputFunctions.size();
   InputFunctions.emplace_back(Func);
   Func->setFunctionIndex(FunctionIndex);
 }
@@ -254,7 +254,7 @@ void GlobalSection::addGlobal(InputGloba
   if (!Global->Live)
     return;
   uint32_t GlobalIndex =
-      Out.ImportSec->numImportedGlobals() + InputGlobals.size();
+      Out.ImportSec->getNumImportedGlobals() + InputGlobals.size();
   LLVM_DEBUG(dbgs() << "addGlobal: " << GlobalIndex << "\n");
   Global->setGlobalIndex(GlobalIndex);
   Out.GlobalSec->InputGlobals.push_back(Global);
@@ -273,7 +273,8 @@ void EventSection::writeBody() {
 void EventSection::addEvent(InputEvent *Event) {
   if (!Event->Live)
     return;
-  uint32_t EventIndex = Out.ImportSec->numImportedEvents() + InputEvents.size();
+  uint32_t EventIndex =
+      Out.ImportSec->getNumImportedEvents() + InputEvents.size();
   LLVM_DEBUG(dbgs() << "addEvent: " << EventIndex << "\n");
   Event->setEventIndex(EventIndex);
   InputEvents.push_back(Event);
@@ -460,7 +461,7 @@ void LinkingSection::addToSymtab(Symbol
 }
 
 unsigned NameSection::numNames() const {
-  unsigned NumNames = Out.ImportSec->numImportedFunctions();
+  unsigned NumNames = Out.ImportSec->getNumImportedFunctions();
   for (const InputFunction *F : Out.FunctionSec->InputFunctions)
     if (!F->getName().empty() || !F->getDebugName().empty())
       ++NumNames;
@@ -538,7 +539,7 @@ void TargetFeaturesSection::writeBody()
 }
 
 void RelocSection::writeBody() {
-  uint32_t Count = Sec->numRelocations();
+  uint32_t Count = Sec->getNumRelocations();
   assert(Sec->SectionIndex != UINT32_MAX);
   writeUleb128(BodyOutputStream, Sec->SectionIndex, "reloc section");
   writeUleb128(BodyOutputStream, Count, "reloc count");

Modified: lld/trunk/wasm/SyntheticSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/SyntheticSections.h?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/wasm/SyntheticSections.h (original)
+++ lld/trunk/wasm/SyntheticSections.h Wed Jul 10 02:10:01 2019
@@ -97,21 +97,21 @@ protected:
 class ImportSection : public SyntheticSection {
 public:
   ImportSection() : SyntheticSection(llvm::wasm::WASM_SEC_IMPORT) {}
-  bool isNeeded() const override { return numImports() > 0; }
+  bool isNeeded() const override { return getNumImports() > 0; }
   void writeBody() override;
   void addImport(Symbol *Sym);
   void addGOTEntry(Symbol *Sym);
   void seal() { IsSealed = true; }
-  uint32_t numImports() const;
-  uint32_t numImportedGlobals() const {
+  uint32_t getNumImports() const;
+  uint32_t getNumImportedGlobals() const {
     assert(IsSealed);
     return NumImportedGlobals;
   }
-  uint32_t numImportedFunctions() const {
+  uint32_t getNumImportedFunctions() const {
     assert(IsSealed);
     return NumImportedFunctions;
   }
-  uint32_t numImportedEvents() const {
+  uint32_t getNumImportedEvents() const {
     assert(IsSealed);
     return NumImportedEvents;
   }
@@ -306,7 +306,7 @@ public:
   RelocSection(StringRef Name, OutputSection *Sec)
       : SyntheticSection(llvm::wasm::WASM_SEC_CUSTOM, Name), Sec(Sec) {}
   void writeBody() override;
-  bool isNeeded() const override { return Sec->numRelocations() > 0; };
+  bool isNeeded() const override { return Sec->getNumRelocations() > 0; };
 
 protected:
   OutputSection *Sec;

Modified: lld/trunk/wasm/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Writer.cpp?rev=365605&r1=365604&r2=365605&view=diff
==============================================================================
--- lld/trunk/wasm/Writer.cpp (original)
+++ lld/trunk/wasm/Writer.cpp Wed Jul 10 02:10:01 2019
@@ -149,7 +149,7 @@ void Writer::createRelocSections() {
     OutputSection *Sec = OutputSections[I];
 
     // Count the number of needed sections.
-    uint32_t Count = Sec->numRelocations();
+    uint32_t Count = Sec->getNumRelocations();
     if (!Count)
       continue;
 
@@ -474,8 +474,8 @@ void Writer::calculateExports() {
     Out.ExportSec->Exports.push_back(
         WasmExport{FunctionTableName, WASM_EXTERNAL_TABLE, 0});
 
-  unsigned FakeGlobalIndex =
-      Out.ImportSec->numImportedGlobals() + Out.GlobalSec->InputGlobals.size();
+  unsigned FakeGlobalIndex = Out.ImportSec->getNumImportedGlobals() +
+                             Out.GlobalSec->InputGlobals.size();
 
   for (Symbol *Sym : Symtab->getSymbols()) {
     if (!Sym->isExported())
@@ -635,7 +635,7 @@ void Writer::createOutputSegments() {
   }
 }
 
-static void CreateFunction(DefinedFunction *Func, StringRef BodyContent) {
+static void createFunction(DefinedFunction *Func, StringRef BodyContent) {
   std::string FunctionBody;
   {
     raw_string_ostream OS(FunctionBody);
@@ -679,7 +679,7 @@ void Writer::createInitMemoryFunction()
     writeU8(OS, WASM_OPCODE_END, "END");
   }
 
-  CreateFunction(WasmSym::InitMemory, BodyContent);
+  createFunction(WasmSym::InitMemory, BodyContent);
 }
 
 // For -shared (PIC) output, we create create a synthetic function which will
@@ -699,7 +699,7 @@ void Writer::createApplyRelocationsFunct
     writeU8(OS, WASM_OPCODE_END, "END");
   }
 
-  CreateFunction(WasmSym::ApplyRelocs, BodyContent);
+  createFunction(WasmSym::ApplyRelocs, BodyContent);
 }
 
 // Create synthetic "__wasm_call_ctors" function based on ctor functions
@@ -734,7 +734,7 @@ void Writer::createCallCtorsFunction() {
     writeU8(OS, WASM_OPCODE_END, "END");
   }
 
-  CreateFunction(WasmSym::CallCtors, BodyContent);
+  createFunction(WasmSym::CallCtors, BodyContent);
 }
 
 // Populate InitFunctions vector with init functions from all input objects.
@@ -844,9 +844,10 @@ void Writer::run() {
     log("Defined Functions: " + Twine(Out.FunctionSec->InputFunctions.size()));
     log("Defined Globals  : " + Twine(Out.GlobalSec->InputGlobals.size()));
     log("Defined Events   : " + Twine(Out.EventSec->InputEvents.size()));
-    log("Function Imports : " + Twine(Out.ImportSec->numImportedFunctions()));
-    log("Global Imports   : " + Twine(Out.ImportSec->numImportedGlobals()));
-    log("Event Imports    : " + Twine(Out.ImportSec->numImportedEvents()));
+    log("Function Imports : " +
+        Twine(Out.ImportSec->getNumImportedFunctions()));
+    log("Global Imports   : " + Twine(Out.ImportSec->getNumImportedGlobals()));
+    log("Event Imports    : " + Twine(Out.ImportSec->getNumImportedEvents()));
     for (ObjFile *File : Symtab->ObjectFiles)
       File->dumpInfo();
   }




More information about the llvm-commits mailing list