diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-01-13 00:48:06 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-01-13 00:48:06 +0000 |
commit | 4f2bc55d4e8abaa3ec19904c3143b095611ea228 (patch) | |
tree | 576d5124fdf216534a276d46429dda4ee9690bef /clang/include | |
parent | 7d38d4da613fb165087234c0bcc634e2a6e6ea85 (diff) | |
download | bcm5719-llvm-4f2bc55d4e8abaa3ec19904c3143b095611ea228.tar.gz bcm5719-llvm-4f2bc55d4e8abaa3ec19904c3143b095611ea228.zip |
cc1: Factor out CompilerInstance::ExecuteAction which has the majority of the
clang -cc1 logic for running an action against a set of options.
- This should make it easier to build tools that have a clang -cc1 like
interface, but aren't actually part of clang -cc1.
llvm-svn: 93282
Diffstat (limited to 'clang/include')
-rw-r--r-- | clang/include/clang/Frontend/CompilerInstance.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h index 18ec429db7e..35a983dbd78 100644 --- a/clang/include/clang/Frontend/CompilerInstance.h +++ b/clang/include/clang/Frontend/CompilerInstance.h @@ -32,6 +32,7 @@ class Diagnostic; class DiagnosticClient; class ExternalASTSource; class FileManager; +class FrontendAction; class Preprocessor; class Source; class SourceManager; @@ -103,6 +104,42 @@ public: bool _OwnsLLVMContext = true); ~CompilerInstance(); + /// @name High-Level Operations + /// { + + /// ExecuteAction - Execute the provided action against the compiler's + /// CompilerInvocation object. + /// + /// This function makes the following assumptions: + /// + /// - The invocation options should be initialized. This function does not + /// handle the '-help' or '-version' options, clients should handle those + /// directly. + /// + /// - The diagnostics engine should have already been created by the client. + /// + /// - No other CompilerInstance state should have been initialized (this is + /// an unchecked error). + /// + /// - Clients should have initialized any LLVM target features that may be + /// required. + /// + /// - Clients should eventually call llvm_shutdown() upon the completion of + /// this routine to ensure that any managed objects are properly destroyed. + /// + /// Note that this routine may write output to 'stderr'. + /// + /// \param Act - The action to execute. + /// \return - True on success. + // + // FIXME: This function should take the stream to write any debugging / + // verbose output to as an argument. + // + // FIXME: Eliminate the llvm_shutdown requirement, that should either be part + // of the context or else not CompilerInstance specific. + bool ExecuteAction(FrontendAction &Act); + + /// } /// @name LLVM Context /// { |