You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.4 KiB

//===- FileToken.cpp ------------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "mcld/Script/FileToken.h"
#include "mcld/Support/GCFactory.h"
#include <llvm/Support/ManagedStatic.h>
namespace mcld {
typedef GCFactory<FileToken, MCLD_SYMBOLS_PER_INPUT> FileTokenFactory;
static llvm::ManagedStatic<FileTokenFactory> g_FileTokenFactory;
//===----------------------------------------------------------------------===//
// FileToken
//===----------------------------------------------------------------------===//
FileToken::FileToken() {
}
FileToken::FileToken(const std::string& pName, bool pAsNeeded)
: InputToken(InputToken::File, pName, pAsNeeded) {
}
FileToken::~FileToken() {
}
FileToken* FileToken::create(const std::string& pName, bool pAsNeeded) {
FileToken* result = g_FileTokenFactory->allocate();
new (result) FileToken(pName, pAsNeeded);
return result;
}
void FileToken::destroy(FileToken*& pFileToken) {
g_FileTokenFactory->destroy(pFileToken);
g_FileTokenFactory->deallocate(pFileToken);
pFileToken = NULL;
}
void FileToken::clear() {
g_FileTokenFactory->clear();
}
} // namespace mcld