Lines Matching +full:commit +full:- +full:message +full:- +full:check
1 //===--- DiagnosticRenderer.cpp - Diagnostic Pretty-Printing --------------===//
8 //===----------------------------------------------------------------------===//
14 #include "clang/Edit/Commit.h"
53 edit::Commit commit(SM, LangOpts); in mergeFixits() local
59 commit.insertFromRange(Hint.RemoveRange.getBegin(), in mergeFixits()
63 commit.remove(Hint.RemoveRange); in mergeFixits()
67 commit.replace(Hint.RemoveRange, Hint.CodeToInsert); in mergeFixits()
69 commit.insert(Hint.RemoveRange.getBegin(), Hint.CodeToInsert, in mergeFixits()
75 if (Editor.commit(commit)) { in mergeFixits()
83 StringRef Message, in emitDiagnostic() argument
93 // If we have no source location, just emit the diagnostic message. in emitDiagnostic()
94 emitDiagnosticMessage(Loc, PresumedLoc(), Level, Message, Ranges, SM, D); in emitDiagnostic()
109 if (I->RemoveRange.isValid()) in emitDiagnostic()
110 MutableRanges.push_back(I->RemoveRange); in emitDiagnostic()
115 Loc = SM->getFileLoc(Loc); in emitDiagnostic()
117 PresumedLoc PLoc = SM->getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitDiagnostic()
123 // Next, emit the actual diagnostic message and caret. in emitDiagnostic()
124 emitDiagnosticMessage(Loc, PLoc, Level, Message, Ranges, SM, D); in emitDiagnostic()
149 void DiagnosticRenderer::emitBasicNote(StringRef Message) { in emitBasicNote() argument
151 SourceLocation(), PresumedLoc(), DiagnosticsEngine::Note, Message, in emitBasicNote()
165 /// \param Level The diagnostic level of the message this stack pertains to.
179 if (!DiagOpts->ShowNoteIncludeStack && Level == DiagnosticsEngine::Note) in emitIncludeStack()
199 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitIncludeStackRecursively()
242 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitImportStackRecursively()
253 /// \brief Emit the module build stack, for cases where a module is (re-)built
262 DiagOpts->ShowPresumedLoc), in emitModuleBuildStack()
275 assert(SM->getFileID(Loc) == MacroFileID); in retrieveMacroLocation()
283 if (SM->isMacroArgExpansion(Loc)) { in retrieveMacroLocation()
288 MacroLocation = SM->getImmediateSpellingLoc(Loc); in retrieveMacroLocation()
289 MacroArgLocation = IsBegin ? SM->getImmediateExpansionRange(Loc).first in retrieveMacroLocation()
290 : SM->getImmediateExpansionRange(Loc).second; in retrieveMacroLocation()
292 MacroLocation = IsBegin ? SM->getImmediateExpansionRange(Loc).first in retrieveMacroLocation()
293 : SM->getImmediateExpansionRange(Loc).second; in retrieveMacroLocation()
294 MacroArgLocation = SM->getImmediateSpellingLoc(Loc); in retrieveMacroLocation()
298 MacroFileID = SM->getFileID(MacroLocation); in retrieveMacroLocation()
306 MacroFileID = SM->getFileID(MacroArgLocation); in retrieveMacroLocation()
317 if (SM->isMacroArgExpansion(Loc)) { in getMacroArgExpansionFileIDs()
318 IDs.push_back(SM->getFileID(Loc)); in getMacroArgExpansionFileIDs()
319 Loc = SM->getImmediateSpellingLoc(Loc); in getMacroArgExpansionFileIDs()
321 auto ExpRange = SM->getImmediateExpansionRange(Loc); in getMacroArgExpansionFileIDs()
358 FileID CaretLocFileID = SM->getFileID(CaretLoc); in mapDiagnosticRanges()
361 if (I->isInvalid()) continue; in mapDiagnosticRanges()
363 SourceLocation Begin = I->getBegin(), End = I->getEnd(); in mapDiagnosticRanges()
364 bool IsTokenRange = I->isTokenRange(); in mapDiagnosticRanges()
366 FileID BeginFileID = SM->getFileID(Begin); in mapDiagnosticRanges()
367 FileID EndFileID = SM->getFileID(End); in mapDiagnosticRanges()
375 Begin = SM->getImmediateExpansionRange(Begin).first; in mapDiagnosticRanges()
376 BeginFileID = SM->getFileID(Begin); in mapDiagnosticRanges()
382 End = SM->getImmediateExpansionRange(End).second; in mapDiagnosticRanges()
383 EndFileID = SM->getFileID(End); in mapDiagnosticRanges()
401 Begin = SM->getSpellingLoc(Begin); in mapDiagnosticRanges()
402 End = SM->getSpellingLoc(End); in mapDiagnosticRanges()
420 /// macro expansion message
435 llvm::raw_svector_ostream Message(MessageStorage); in emitSingleMacroExpansion() local
439 Message << "expanded from here"; in emitSingleMacroExpansion()
441 Message << "expanded from macro '" << MacroName << "'"; in emitSingleMacroExpansion()
443 emitDiagnostic(SpellingLoc, DiagnosticsEngine::Note, Message.str(), in emitSingleMacroExpansion()
447 /// Check that the macro argument location of Loc starts with ArgumentLoc.
461 /// Check if all the locations in the range have the same macro argument
476 /// A helper function to check if the current ranges are all inside the same
498 /// so to check if the ranges expands to the same beginning location. in checkRangesForMacroArgExpansion()
556 unsigned MacroLimit = DiagOpts->MacroBacktraceLimit; in emitMacroExpansions()
573 llvm::raw_svector_ostream Message(MessageStorage); in emitMacroExpansions() local
574 Message << "(skipping " << (MacroDepth - MacroLimit) in emitMacroExpansions()
575 << " expansions in backtrace; use -fmacro-backtrace-limit=0 to " in emitMacroExpansions()
577 emitBasicNote(Message.str()); in emitMacroExpansions()
579 for (auto I = LocationStack.rend() - MacroEndMessages, in emitMacroExpansions()
592 llvm::raw_svector_ostream Message(MessageStorage); in emitIncludeLocation() local
593 Message << "in file included from " << PLoc.getFilename() << ':' in emitIncludeLocation()
595 emitNote(Loc, Message.str(), &SM); in emitIncludeLocation()
604 llvm::raw_svector_ostream Message(MessageStorage); in emitImportLocation() local
605 Message << "in module '" << ModuleName; in emitImportLocation()
607 Message << "' imported from " << PLoc.getFilename() << ':' in emitImportLocation()
609 Message << ":"; in emitImportLocation()
610 emitNote(Loc, Message.str(), &SM); in emitImportLocation()
620 llvm::raw_svector_ostream Message(MessageStorage); in emitBuildingModuleLocation() local
622 Message << "while building module '" << ModuleName << "' imported from " in emitBuildingModuleLocation()
625 Message << "while building module '" << ModuleName << "':"; in emitBuildingModuleLocation()
626 emitNote(Loc, Message.str(), &SM); in emitBuildingModuleLocation()