intercept/compilation.rs
1/* Copyright (C) 2012-2018 by László Nagy
2 This file is part of Bear.
3
4 Bear is a tool to generate compilation database for clang tooling.
5
6 Bear is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 Bear is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20use std::path;
21
22use Result;
23use trace;
24use database;
25
26pub enum CompilerPass {
27 Preprocessor,
28 Compilation,
29 Assembly,
30 Linking
31}
32
33pub struct Compilation {
34 compiler: path::PathBuf,
35 phase: CompilerPass,
36 flags: Vec<String>,
37 source: path::PathBuf,
38 output: Option<path::PathBuf>,
39 cwd: path::PathBuf,
40}
41
42impl Compilation {
43 pub fn from_trace(_trace: trace::Trace) -> Result<Compilation> {
44 unimplemented!()
45 }
46
47 pub fn to_db_entry(&self) -> Result<database::Entry> {
48 unimplemented!()
49 }
50}