blob: d4d9cc21bc4848c95dd33b6e72d31071a5dfc1f3 [file] [log] [blame]
//===- InputFactory.cpp ---------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "mcld/MC/InputFactory.h"
#include "mcld/MC/AttributeFactory.h"
using namespace mcld;
//===----------------------------------------------------------------------===//
// InputFactory
InputFactory::InputFactory(size_t pNum, AttributeFactory& pAttrFactory)
: GCFactory<Input,0>(pNum), m_AttrFactory(pAttrFactory) {
}
InputFactory::~InputFactory()
{
}
Input* InputFactory::produce(llvm::StringRef pName,
const sys::fs::Path& pPath,
unsigned int pType,
off_t pFileOffset)
{
mcld::Input* result = Alloc::allocate();
new (result) mcld::Input(pName, pPath, m_AttrFactory.last(), pType, pFileOffset);
return result;
}