From d612566385cb20fb867af6d8d6e0c5f138a963d7 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 5 Nov 2012 23:58:27 +0000 Subject: Have the parser initialize Sema before it consumes the first token. This is important because the first token could actually be after an #include that triggers a module import, which might use either Sema or the AST consumer before it would have been initialized. llvm-svn: 167423 --- clang/lib/CodeGen/CodeGenAction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenAction.cpp') diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index dd32167..1c536a6 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -65,9 +65,11 @@ namespace clang { TargetOpts(targetopts), LangOpts(langopts), AsmOutStream(OS), + Context(), LLVMIRGeneration("LLVM IR Generation Time"), Gen(CreateLLVMCodeGen(Diags, infile, compopts, C)), - LinkModule(LinkModule) { + LinkModule(LinkModule) + { llvm::TimePassesIsEnabled = TimePasses; } -- cgit v1.1