//===----------------------------------------------------------------------===//
#include "ASTConsumers.h"
-
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/TranslationUnit.h"
#include "llvm/Target/TargetMachineRegistry.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/IPO.h"
-
using namespace clang;
using namespace llvm;
GenerateDebugInfo(debug),
Gen(CreateLLVMCodeGen(Diags, langopts, InputFile, GenerateDebugInfo)),
TheModule(0), TheTargetData(0), AsmOutStream(0), ModuleProvider(0),
- CodeGenPasses(0), PerModulePasses(0), PerFunctionPasses(0) {}
+ CodeGenPasses(0), PerModulePasses(0), PerFunctionPasses(0) {
+
+ llvm::TimePassesIsEnabled = CompileOpts.TimePasses;
+ }
~BackendConsumer() {
delete AsmOutStream;
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
-#include "llvm/Pass.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringExtras.h"
Opts.CPU = TargetCPU;
Opts.Features.insert(Opts.Features.end(),
TargetFeatures.begin(), TargetFeatures.end());
+
+ // Handle -ftime-report.
+ Opts.TimePasses = TimeReport;
}
//===----------------------------------------------------------------------===//
if (InputFilenames.empty())
InputFilenames.push_back("-");
- // Handle -ftime-report.
- if (TimeReport)
- llvm::TimePassesIsEnabled = true;
-
// Create a file manager object to provide access to and cache the filesystem.
FileManager FileMgr;
359603420E49495900C6282B /* Driver */ = {
isa = PBXGroup;
children = (
- 35585DC20EAFBC5F00D0A97A /* Backend.cpp */,
359763250E633C7500B68AB7 /* HTMLDiagnostics.cpp */,
350F4B460E5F32E100A21EA9 /* InitHeaderSearch.cpp */,
355BD0500EBFB040001A9DFF /* PlistDiagnostics.cpp */,
352028460E2C16820096ADE0 /* Analyses.def */,
DE3985780CB8ADC800223765 /* ASTConsumers.h */,
DE39857A0CB8ADCB00223765 /* ASTConsumers.cpp */,
+ 35585DC20EAFBC5F00D0A97A /* Backend.cpp */,
35A057E60EAE2DDD0069249F /* CacheTokens.cpp */,
DE3B92800EB54E6000D01046 /* DependencyFile.cpp */,
DE38CF150D8C9DE000A273B6 /* DiagChecker.cpp */,
unsigned UnrollLoops : 1; /// Control whether loops are unrolled.
unsigned VerifyModule : 1; /// Control whether the module
/// should be run through the LLVM Verifier.
+ unsigned TimePasses : 1; /// Set when -ftime-report is enabled.
/// CPU - An optional CPU to target.
std::string CPU;
UnitAtATime = 1;
InlineFunctions = SimplifyLibCalls = UnrollLoops = 0;
VerifyModule = 1;
+ TimePasses = 0;
}
};