diff options
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 3 | ||||
-rw-r--r-- | lib/Frontend/DependencyFile.cpp | 9 | ||||
-rw-r--r-- | lib/Frontend/FixItRewriter.cpp | 14 | ||||
-rw-r--r-- | lib/Frontend/FrontendAction.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/HTMLDiagnostics.cpp | 3 | ||||
-rw-r--r-- | lib/Frontend/InitHeaderSearch.cpp | 11 | ||||
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 34 | ||||
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 15 | ||||
-rw-r--r-- | lib/Frontend/RewriteObjC.cpp | 51 | ||||
-rw-r--r-- | lib/Frontend/TextDiagnosticPrinter.cpp | 14 |
12 files changed, 98 insertions, 66 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 935c415..7243f70 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -378,7 +378,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin, // FIXME: We shouldn't have to pass in the path info. driver::Driver TheDriver("clang", "/", llvm::sys::getHostTriple(), - "a.out", false, Diags); + "a.out", false, false, Diags); // Don't check that inputs exist, they have been remapped. TheDriver.setCheckInputsExist(false); diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 7b4932d..879e9f6 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -29,6 +29,7 @@ #include "llvm/LLVMContext.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/ADT/Statistic.h" #include "llvm/Support/Timer.h" #include "llvm/System/Host.h" #include "llvm/System/Path.h" @@ -479,6 +480,9 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { if (getFrontendOpts().ShowTimers) createFrontendTimer(); + if (getFrontendOpts().ShowStats) + llvm::EnableStatistics(); + for (unsigned i = 0, e = getFrontendOpts().Inputs.size(); i != e; ++i) { const std::string &InFile = getFrontendOpts().Inputs[i].second; diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 6e18f34..dc2c6bf 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -436,6 +436,8 @@ static void HeaderSearchOptsToArgs(const HeaderSearchOptions &Opts, } if (!Opts.UseStandardIncludes) Res.push_back("-nostdinc"); + if (!Opts.UseStandardCXXIncludes) + Res.push_back("-nostdinc++"); if (Opts.Verbose) Res.push_back("-v"); } @@ -1014,6 +1016,7 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) { Opts.Verbose = Args.hasArg(OPT_v); Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc); Opts.UseStandardIncludes = !Args.hasArg(OPT_nostdinc); + Opts.UseStandardCXXIncludes = !Args.hasArg(OPT_nostdincxx); Opts.ResourceDir = getLastArgValue(Args, OPT_resource_dir); // Add -I... and -F... options in order. diff --git a/lib/Frontend/DependencyFile.cpp b/lib/Frontend/DependencyFile.cpp index de2b056..14aee35 100644 --- a/lib/Frontend/DependencyFile.cpp +++ b/lib/Frontend/DependencyFile.cpp @@ -48,14 +48,15 @@ public: IncludeSystemHeaders(Opts.IncludeSystemHeaders), PhonyTarget(Opts.UsePhonyTargets) {} - ~DependencyFileCallback() { + virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason, + SrcMgr::CharacteristicKind FileType); + + virtual void EndOfMainFile() { OutputDependencyFile(); OS->flush(); delete OS; + OS = 0; } - - virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason, - SrcMgr::CharacteristicKind FileType); }; } diff --git a/lib/Frontend/FixItRewriter.cpp b/lib/Frontend/FixItRewriter.cpp index 0b04cf2..20d452e 100644 --- a/lib/Frontend/FixItRewriter.cpp +++ b/lib/Frontend/FixItRewriter.cpp @@ -93,7 +93,7 @@ void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel, // completely ignore it, even if it's an error: fix-it locations // are meant to perform specific fix-ups even in the presence of // other errors. - if (Info.getNumCodeModificationHints() == 0) + if (Info.getNumFixItHints() == 0) return; // See if the location of the error is one that matches what the @@ -122,10 +122,10 @@ void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel, // Make sure that we can perform all of the modifications we // in this diagnostic. - bool CanRewrite = Info.getNumCodeModificationHints() > 0; - for (unsigned Idx = 0, Last = Info.getNumCodeModificationHints(); + bool CanRewrite = Info.getNumFixItHints() > 0; + for (unsigned Idx = 0, Last = Info.getNumFixItHints(); Idx < Last; ++Idx) { - const CodeModificationHint &Hint = Info.getCodeModificationHint(Idx); + const FixItHint &Hint = Info.getFixItHint(Idx); if (Hint.RemoveRange.isValid() && Rewrite.getRangeSize(Hint.RemoveRange) == -1) { CanRewrite = false; @@ -140,7 +140,7 @@ void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel, } if (!CanRewrite) { - if (Info.getNumCodeModificationHints() > 0) + if (Info.getNumFixItHints() > 0) Diag(Info.getLocation(), diag::note_fixit_in_macro); // If this was an error, refuse to perform any rewriting. @@ -152,9 +152,9 @@ void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel, } bool Failed = false; - for (unsigned Idx = 0, Last = Info.getNumCodeModificationHints(); + for (unsigned Idx = 0, Last = Info.getNumFixItHints(); Idx < Last; ++Idx) { - const CodeModificationHint &Hint = Info.getCodeModificationHint(Idx); + const FixItHint &Hint = Info.getFixItHint(Idx); if (!Hint.RemoveRange.isValid()) { // We're adding code. if (Rewrite.InsertTextBefore(Hint.InsertionLoc, Hint.CodeToInsert)) diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index 66df7a6..110612d 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -169,6 +169,10 @@ void FrontendAction::EndSourceFile() { CI.setASTContext(0); } + // Inform the preprocessor we are done. + if (CI.hasPreprocessor()) + CI.getPreprocessor().EndSourceFile(); + if (CI.getFrontendOpts().ShowStats) { llvm::errs() << "\nSTATISTICS FOR '" << getCurrentFile() << "':\n"; CI.getPreprocessor().PrintStats(); diff --git a/lib/Frontend/HTMLDiagnostics.cpp b/lib/Frontend/HTMLDiagnostics.cpp index da99cb8..022a34d 100644 --- a/lib/Frontend/HTMLDiagnostics.cpp +++ b/lib/Frontend/HTMLDiagnostics.cpp @@ -484,8 +484,7 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID, // FIXME: This code is disabled because it seems to mangle the HTML // output. I'm leaving it here because it's generally the right idea, // but needs some help from someone more familiar with the rewriter. - for (const CodeModificationHint *Hint = P.code_modifications_begin(), - *HintEnd = P.code_modifications_end(); + for (const FixItHint *Hint = P.fixit_begin(), *HintEnd = P.fixit_end(); Hint != HintEnd; ++Hint) { if (Hint->RemoveRange.isValid()) { HighlightRange(R, LPosInfo.first, Hint->RemoveRange, diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp index cd749d2..9f5bced 100644 --- a/lib/Frontend/InitHeaderSearch.cpp +++ b/lib/Frontend/InitHeaderSearch.cpp @@ -82,7 +82,8 @@ public: /// AddDefaultSystemIncludePaths - Adds the default system include paths so /// that e.g. stdio.h is found. void AddDefaultSystemIncludePaths(const LangOptions &Lang, - const llvm::Triple &triple); + const llvm::Triple &triple, + bool UseStandardCXXIncludes); /// Realize - Merges all search path lists into one list and send it to /// HeaderSearch. @@ -594,8 +595,9 @@ void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths(const llvm::Triple &tripl } void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang, - const llvm::Triple &triple) { - if (Lang.CPlusPlus) + const llvm::Triple &triple, + bool UseStandardCXXIncludes) { + if (Lang.CPlusPlus && UseStandardCXXIncludes) AddDefaultCPlusPlusIncludePaths(triple); AddDefaultCIncludePaths(triple); @@ -765,7 +767,8 @@ void clang::ApplyHeaderSearchOptions(HeaderSearch &HS, } if (HSOpts.UseStandardIncludes) - Init.AddDefaultSystemIncludePaths(Lang, Triple); + Init.AddDefaultSystemIncludePaths(Lang, Triple, + HSOpts.UseStandardCXXIncludes); Init.Realize(); } diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index e659ff0..6d39952 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -905,11 +905,18 @@ PCHReader::PCHReadResult PCHReader::ReadSLocEntryRecord(unsigned ID) { return Failure; } - if (Record.size() < 8) { + if (Record.size() < 10) { Error("source location entry is incorrect"); return Failure; } + if ((off_t)Record[4] != File->getSize() || + (time_t)Record[5] != File->getModificationTime()) { + Diag(diag::err_fe_pch_file_modified) + << Filename; + return Failure; + } + FileID FID = SourceMgr.createFileID(File, SourceLocation::getFromRawEncoding(Record[1]), (SrcMgr::CharacteristicKind)Record[2], @@ -920,10 +927,10 @@ PCHReader::PCHReadResult PCHReader::ReadSLocEntryRecord(unsigned ID) { // Reconstruct header-search information for this file. HeaderFileInfo HFI; - HFI.isImport = Record[4]; - HFI.DirInfo = Record[5]; - HFI.NumIncludes = Record[6]; - HFI.ControllingMacroID = Record[7]; + HFI.isImport = Record[6]; + HFI.DirInfo = Record[7]; + HFI.NumIncludes = Record[8]; + HFI.ControllingMacroID = Record[9]; if (Listener) Listener->ReadHeaderFileInfo(HFI, File->getUID()); break; @@ -2068,20 +2075,21 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) { } case pch::TYPE_FUNCTION_NO_PROTO: { - if (Record.size() != 3) { + if (Record.size() != 4) { Error("incorrect encoding of no-proto function type"); return QualType(); } QualType ResultType = GetType(Record[0]); - return Context->getFunctionNoProtoType(ResultType, Record[1], - (CallingConv)Record[2]); + FunctionType::ExtInfo Info(Record[1], Record[2], (CallingConv)Record[3]); + return Context->getFunctionNoProtoType(ResultType, Info); } case pch::TYPE_FUNCTION_PROTO: { QualType ResultType = GetType(Record[0]); bool NoReturn = Record[1]; - CallingConv CallConv = (CallingConv)Record[2]; - unsigned Idx = 3; + unsigned RegParm = Record[2]; + CallingConv CallConv = (CallingConv)Record[3]; + unsigned Idx = 4; unsigned NumParams = Record[Idx++]; llvm::SmallVector<QualType, 16> ParamTypes; for (unsigned I = 0; I != NumParams; ++I) @@ -2097,7 +2105,9 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) { return Context->getFunctionType(ResultType, ParamTypes.data(), NumParams, isVariadic, Quals, hasExceptionSpec, hasAnyExceptionSpec, NumExceptions, - Exceptions.data(), NoReturn, CallConv); + Exceptions.data(), + FunctionType::ExtInfo(NoReturn, RegParm, + CallConv)); } case pch::TYPE_UNRESOLVED_USING: @@ -2341,7 +2351,7 @@ void TypeLocReader::VisitQualifiedNameTypeLoc(QualifiedNameTypeLoc TL) { void TypeLocReader::VisitInjectedClassNameTypeLoc(InjectedClassNameTypeLoc TL) { TL.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); } -void TypeLocReader::VisitTypenameTypeLoc(TypenameTypeLoc TL) { +void TypeLocReader::VisitDependentNameTypeLoc(DependentNameTypeLoc TL) { TL.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); } void TypeLocReader::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) { diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index 4752cd3..4dd8dc3 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -141,9 +141,11 @@ void PCHTypeWriter::VisitExtVectorType(const ExtVectorType *T) { void PCHTypeWriter::VisitFunctionType(const FunctionType *T) { Writer.AddTypeRef(T->getResultType(), Record); - Record.push_back(T->getNoReturnAttr()); + FunctionType::ExtInfo C = T->getExtInfo(); + Record.push_back(C.getNoReturn()); + Record.push_back(C.getRegParm()); // FIXME: need to stabilize encoding of calling convention... - Record.push_back(T->getCallConv()); + Record.push_back(C.getCC()); } void PCHTypeWriter::VisitFunctionNoProtoType(const FunctionNoProtoType *T) { @@ -404,7 +406,7 @@ void TypeLocWriter::VisitQualifiedNameTypeLoc(QualifiedNameTypeLoc TL) { void TypeLocWriter::VisitInjectedClassNameTypeLoc(InjectedClassNameTypeLoc TL) { Writer.AddSourceLocation(TL.getNameLoc(), Record); } -void TypeLocWriter::VisitTypenameTypeLoc(TypenameTypeLoc TL) { +void TypeLocWriter::VisitDependentNameTypeLoc(DependentNameTypeLoc TL) { Writer.AddSourceLocation(TL.getNameLoc(), Record); } void TypeLocWriter::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) { @@ -921,6 +923,9 @@ static unsigned CreateSLocFileAbbrev(llvm::BitstreamWriter &Stream) { Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Include location Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // Characteristic Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Line directives + // FileEntry fields. + Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 12)); // Size + Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 32)); // Modification time // HeaderFileInfo fields. Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isImport Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // DirInfo @@ -1063,6 +1068,10 @@ void PCHWriter::WriteSourceManagerBlock(SourceManager &SourceMgr, // The source location entry is a file. The blob associated // with this entry is the file name. + // Emit size/modification time for this file. + Record.push_back(Content->Entry->getSize()); + Record.push_back(Content->Entry->getModificationTime()); + // Emit header-search information associated with this file. HeaderFileInfo HFI; HeaderSearch &HS = PP.getHeaderSearchInfo(); diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp index 79aecce..cba9298 100644 --- a/lib/Frontend/RewriteObjC.cpp +++ b/lib/Frontend/RewriteObjC.cpp @@ -2262,8 +2262,8 @@ void RewriteObjC::SynthSelGetUidFunctionDecl() { QualType getFuncType = Context->getFunctionType(Context->getObjCSelType(), &ArgTys[0], ArgTys.size(), false /*isVariadic*/, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); SelGetUidFunctionDecl = FunctionDecl::Create(*Context, TUDecl, SourceLocation(), SelGetUidIdent, getFuncType, 0, @@ -2359,8 +2359,8 @@ void RewriteObjC::SynthSuperContructorFunctionDecl() { QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(), &ArgTys[0], ArgTys.size(), false, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); SuperContructorFunctionDecl = FunctionDecl::Create(*Context, TUDecl, SourceLocation(), msgSendIdent, msgSendType, 0, @@ -2380,8 +2380,8 @@ void RewriteObjC::SynthMsgSendFunctionDecl() { QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(), &ArgTys[0], ArgTys.size(), true /*isVariadic*/, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); MsgSendFunctionDecl = FunctionDecl::Create(*Context, TUDecl, SourceLocation(), msgSendIdent, msgSendType, 0, @@ -2404,8 +2404,8 @@ void RewriteObjC::SynthMsgSendSuperFunctionDecl() { QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(), &ArgTys[0], ArgTys.size(), true /*isVariadic*/, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); MsgSendSuperFunctionDecl = FunctionDecl::Create(*Context, TUDecl, SourceLocation(), msgSendIdent, msgSendType, 0, @@ -2425,8 +2425,8 @@ void RewriteObjC::SynthMsgSendStretFunctionDecl() { QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(), &ArgTys[0], ArgTys.size(), true /*isVariadic*/, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); MsgSendStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl, SourceLocation(), msgSendIdent, msgSendType, 0, @@ -2451,8 +2451,8 @@ void RewriteObjC::SynthMsgSendSuperStretFunctionDecl() { QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(), &ArgTys[0], ArgTys.size(), true /*isVariadic*/, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); MsgSendSuperStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl, SourceLocation(), msgSendIdent, msgSendType, 0, @@ -2472,8 +2472,8 @@ void RewriteObjC::SynthMsgSendFpretFunctionDecl() { QualType msgSendType = Context->getFunctionType(Context->DoubleTy, &ArgTys[0], ArgTys.size(), true /*isVariadic*/, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); MsgSendFpretFunctionDecl = FunctionDecl::Create(*Context, TUDecl, SourceLocation(), msgSendIdent, msgSendType, 0, @@ -2488,8 +2488,8 @@ void RewriteObjC::SynthGetClassFunctionDecl() { QualType getClassType = Context->getFunctionType(Context->getObjCIdType(), &ArgTys[0], ArgTys.size(), false /*isVariadic*/, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); GetClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl, SourceLocation(), getClassIdent, getClassType, 0, @@ -2505,8 +2505,8 @@ void RewriteObjC::SynthGetSuperClassFunctionDecl() { QualType getClassType = Context->getFunctionType(Context->getObjCClassType(), &ArgTys[0], ArgTys.size(), false /*isVariadic*/, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); GetSuperClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl, SourceLocation(), getSuperClassIdent, getClassType, 0, @@ -2521,8 +2521,8 @@ void RewriteObjC::SynthGetMetaClassFunctionDecl() { QualType getClassType = Context->getFunctionType(Context->getObjCIdType(), &ArgTys[0], ArgTys.size(), false /*isVariadic*/, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); GetMetaClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl, SourceLocation(), getClassIdent, getClassType, 0, @@ -2964,8 +2964,8 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp, &ArgTypes[0], ArgTypes.size(), // If we don't have a method decl, force a variadic cast. Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : true, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); castType = Context->getPointerType(castType); cast = NoTypeInfoCStyleCastExpr(Context, castType, CastExpr::CK_Unknown, cast); @@ -2995,8 +2995,8 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp, castType = Context->getFunctionType(returnType, &ArgTypes[0], ArgTypes.size(), Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : false, 0, - false, false, 0, 0, false, - CC_Default); + false, false, 0, 0, + FunctionType::ExtInfo()); castType = Context->getPointerType(castType); cast = NoTypeInfoCStyleCastExpr(Context, castType, CastExpr::CK_Unknown, cast); @@ -4547,7 +4547,7 @@ Stmt *RewriteObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp) { QualType PtrToFuncCastType = Context->getFunctionType(Exp->getType(), &ArgTypes[0], ArgTypes.size(), false/*no variadic*/, 0, false, false, 0, 0, - false, CC_Default); + FunctionType::ExtInfo()); PtrToFuncCastType = Context->getPointerType(PtrToFuncCastType); @@ -5673,4 +5673,3 @@ void RewriteObjC::HandleTranslationUnit(ASTContext &C) { } OutFile->flush(); } - diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp index 24d51e2..4e91f8d 100644 --- a/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/lib/Frontend/TextDiagnosticPrinter.cpp @@ -276,7 +276,7 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic(SourceLocation Loc, SourceRange *Ranges, unsigned NumRanges, SourceManager &SM, - const CodeModificationHint *Hints, + const FixItHint *Hints, unsigned NumHints, unsigned Columns) { assert(LangOpts && "Unexpected diagnostic outside source file processing"); @@ -409,7 +409,7 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic(SourceLocation Loc, std::string FixItInsertionLine; if (NumHints && DiagOpts->ShowFixits) { - for (const CodeModificationHint *Hint = Hints, *LastHint = Hints + NumHints; + for (const FixItHint *Hint = Hints, *LastHint = Hints + NumHints; Hint != LastHint; ++Hint) { if (Hint->InsertionLoc.isValid()) { // We have an insertion hint. Determine whether the inserted @@ -833,7 +833,7 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, if (DiagOpts->ShowCarets && Info.getLocation().isValid() && ((LastLoc != Info.getLocation()) || Info.getNumRanges() || (LastCaretDiagnosticWasNote && Level != Diagnostic::Note) || - Info.getNumCodeModificationHints())) { + Info.getNumFixItHints())) { // Cache the LastLoc, it allows us to omit duplicate source/caret spewage. LastLoc = Info.getLocation(); LastCaretDiagnosticWasNote = (Level == Diagnostic::Note); @@ -845,9 +845,9 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, for (unsigned i = 0; i != NumRanges; ++i) Ranges[i] = Info.getRange(i); - unsigned NumHints = Info.getNumCodeModificationHints(); + unsigned NumHints = Info.getNumFixItHints(); for (unsigned idx = 0; idx < NumHints; ++idx) { - const CodeModificationHint &Hint = Info.getCodeModificationHint(idx); + const FixItHint &Hint = Info.getFixItHint(idx); if (Hint.RemoveRange.isValid()) { assert(NumRanges < 20 && "Out of space"); Ranges[NumRanges++] = Hint.RemoveRange; @@ -855,8 +855,8 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, } EmitCaretDiagnostic(LastLoc, Ranges, NumRanges, LastLoc.getManager(), - Info.getCodeModificationHints(), - Info.getNumCodeModificationHints(), + Info.getFixItHints(), + Info.getNumFixItHints(), DiagOpts->MessageLength); } |