Sema.cpp (193380) | Sema.cpp (194179) |
---|---|
1//===--- Sema.cpp - AST Builder and Semantic Analysis Implementation ------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 169 unchanged lines hidden (view full) --- 178Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer, 179 bool CompleteTranslationUnit) 180 : LangOpts(pp.getLangOptions()), PP(pp), Context(ctxt), Consumer(consumer), 181 Diags(PP.getDiagnostics()), SourceMgr(PP.getSourceManager()), 182 ExternalSource(0), CurContext(0), PreDeclaratorDC(0), 183 CurBlock(0), PackContext(0), IdResolver(pp.getLangOptions()), 184 GlobalNewDeleteDeclared(false), 185 CompleteTranslationUnit(CompleteTranslationUnit), | 1//===--- Sema.cpp - AST Builder and Semantic Analysis Implementation ------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 169 unchanged lines hidden (view full) --- 178Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer, 179 bool CompleteTranslationUnit) 180 : LangOpts(pp.getLangOptions()), PP(pp), Context(ctxt), Consumer(consumer), 181 Diags(PP.getDiagnostics()), SourceMgr(PP.getSourceManager()), 182 ExternalSource(0), CurContext(0), PreDeclaratorDC(0), 183 CurBlock(0), PackContext(0), IdResolver(pp.getLangOptions()), 184 GlobalNewDeleteDeclared(false), 185 CompleteTranslationUnit(CompleteTranslationUnit), |
186 CurrentInstantiationScope(0) { | 186 NumSFINAEErrors(0), CurrentInstantiationScope(0) { |
187 188 StdNamespace = 0; 189 TUScope = 0; 190 if (getLangOptions().CPlusPlus) 191 FieldCollector.reset(new CXXFieldCollector()); 192 193 // Tell diagnostics how to render things from the AST library. 194 PP.getDiagnostics().SetArgToStringFn(ConvertArgToStringFn, &Context); --- 116 unchanged lines hidden (view full) --- 311 while (isa<BlockDecl>(DC)) 312 DC = DC->getParent(); 313 if (isa<ObjCMethodDecl>(DC) || isa<FunctionDecl>(DC)) 314 return cast<NamedDecl>(DC); 315 return 0; 316} 317 318Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() { | 187 188 StdNamespace = 0; 189 TUScope = 0; 190 if (getLangOptions().CPlusPlus) 191 FieldCollector.reset(new CXXFieldCollector()); 192 193 // Tell diagnostics how to render things from the AST library. 194 PP.getDiagnostics().SetArgToStringFn(ConvertArgToStringFn, &Context); --- 116 unchanged lines hidden (view full) --- 311 while (isa<BlockDecl>(DC)) 312 DC = DC->getParent(); 313 if (isa<ObjCMethodDecl>(DC) || isa<FunctionDecl>(DC)) 314 return cast<NamedDecl>(DC); 315 return 0; 316} 317 318Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() { |
319 this->Emit(); | 319 if (!this->Emit()) 320 return; |
320 321 // If this is not a note, and we're in a template instantiation 322 // that is different from the last template instantiation where 323 // we emitted an error, print a template instantiation 324 // backtrace. 325 if (!SemaRef.Diags.isBuiltinNote(DiagID) && 326 !SemaRef.ActiveTemplateInstantiations.empty() && 327 SemaRef.ActiveTemplateInstantiations.back() 328 != SemaRef.LastTemplateInstantiationErrorContext) { 329 SemaRef.PrintInstantiationStack(); 330 SemaRef.LastTemplateInstantiationErrorContext 331 = SemaRef.ActiveTemplateInstantiations.back(); 332 } 333} | 321 322 // If this is not a note, and we're in a template instantiation 323 // that is different from the last template instantiation where 324 // we emitted an error, print a template instantiation 325 // backtrace. 326 if (!SemaRef.Diags.isBuiltinNote(DiagID) && 327 !SemaRef.ActiveTemplateInstantiations.empty() && 328 SemaRef.ActiveTemplateInstantiations.back() 329 != SemaRef.LastTemplateInstantiationErrorContext) { 330 SemaRef.PrintInstantiationStack(); 331 SemaRef.LastTemplateInstantiationErrorContext 332 = SemaRef.ActiveTemplateInstantiations.back(); 333 } 334} |