1 //===- InputFactory.cpp ---------------------------------------------------===// 2 // 3 // The MCLinker Project 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 #include "mcld/MC/InputFactory.h" 10 #include "mcld/MC/AttributeFactory.h" 11 12 using namespace mcld; 13 14 //===----------------------------------------------------------------------===// 15 // InputFactory 16 InputFactory::InputFactory(size_t pNum, AttributeFactory& pAttrFactory) 17 : GCFactory<Input,0>(pNum), m_AttrFactory(pAttrFactory) { 18 } 19 20 InputFactory::~InputFactory() 21 { 22 } 23 24 Input* InputFactory::produce(llvm::StringRef pName, 25 const sys::fs::Path& pPath, 26 unsigned int pType, 27 off_t pFileOffset) 28 { 29 mcld::Input* result = Alloc::allocate(); 30 new (result) mcld::Input(pName, pPath, m_AttrFactory.last(), pType, pFileOffset); 31 return result; 32 } 33 34