# HG changeset patch # User anatofuz # Date 1584434342 -32400 # Node ID cbec8b90714dbd9aef80176c5f50f2febf71ceb8 # Parent bd617681647f903b3f1ac1b23dc706e270aecd67 tweak... diff -r bd617681647f -r cbec8b90714d clang/lib/Lex/PPDirectives.cpp --- a/clang/lib/Lex/PPDirectives.cpp Tue Mar 17 16:35:46 2020 +0900 +++ b/clang/lib/Lex/PPDirectives.cpp Tue Mar 17 17:39:02 2020 +0900 @@ -3117,7 +3117,7 @@ const int Len = strlen(Name); const DirectoryLookup *LookupFrom = 0; Token FilenameTok; - FilenameTok.setKind(tok::angle_string_literal); + FilenameTok.setKind(tok::string_literal); FilenameTok.setLocation(Loc); FilenameTok.setLength(Len); FilenameTok.setLiteralData(Name); @@ -3127,18 +3127,18 @@ const DirectoryLookup *CurDir; bool IsMapped = false; ModuleMap::KnownHeader SuggestedModule; - const FileEntry *File = LookupFile(Loc, Filename, isAngled, LookupFrom, nullptr, CurDir, nullptr, nullptr, - &SuggestedModule, &IsMapped); + Optional File = LookupFile(Loc, Filename, isAngled, LookupFrom, nullptr, CurDir, nullptr, nullptr, + &SuggestedModule, &IsMapped, nullptr); if (File == 0) { Diag(FilenameTok, diag::err_pp_file_not_found) << Filename; // setjmp.h was not found } - SrcMgr::CharacteristicKind FileCharacter = std::max(HeaderInfo.getFileDirFlavor(File), SourceMgr.getFileCharacteristic(Loc)); + SrcMgr::CharacteristicKind FileCharacter = std::max(HeaderInfo.getFileDirFlavor(&File->getFleEntry()), SourceMgr.getFileCharacteristic(Loc)); if (!HeaderInfo.ShouldEnterIncludeFile(*this, File, false, false, SuggestedModule.getModule())) { return false; } - FileID FID = SourceMgr.createFileID(File, Loc, FileCharacter); + FileID FID = SourceMgr.createFileID(*File, Loc, FileCharacter); EnterSourceFile(FID, CurDir, FilenameTok.getLocation()); return true; } diff -r bd617681647f -r cbec8b90714d clang/lib/Parse/ParseCbC.cpp --- a/clang/lib/Parse/ParseCbC.cpp Tue Mar 17 16:35:46 2020 +0900 +++ b/clang/lib/Parse/ParseCbC.cpp Tue Mar 17 17:39:02 2020 +0900 @@ -30,7 +30,7 @@ WantTypeSpecifiers = AllowTypes; } - virtual bool ValidateCandidate(const TypoCorrection &candidate) { + bool ValidateCandidate(const TypoCorrection &candidate) override { NamedDecl *ND = candidate.getCorrectionDecl(); if (!ND) return candidate.isKeyword(); @@ -40,6 +40,10 @@ return AllowNonTypes; } + std::unique_ptr clone() override { + return std::make_unique(*this); + } + private: bool AllowNonTypes; }; @@ -59,7 +63,7 @@ WantCXXNamedCasts = false; } - virtual bool ValidateCandidate(const TypoCorrection &candidate) { + bool ValidateCandidate(const TypoCorrection &candidate) override { if (FieldDecl *FD = candidate.getCorrectionDeclAs()) return !candidate.getCorrectionSpecifier() || isa(FD); if (NextToken.is(tok::equal)) @@ -70,6 +74,10 @@ return CorrectionCandidateCallback::ValidateCandidate(candidate); } + std::unique_ptr clone() override { + return std::make_unique(*this); + } + private: Token NextToken; };