From cc041ba03aed685400197fb938b7a583713d25af Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 24 Jan 2006 04:13:11 +0000 Subject: Initial checkin of the InlineAsm class git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25570 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Module.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'lib/VMCore/Module.cpp') diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index de63b4b..e9b28f9 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -44,17 +44,30 @@ GlobalVariable *ilist_traits::createSentinel() { return Ret; } +InlineAsm *ilist_traits::createSentinel() { + InlineAsm *Ret = new InlineAsm(FunctionType::get(Type::VoidTy, + std::vector(), false), "", "", + false); + // This should not be garbage monitored. + LeakDetector::removeGarbageObject(Ret); + return Ret; +} + iplist &ilist_traits::getList(Module *M) { return M->getFunctionList(); } iplist &ilist_traits::getList(Module *M) { return M->getGlobalList(); } +iplist &ilist_traits::getList(Module *M) { + return M->getInlineAsmList(); +} // Explicit instantiations of SymbolTableListTraits since some of the methods -// are not in the public header file... +// are not in the public header file. template class SymbolTableListTraits; template class SymbolTableListTraits; +template class SymbolTableListTraits; //===----------------------------------------------------------------------===// // Primitive Module methods. @@ -66,6 +79,8 @@ Module::Module(const std::string &MID) FunctionList.setParent(this); GlobalList.setItemParent(this); GlobalList.setParent(this); + InlineAsmList.setItemParent(this); + InlineAsmList.setParent(this); SymTab = new SymbolTable(); } @@ -75,6 +90,8 @@ Module::~Module() { GlobalList.setParent(0); FunctionList.clear(); FunctionList.setParent(0); + InlineAsmList.clear(); + InlineAsmList.setParent(0); LibraryList.clear(); delete SymTab; } -- cgit v1.1