[cfe-commits] r90118 - in /cfe/trunk: include/clang/Frontend/ASTConsumers.h lib/Driver/CC1Options.cpp lib/Frontend/Backend.cpp lib/Frontend/FrontendActions.cpp tools/clang-cc/Options.cpp tools/clang-cc/Options.h tools/clang-cc/clang-cc.cpp
Daniel Dunbar
daniel at zuster.org
Mon Nov 30 00:39:58 PST 2009
Author: ddunbar
Date: Mon Nov 30 02:39:52 2009
New Revision: 90118
URL: http://llvm.org/viewvc/llvm-project?rev=90118&view=rev
Log:
Eliminate CodeGenOptions::TimePasses.
Modified:
cfe/trunk/include/clang/Frontend/ASTConsumers.h
cfe/trunk/lib/Driver/CC1Options.cpp
cfe/trunk/lib/Frontend/Backend.cpp
cfe/trunk/lib/Frontend/FrontendActions.cpp
cfe/trunk/tools/clang-cc/Options.cpp
cfe/trunk/tools/clang-cc/Options.h
cfe/trunk/tools/clang-cc/clang-cc.cpp
Modified: cfe/trunk/include/clang/Frontend/ASTConsumers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ASTConsumers.h?rev=90118&r1=90117&r2=90118&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/ASTConsumers.h (original)
+++ cfe/trunk/include/clang/Frontend/ASTConsumers.h Mon Nov 30 02:39:52 2009
@@ -83,6 +83,7 @@
const LangOptions &Features,
const CodeGenOptions &CodeGenOpts,
const TargetOptions &TargetOpts,
+ bool TimePasses,
const std::string &ModuleID,
llvm::raw_ostream *OS,
llvm::LLVMContext& C);
Modified: cfe/trunk/lib/Driver/CC1Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CC1Options.cpp?rev=90118&r1=90117&r2=90118&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/CC1Options.cpp (original)
+++ cfe/trunk/lib/Driver/CC1Options.cpp Mon Nov 30 02:39:52 2009
@@ -194,7 +194,6 @@
// FIXME: Eliminate this dependency?
// if (Lang.CPlusPlus)
// Opts.NoCommon = 1;
-// Opts.TimePasses = TimePasses;
// FIXME: Put elsewhere?
#ifdef NDEBUG
Modified: cfe/trunk/lib/Frontend/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Backend.cpp?rev=90118&r1=90117&r2=90118&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/Backend.cpp (original)
+++ cfe/trunk/lib/Frontend/Backend.cpp Mon Nov 30 02:39:52 2009
@@ -76,8 +76,9 @@
public:
BackendConsumer(BackendAction action, Diagnostic &Diags,
const LangOptions &langopts, const CodeGenOptions &compopts,
- const TargetOptions &targetopts, const std::string &infile,
- llvm::raw_ostream* OS, LLVMContext& C) :
+ const TargetOptions &targetopts, bool TimePasses,
+ const std::string &infile, llvm::raw_ostream *OS,
+ LLVMContext& C) :
Action(action),
CodeGenOpts(compopts),
LangOpts(langopts),
@@ -93,8 +94,7 @@
FormattedOutStream.setStream(*AsmOutStream,
formatted_raw_ostream::PRESERVE_STREAM);
- // Enable -time-passes if -ftime-report is enabled.
- llvm::TimePassesIsEnabled = CodeGenOpts.TimePasses;
+ llvm::TimePassesIsEnabled = TimePasses;
}
~BackendConsumer() {
@@ -108,7 +108,7 @@
virtual void Initialize(ASTContext &Ctx) {
Context = &Ctx;
- if (CodeGenOpts.TimePasses)
+ if (llvm::TimePassesIsEnabled)
LLVMIRGeneration.startTimer();
Gen->Initialize(Ctx);
@@ -117,7 +117,7 @@
ModuleProvider = new ExistingModuleProvider(TheModule);
TheTargetData = new llvm::TargetData(Ctx.Target.getTargetDescription());
- if (CodeGenOpts.TimePasses)
+ if (llvm::TimePassesIsEnabled)
LLVMIRGeneration.stopTimer();
}
@@ -126,24 +126,24 @@
Context->getSourceManager(),
"LLVM IR generation of declaration");
- if (CodeGenOpts.TimePasses)
+ if (llvm::TimePassesIsEnabled)
LLVMIRGeneration.startTimer();
Gen->HandleTopLevelDecl(D);
- if (CodeGenOpts.TimePasses)
+ if (llvm::TimePassesIsEnabled)
LLVMIRGeneration.stopTimer();
}
virtual void HandleTranslationUnit(ASTContext &C) {
{
PrettyStackTraceString CrashInfo("Per-file LLVM IR generation");
- if (CodeGenOpts.TimePasses)
+ if (llvm::TimePassesIsEnabled)
LLVMIRGeneration.startTimer();
Gen->HandleTranslationUnit(C);
- if (CodeGenOpts.TimePasses)
+ if (llvm::TimePassesIsEnabled)
LLVMIRGeneration.stopTimer();
}
@@ -239,7 +239,7 @@
BackendArgs.push_back("-nozero-initialized-in-bss");
BackendArgs.push_back("-relocation-model");
BackendArgs.push_back(CodeGenOpts.RelocationModel.c_str());
- if (CodeGenOpts.TimePasses)
+ if (llvm::TimePassesIsEnabled)
BackendArgs.push_back("-time-passes");
if (CodeGenOpts.UnwindTables)
BackendArgs.push_back("-unwind-tables");
@@ -350,7 +350,7 @@
if (!TheModule || !TheTargetData)
return;
- TimeRegion Region(CodeGenOpts.TimePasses ? &CodeGenerationTime : 0);
+ TimeRegion Region(llvm::TimePassesIsEnabled ? &CodeGenerationTime : 0);
// Make sure IR generation is happy with the module. This is
// released by the module provider.
@@ -407,9 +407,10 @@
const LangOptions &LangOpts,
const CodeGenOptions &CodeGenOpts,
const TargetOptions &TargetOpts,
+ bool TimePasses,
const std::string& InFile,
llvm::raw_ostream* OS,
LLVMContext& C) {
return new BackendConsumer(Action, Diags, LangOpts, CodeGenOpts,
- TargetOpts, InFile, OS, C);
+ TargetOpts, TimePasses, InFile, OS, C);
}
Modified: cfe/trunk/lib/Frontend/FrontendActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendActions.cpp?rev=90118&r1=90117&r2=90118&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendActions.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendActions.cpp Mon Nov 30 02:39:52 2009
@@ -170,7 +170,8 @@
OS.reset(CI.createDefaultOutputFile(true, InFile, "bc"));
return CreateBackendConsumer(BA, CI.getDiagnostics(), CI.getLangOpts(),
- CI.getCodeGenOpts(), CI.getTargetOpts(), InFile,
+ CI.getCodeGenOpts(), CI.getTargetOpts(),
+ CI.getFrontendOpts().ShowTimers, InFile,
OS.take(), CI.getLLVMContext());
}
Modified: cfe/trunk/tools/clang-cc/Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Options.cpp?rev=90118&r1=90117&r2=90118&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/Options.cpp (original)
+++ cfe/trunk/tools/clang-cc/Options.cpp Mon Nov 30 02:39:52 2009
@@ -795,8 +795,7 @@
}
void clang::InitializeCodeGenOptions(CodeGenOptions &Opts,
- const LangOptions &Lang,
- bool TimePasses) {
+ const LangOptions &Lang) {
using namespace codegenoptions;
// -Os implies -O2
@@ -830,7 +829,6 @@
// FIXME: Eliminate this dependency?
if (Lang.CPlusPlus)
Opts.NoCommon = 1;
- Opts.TimePasses = TimePasses;
#ifdef NDEBUG
Opts.VerifyModule = 0;
Modified: cfe/trunk/tools/clang-cc/Options.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Options.h?rev=90118&r1=90117&r2=90118&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/Options.h (original)
+++ cfe/trunk/tools/clang-cc/Options.h Mon Nov 30 02:39:52 2009
@@ -30,8 +30,7 @@
void InitializeAnalyzerOptions(AnalyzerOptions &Opts);
void InitializeCodeGenOptions(CodeGenOptions &Opts,
- const LangOptions &Lang,
- bool TimePasses);
+ const LangOptions &Lang);
void InitializeDependencyOutputOptions(DependencyOutputOptions &Opts);
Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=90118&r1=90117&r2=90118&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Mon Nov 30 02:39:52 2009
@@ -183,8 +183,7 @@
InitializePreprocessorOutputOptions(Opts.getPreprocessorOutputOpts());
// Initialize backend options.
- InitializeCodeGenOptions(Opts.getCodeGenOpts(), Opts.getLangOpts(),
- Opts.getFrontendOpts().ShowTimers);
+ InitializeCodeGenOptions(Opts.getCodeGenOpts(), Opts.getLangOpts());
return true;
}
More information about the cfe-commits
mailing list