blob: 949bbe7d6b9c856c8302d22308c442b623323e6f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
//===--- Compilation.cpp - Compilation Task Implementation --------------*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "clang/Driver/Compilation.h"
#include "clang/Driver/ArgList.h"
#include "clang/Driver/ToolChain.h"
using namespace clang::driver;
Compilation::Compilation(ToolChain &_DefaultToolChain,
ArgList *_Args)
: DefaultToolChain(_DefaultToolChain), Args(_Args) {
}
Compilation::~Compilation() {
delete Args;
// Free any derived arg lists.
for (llvm::DenseMap<const ToolChain*, ArgList*>::iterator
it = TCArgs.begin(), ie = TCArgs.end(); it != ie; ++it) {
ArgList *A = it->second;
if (A != Args)
delete Args;
}
}
const ArgList &Compilation::getArgsForToolChain(const ToolChain *TC) {
if (!TC)
TC = &DefaultToolChain;
ArgList *&Args = TCArgs[TC];
if (!Args)
Args = TC->TranslateArgs(*Args);
return *Args;
}
int Compilation::Execute() const {
return 0;
}
|