[lld] r289084 - Move Memory.{h, cpp} to lld/Support so that we can use them from COFF.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 23:06:17 PST 2016


On Thu, Dec 8, 2016 at 10:00 PM, Rui Ueyama <ruiu at google.com> wrote:

> LLD ELF can be used as a library, but it is as a whole a single monolithic
> linker. So is COFF linker. I put this file and make it a "library" to share
> code between ports, but no one except the two will use it.
>

Code in the typical include,lib LLVM arrangement is expected to have
certain library-like guarantees. It is really confusing to all LLVM
developers to have this kind of mutable globals in there.



> I'm fine to retract this and instead copy-n-paste this code for now, but
> we need to fix the directory and library structure to match the reality. It
> is silly if we cannot code between COFF and ELF.
>

While I agree that we want to be able to share *code* between COFF and ELF,
I really really don't like for them to share mutable global state through a
"library". Like I said, the entire justification for using globals was that
LLD was a "program" and not a "library". If we want to share the code we
need to do it in a way that clearly marks it as "not a library" (perhaps
through directory naming and organization choices).

I think that rearranging the directory structure or something might be able
to help, but overall we need more discussion among the LLD developers
before resorting to sharing mutable globals between COFF and ELF.. Putting
random mutable state in shared code is a recipe for disaster. We need to be
careful.


At least for the moment, full copy-paste should not be necessary. All that
should be needed is a special `make` function that passes a
pointer/reference to a program-specific global to the constructor of the
static object.
I.e. ELF would have something like:
```
template <typename T, typename... U> inline T *make(U &&... Args) {
  static SpecificAlloc<T> Alloc(elf::AllocatorInstances);
  return new (Alloc.Alloc.Allocate()) T(std::forward<U>(Args)...);
}
```

And then e.g. the call to freeArena would be:
`freeArena(elf::AllocatorInstances)`.
(also freeArena is a poor name for this function; it does not free an
arena; it iterates over a list of arena allocators freeing them
individually; maybe freeArenaAllocators?)

-- Sean Silva


>
> On Thu, Dec 8, 2016 at 9:48 PM, Sean Silva <chisophugis at gmail.com> wrote:
>
>> Please revert this for now. The use of globals in LLD has been acceptable
>> on the premise that these variables are in the "LLD is a program, not a
>> library" part of LLD. Putting globals in a library is another matter and
>> should not be done lightly.
>>
>> -- Sean Silva
>>
>> On Thu, Dec 8, 2016 at 10:31 AM, Rui Ueyama via llvm-commits <
>> llvm-commits at lists.llvm.org> wrote:
>>
>>> Author: ruiu
>>> Date: Thu Dec  8 12:31:13 2016
>>> New Revision: 289084
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=289084&view=rev
>>> Log:
>>> Move Memory.{h,cpp} to lld/Support so that we can use them from COFF.
>>>
>>> Added:
>>>     lld/trunk/include/lld/Support/
>>>     lld/trunk/include/lld/Support/Memory.h
>>>       - copied, changed from r289082, lld/trunk/ELF/Memory.h
>>>     lld/trunk/lib/Support/
>>>     lld/trunk/lib/Support/CMakeLists.txt
>>>     lld/trunk/lib/Support/Memory.cpp
>>>       - copied, changed from r289082, lld/trunk/ELF/Memory.cpp
>>> Removed:
>>>     lld/trunk/ELF/Memory.cpp
>>>     lld/trunk/ELF/Memory.h
>>> Modified:
>>>     lld/trunk/ELF/CMakeLists.txt
>>>     lld/trunk/ELF/Driver.cpp
>>>     lld/trunk/ELF/DriverUtils.cpp
>>>     lld/trunk/ELF/InputFiles.cpp
>>>     lld/trunk/ELF/InputSection.cpp
>>>     lld/trunk/ELF/LinkerScript.cpp
>>>     lld/trunk/ELF/OutputSections.cpp
>>>     lld/trunk/ELF/SymbolTable.cpp
>>>     lld/trunk/ELF/SyntheticSections.cpp
>>>     lld/trunk/ELF/Target.cpp
>>>     lld/trunk/ELF/Thunks.cpp
>>>     lld/trunk/ELF/Writer.cpp
>>>     lld/trunk/lib/CMakeLists.txt
>>>
>>> Modified: lld/trunk/ELF/CMakeLists.txt
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/CMakeLists
>>> .txt?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/CMakeLists.txt (original)
>>> +++ lld/trunk/ELF/CMakeLists.txt Thu Dec  8 12:31:13 2016
>>> @@ -14,7 +14,6 @@ add_lld_library(lldELF
>>>    LTO.cpp
>>>    LinkerScript.cpp
>>>    MarkLive.cpp
>>> -  Memory.cpp
>>>    Mips.cpp
>>>    OutputSections.cpp
>>>    Relocations.cpp
>>> @@ -50,6 +49,7 @@ add_lld_library(lldELF
>>>    LINK_LIBS
>>>    lldConfig
>>>    lldCore
>>> +  lldSupport
>>>    ${PTHREAD_LIB}
>>>
>>>    DEPENDS
>>>
>>> Modified: lld/trunk/ELF/Driver.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp
>>> ?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/Driver.cpp (original)
>>> +++ lld/trunk/ELF/Driver.cpp Thu Dec  8 12:31:13 2016
>>> @@ -14,7 +14,6 @@
>>>  #include "InputFiles.h"
>>>  #include "InputSection.h"
>>>  #include "LinkerScript.h"
>>> -#include "Memory.h"
>>>  #include "Strings.h"
>>>  #include "SymbolTable.h"
>>>  #include "Target.h"
>>> @@ -22,6 +21,7 @@
>>>  #include "Writer.h"
>>>  #include "lld/Config/Version.h"
>>>  #include "lld/Driver/Driver.h"
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/ADT/StringExtras.h"
>>>  #include "llvm/ADT/StringSwitch.h"
>>>  #include "llvm/Support/CommandLine.h"
>>>
>>> Modified: lld/trunk/ELF/DriverUtils.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/DriverUtil
>>> s.cpp?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/DriverUtils.cpp (original)
>>> +++ lld/trunk/ELF/DriverUtils.cpp Thu Dec  8 12:31:13 2016
>>> @@ -15,10 +15,10 @@
>>>
>>>  #include "Driver.h"
>>>  #include "Error.h"
>>> -#include "Memory.h"
>>>  #include "ScriptParser.h"
>>>  #include "lld/Config/Version.h"
>>>  #include "lld/Core/Reproduce.h"
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/ADT/Optional.h"
>>>  #include "llvm/ADT/STLExtras.h"
>>>  #include "llvm/ADT/Triple.h"
>>>
>>> Modified: lld/trunk/ELF/InputFiles.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles
>>> .cpp?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/InputFiles.cpp (original)
>>> +++ lld/trunk/ELF/InputFiles.cpp Thu Dec  8 12:31:13 2016
>>> @@ -12,9 +12,9 @@
>>>  #include "Error.h"
>>>  #include "InputSection.h"
>>>  #include "LinkerScript.h"
>>> -#include "Memory.h"
>>>  #include "SymbolTable.h"
>>>  #include "Symbols.h"
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/ADT/STLExtras.h"
>>>  #include "llvm/Bitcode/BitcodeReader.h"
>>>  #include "llvm/CodeGen/Analysis.h"
>>>
>>> Modified: lld/trunk/ELF/InputSection.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSecti
>>> on.cpp?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/InputSection.cpp (original)
>>> +++ lld/trunk/ELF/InputSection.cpp Thu Dec  8 12:31:13 2016
>>> @@ -13,13 +13,12 @@
>>>  #include "Error.h"
>>>  #include "InputFiles.h"
>>>  #include "LinkerScript.h"
>>> -#include "Memory.h"
>>>  #include "OutputSections.h"
>>>  #include "Relocations.h"
>>>  #include "SyntheticSections.h"
>>>  #include "Target.h"
>>>  #include "Thunks.h"
>>> -
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/Support/Compression.h"
>>>  #include "llvm/Support/Endian.h"
>>>  #include <mutex>
>>>
>>> Modified: lld/trunk/ELF/LinkerScript.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScri
>>> pt.cpp?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/LinkerScript.cpp (original)
>>> +++ lld/trunk/ELF/LinkerScript.cpp Thu Dec  8 12:31:13 2016
>>> @@ -15,7 +15,6 @@
>>>  #include "Config.h"
>>>  #include "Driver.h"
>>>  #include "InputSection.h"
>>> -#include "Memory.h"
>>>  #include "OutputSections.h"
>>>  #include "ScriptParser.h"
>>>  #include "Strings.h"
>>> @@ -24,6 +23,7 @@
>>>  #include "SyntheticSections.h"
>>>  #include "Target.h"
>>>  #include "Writer.h"
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/ADT/STLExtras.h"
>>>  #include "llvm/ADT/SmallString.h"
>>>  #include "llvm/ADT/StringRef.h"
>>>
>>> Removed: lld/trunk/ELF/Memory.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Memory.cpp
>>> ?rev=289083&view=auto
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/Memory.cpp (original)
>>> +++ lld/trunk/ELF/Memory.cpp (removed)
>>> @@ -1,29 +0,0 @@
>>> -//===- Memory.cpp -----------------------------------------------*-
>>> C++ -*-===//
>>> -//
>>> -//                             The LLVM Linker
>>> -//
>>> -// This file is distributed under the University of Illinois Open Source
>>> -// License. See LICENSE.TXT for details.
>>> -//
>>> -//===------------------------------------------------------
>>> ----------------===//
>>> -
>>> -#include "Memory.h"
>>> -
>>> -using namespace llvm;
>>> -using namespace lld;
>>> -using namespace lld::elf;
>>> -
>>> -namespace lld {
>>> -BumpPtrAllocator elf::BAlloc;
>>> -StringSaver elf::Saver{elf::BAlloc};
>>> -
>>> -SpecificAllocBase::SpecificAllocBase() { Instances.push_back(this); }
>>> -
>>> -std::vector<SpecificAllocBase *> SpecificAllocBase::Instances;
>>> -
>>> -void elf::freeArena() {
>>> -  for (SpecificAllocBase *Alloc : SpecificAllocBase::Instances)
>>> -    Alloc->reset();
>>> -  BAlloc.Reset();
>>> -}
>>> -}
>>>
>>> Removed: lld/trunk/ELF/Memory.h
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Memory.h?r
>>> ev=289083&view=auto
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/Memory.h (original)
>>> +++ lld/trunk/ELF/Memory.h (removed)
>>> @@ -1,61 +0,0 @@
>>> -//===- Memory.h -------------------------------------------------*-
>>> C++ -*-===//
>>> -//
>>> -//                             The LLVM Linker
>>> -//
>>> -// This file is distributed under the University of Illinois Open Source
>>> -// License. See LICENSE.TXT for details.
>>> -//
>>> -//===------------------------------------------------------
>>> ----------------===//
>>> -//
>>> -// This file defines arena allocators.
>>> -//
>>> -// Almost all large objects, such as files, sections or symbols, are
>>> -// used for the entire lifetime of the linker once they are created.
>>> -// This usage characteristic makes arena allocator an attractive choice
>>> -// where the entire linker is one arena. With an arena, newly created
>>> -// objects belong to the arena and freed all at once when everything is
>>> done.
>>> -// Arena allocators are efficient and easy to understand.
>>> -// Most objects are allocated using the arena allocators defined by
>>> this file.
>>> -//
>>> -//===------------------------------------------------------
>>> ----------------===//
>>> -
>>> -#ifndef LLD_ELF_MEMORY_H
>>> -#define LLD_ELF_MEMORY_H
>>> -
>>> -#include "llvm/Support/Allocator.h"
>>> -#include "llvm/Support/StringSaver.h"
>>> -#include <vector>
>>> -
>>> -namespace lld {
>>> -namespace elf {
>>> -
>>> -// Use this arena if your object doesn't have a destructor.
>>> -extern llvm::BumpPtrAllocator BAlloc;
>>> -extern llvm::StringSaver Saver;
>>> -
>>> -// These two classes are hack to keep track of all
>>> -// SpecificBumpPtrAllocator instances.
>>> -struct SpecificAllocBase {
>>> -  SpecificAllocBase();
>>> -  virtual ~SpecificAllocBase() = default;
>>> -  virtual void reset() = 0;
>>> -  static std::vector<SpecificAllocBase *> Instances;
>>> -};
>>> -
>>> -template <class T> struct SpecificAlloc : public SpecificAllocBase {
>>> -  void reset() override { Alloc.DestroyAll(); }
>>> -  llvm::SpecificBumpPtrAllocator<T> Alloc;
>>> -};
>>> -
>>> -// Use this arena if your object has a destructor.
>>> -// Your destructor will be invoked from freeArena().
>>> -template <typename T, typename... U> inline T *make(U &&... Args) {
>>> -  static SpecificAlloc<T> Alloc;
>>> -  return new (Alloc.Alloc.Allocate()) T(std::forward<U>(Args)...);
>>> -}
>>> -
>>> -void freeArena();
>>> -}
>>> -}
>>> -
>>> -#endif
>>>
>>> Modified: lld/trunk/ELF/OutputSections.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSect
>>> ions.cpp?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/OutputSections.cpp (original)
>>> +++ lld/trunk/ELF/OutputSections.cpp Thu Dec  8 12:31:13 2016
>>> @@ -11,12 +11,12 @@
>>>  #include "Config.h"
>>>  #include "EhFrame.h"
>>>  #include "LinkerScript.h"
>>> -#include "Memory.h"
>>>  #include "Strings.h"
>>>  #include "SymbolTable.h"
>>>  #include "SyntheticSections.h"
>>>  #include "Target.h"
>>>  #include "Threads.h"
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/Support/Dwarf.h"
>>>  #include "llvm/Support/MD5.h"
>>>  #include "llvm/Support/MathExtras.h"
>>>
>>> Modified: lld/trunk/ELF/SymbolTable.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTabl
>>> e.cpp?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/SymbolTable.cpp (original)
>>> +++ lld/trunk/ELF/SymbolTable.cpp Thu Dec  8 12:31:13 2016
>>> @@ -18,8 +18,8 @@
>>>  #include "Config.h"
>>>  #include "Error.h"
>>>  #include "LinkerScript.h"
>>> -#include "Memory.h"
>>>  #include "Symbols.h"
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/ADT/STLExtras.h"
>>>
>>>  using namespace llvm;
>>>
>>> Modified: lld/trunk/ELF/SyntheticSections.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticS
>>> ections.cpp?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/SyntheticSections.cpp (original)
>>> +++ lld/trunk/ELF/SyntheticSections.cpp Thu Dec  8 12:31:13 2016
>>> @@ -19,15 +19,14 @@
>>>  #include "Error.h"
>>>  #include "InputFiles.h"
>>>  #include "LinkerScript.h"
>>> -#include "Memory.h"
>>>  #include "OutputSections.h"
>>>  #include "Strings.h"
>>>  #include "SymbolTable.h"
>>>  #include "Target.h"
>>>  #include "Threads.h"
>>>  #include "Writer.h"
>>> -
>>>  #include "lld/Config/Version.h"
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/Support/Dwarf.h"
>>>  #include "llvm/Support/Endian.h"
>>>  #include "llvm/Support/MD5.h"
>>>
>>> Modified: lld/trunk/ELF/Target.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp
>>> ?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/Target.cpp (original)
>>> +++ lld/trunk/ELF/Target.cpp Thu Dec  8 12:31:13 2016
>>> @@ -27,17 +27,16 @@
>>>  #include "Target.h"
>>>  #include "Error.h"
>>>  #include "InputFiles.h"
>>> -#include "Memory.h"
>>>  #include "OutputSections.h"
>>>  #include "Symbols.h"
>>>  #include "SyntheticSections.h"
>>>  #include "Thunks.h"
>>>  #include "Writer.h"
>>> -
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/ADT/ArrayRef.h"
>>>  #include "llvm/Object/ELF.h"
>>> -#include "llvm/Support/Endian.h"
>>>  #include "llvm/Support/ELF.h"
>>> +#include "llvm/Support/Endian.h"
>>>
>>>  using namespace llvm;
>>>  using namespace llvm::object;
>>>
>>> Modified: lld/trunk/ELF/Thunks.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Thunks.cpp
>>> ?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/Thunks.cpp (original)
>>> +++ lld/trunk/ELF/Thunks.cpp Thu Dec  8 12:31:13 2016
>>> @@ -25,10 +25,10 @@
>>>  #include "Config.h"
>>>  #include "Error.h"
>>>  #include "InputSection.h"
>>> -#include "Memory.h"
>>>  #include "OutputSections.h"
>>>  #include "Symbols.h"
>>>  #include "Target.h"
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/Support/Casting.h"
>>>  #include "llvm/Support/ELF.h"
>>>  #include "llvm/Support/Endian.h"
>>>
>>> Modified: lld/trunk/ELF/Writer.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp
>>> ?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/Writer.cpp (original)
>>> +++ lld/trunk/ELF/Writer.cpp Thu Dec  8 12:31:13 2016
>>> @@ -10,14 +10,13 @@
>>>  #include "Writer.h"
>>>  #include "Config.h"
>>>  #include "LinkerScript.h"
>>> -#include "Memory.h"
>>>  #include "OutputSections.h"
>>>  #include "Relocations.h"
>>>  #include "Strings.h"
>>>  #include "SymbolTable.h"
>>>  #include "SyntheticSections.h"
>>>  #include "Target.h"
>>> -
>>> +#include "lld/Support/Memory.h"
>>>  #include "llvm/ADT/StringMap.h"
>>>  #include "llvm/ADT/StringSwitch.h"
>>>  #include "llvm/Support/FileOutputBuffer.h"
>>>
>>> Copied: lld/trunk/include/lld/Support/Memory.h (from r289082,
>>> lld/trunk/ELF/Memory.h)
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Su
>>> pport/Memory.h?p2=lld/trunk/include/lld/Support/Memory.h&p1=
>>> lld/trunk/ELF/Memory.h&r1=289082&r2=289084&rev=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/Memory.h (original)
>>> +++ lld/trunk/include/lld/Support/Memory.h Thu Dec  8 12:31:13 2016
>>> @@ -19,15 +19,14 @@
>>>  //
>>>  //===------------------------------------------------------
>>> ----------------===//
>>>
>>> -#ifndef LLD_ELF_MEMORY_H
>>> -#define LLD_ELF_MEMORY_H
>>> +#ifndef LLD_MEMORY_H
>>> +#define LLD_MEMORY_H
>>>
>>>  #include "llvm/Support/Allocator.h"
>>>  #include "llvm/Support/StringSaver.h"
>>>  #include <vector>
>>>
>>>  namespace lld {
>>> -namespace elf {
>>>
>>>  // Use this arena if your object doesn't have a destructor.
>>>  extern llvm::BumpPtrAllocator BAlloc;
>>> @@ -56,6 +55,5 @@ template <typename T, typename... U> inl
>>>
>>>  void freeArena();
>>>  }
>>> -}
>>>
>>>  #endif
>>>
>>> Modified: lld/trunk/lib/CMakeLists.txt
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/CMakeLists
>>> .txt?rev=289084&r1=289083&r2=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/lib/CMakeLists.txt (original)
>>> +++ lld/trunk/lib/CMakeLists.txt Thu Dec  8 12:31:13 2016
>>> @@ -2,3 +2,4 @@ add_subdirectory(Config)
>>>  add_subdirectory(Core)
>>>  add_subdirectory(Driver)
>>>  add_subdirectory(ReaderWriter)
>>> +add_subdirectory(Support)
>>>
>>> Added: lld/trunk/lib/Support/CMakeLists.txt
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Support/CM
>>> akeLists.txt?rev=289084&view=auto
>>> ============================================================
>>> ==================
>>> --- lld/trunk/lib/Support/CMakeLists.txt (added)
>>> +++ lld/trunk/lib/Support/CMakeLists.txt Thu Dec  8 12:31:13 2016
>>> @@ -0,0 +1,9 @@
>>> +add_lld_library(lldSupport
>>> +  Memory.cpp
>>> +
>>> +  ADDITIONAL_HEADER_DIRS
>>> +  ${LLD_INCLUDE_DIR}/lld/Support
>>> +
>>> +  LINK_LIBS
>>> +  LLVMSupport
>>> +)
>>>
>>> Copied: lld/trunk/lib/Support/Memory.cpp (from r289082,
>>> lld/trunk/ELF/Memory.cpp)
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Support/Me
>>> mory.cpp?p2=lld/trunk/lib/Support/Memory.cpp&p1=lld/trunk/EL
>>> F/Memory.cpp&r1=289082&r2=289084&rev=289084&view=diff
>>> ============================================================
>>> ==================
>>> --- lld/trunk/ELF/Memory.cpp (original)
>>> +++ lld/trunk/lib/Support/Memory.cpp Thu Dec  8 12:31:13 2016
>>> @@ -7,21 +7,19 @@
>>>  //
>>>  //===------------------------------------------------------
>>> ----------------===//
>>>
>>> -#include "Memory.h"
>>> +#include "lld/Support/Memory.h"
>>>
>>>  using namespace llvm;
>>> -using namespace lld;
>>> -using namespace lld::elf;
>>>
>>>  namespace lld {
>>> -BumpPtrAllocator elf::BAlloc;
>>> -StringSaver elf::Saver{elf::BAlloc};
>>> +BumpPtrAllocator BAlloc;
>>> +StringSaver Saver{BAlloc};
>>>
>>>  SpecificAllocBase::SpecificAllocBase() { Instances.push_back(this); }
>>>
>>>  std::vector<SpecificAllocBase *> SpecificAllocBase::Instances;
>>>
>>> -void elf::freeArena() {
>>> +void freeArena() {
>>>    for (SpecificAllocBase *Alloc : SpecificAllocBase::Instances)
>>>      Alloc->reset();
>>>    BAlloc.Reset();
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161208/1e29651f/attachment.html>


More information about the llvm-commits mailing list