diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-09 20:55:08 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-09 20:55:08 +0000 |
commit | e29709f32e82d7f7dfc25d8602b1b828a1aa7f56 (patch) | |
tree | 53bf4f6235b0d2624a30ac48c36ebaca55dc25ac /include/clang/Frontend/CompilerInvocation.h | |
parent | c19aa99b57e9d005121bd7f4d87d408e187a1238 (diff) |
Add CompilerInvocation object, to capture all the options one needs to invoke
the compiler, and start flood filling it into clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/CompilerInvocation.h')
-rw-r--r-- | include/clang/Frontend/CompilerInvocation.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h new file mode 100644 index 0000000000..7cd68e81a2 --- /dev/null +++ b/include/clang/Frontend/CompilerInvocation.h @@ -0,0 +1,43 @@ +//===-- CompilerInvocation.h - Compiler Invocation Helper Data --*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_FRONTEND_COMPILERINVOCATION_H_ +#define LLVM_CLANG_FRONTEND_COMPILERINVOCATION_H_ + +#include "clang/Frontend/DiagnosticOptions.h" +#include <string> + +namespace clang { + +/// CompilerInvocation - Helper class for holding the data necessary to invoke +/// the compiler. +/// +/// This class is designed to represent an abstract "invocation" of the +/// compiler, including data such as the include paths, the code generation +/// options, the warning flags, and so on. +class CompilerInvocation { + /// The location for the output file. This is optional only for compiler + /// invocations which have no output. + std::string OutputFile; + + DiagnosticOptions Diags; + +public: + CompilerInvocation() {} + + std::string &getOutputFile() { return OutputFile; } + const std::string &getOutputFile() const { return OutputFile; } + + DiagnosticOptions &getDiagnosticOpts() { return Diags; } + const DiagnosticOptions &getDiagnosticOpts() const { return Diags; } +}; + +} // end namespace clang + +#endif |