aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/CompilerInstance.h
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-11-29 09:57:35 +0000
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-11-29 09:57:35 +0000
commitf79bafa608a5d7c49ec40ad199af5e32f3038b47 (patch)
treee6822151874848d061a67b9bdc923a7d8a1ae7de /include/clang/Frontend/CompilerInstance.h
parent63db522ab674cd2ab65366ce870ab164971919e6 (diff)
This patch moves the frontend timer from clang-cc into CompilerInstance.
CompilerInstance already contains various objects that are used throughout the entire run. Also addresses Daniels review comments in: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091123/024508.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/CompilerInstance.h')
-rw-r--r--include/clang/Frontend/CompilerInstance.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h
index ed28050877..d7e7d991f3 100644
--- a/include/clang/Frontend/CompilerInstance.h
+++ b/include/clang/Frontend/CompilerInstance.h
@@ -21,6 +21,7 @@ namespace llvm {
class LLVMContext;
class raw_ostream;
class raw_fd_ostream;
+class Timer;
}
namespace clang {
@@ -89,6 +90,9 @@ class CompilerInstance {
/// The code completion consumer.
llvm::OwningPtr<CodeCompleteConsumer> CompletionConsumer;
+ /// The frontend timer
+ llvm::OwningPtr<llvm::Timer> FrontendTimer;
+
/// The list of active output files.
std::list< std::pair<std::string, llvm::raw_ostream*> > OutputFiles;
@@ -367,6 +371,17 @@ public:
void setCodeCompletionConsumer(CodeCompleteConsumer *Value);
/// }
+ /// @name Frontend timer
+ /// {
+
+ bool hasFrontendTimer() const { return FrontendTimer != 0; }
+
+ llvm::Timer &getFrontendTimer() const {
+ assert(FrontendTimer && "Compiler instance has no frontend timer!");
+ return *FrontendTimer;
+ }
+
+ /// }
/// @name Output Files
/// {
@@ -462,6 +477,9 @@ public:
bool UseDebugPrinter, bool ShowMacros,
llvm::raw_ostream &OS);
+ /// Create the frontend timer and replace any existing one with it.
+ void createFrontendTimer();
+
/// Create the default output file (from the invocation's options) and add it
/// to the list of tracked output files.
llvm::raw_fd_ostream *