Misha Brukman | 521f1fe | 2003-09-18 16:17:06 +0000 | [diff] [blame] | 1 | //===-- ModuleProvider.cpp - Base implementation for module providers -----===// |
Misha Brukman | fd93908 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 2 | // |
John Criswell | b576c94 | 2003-10-20 19:43:21 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame^] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | fd93908 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 7 | // |
John Criswell | b576c94 | 2003-10-20 19:43:21 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Misha Brukman | 521f1fe | 2003-09-18 16:17:06 +0000 | [diff] [blame] | 9 | // |
| 10 | // Minimal implementation of the abstract interface for providing a module. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "llvm/ModuleProvider.h" |
| 15 | #include "llvm/Module.h" |
Chris Lattner | 31f8499 | 2003-11-21 20:23:48 +0000 | [diff] [blame] | 16 | using namespace llvm; |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 17 | |
Misha Brukman | 521f1fe | 2003-09-18 16:17:06 +0000 | [diff] [blame] | 18 | /// ctor - always have a valid Module |
| 19 | /// |
Chris Lattner | 00413e3 | 2003-10-04 20:14:59 +0000 | [diff] [blame] | 20 | ModuleProvider::ModuleProvider() : TheModule(0) { } |
Misha Brukman | 521f1fe | 2003-09-18 16:17:06 +0000 | [diff] [blame] | 21 | |
| 22 | /// dtor - when we leave, we take our Module with us |
| 23 | /// |
Chris Lattner | 00413e3 | 2003-10-04 20:14:59 +0000 | [diff] [blame] | 24 | ModuleProvider::~ModuleProvider() { |
Misha Brukman | 238fb25 | 2003-09-22 23:44:13 +0000 | [diff] [blame] | 25 | delete TheModule; |
Misha Brukman | 521f1fe | 2003-09-18 16:17:06 +0000 | [diff] [blame] | 26 | } |