Files
llvm/lld/ELF/Memory.cpp
Rafael Espindola 5c9e8f5e52 Replace GAlloc with a template function.
This patch replaces GAlloc<ELFT>::<sometype>.Allocate() with
alloc<sometype<ELFT>>().

Patch by Rui!

llvm-svn: 285748
2016-11-01 21:06:40 +00:00

30 lines
773 B
C++

//===- 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();
}
}