Mercurial > hg > CbC > CbC_llvm
changeset 159:cbec8b90714d
tweak...
author | anatofuz |
---|---|
date | Tue, 17 Mar 2020 17:39:02 +0900 |
parents | bd617681647f |
children | dbfec6499728 |
files | clang/lib/Lex/PPDirectives.cpp clang/lib/Parse/ParseCbC.cpp |
diffstat | 2 files changed, 15 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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 <FileEntryRef> 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; }
--- 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<CorrectionCandidateCallback> clone() override { + return std::make_unique<CastExpressionIdValidator>(*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<FieldDecl>()) return !candidate.getCorrectionSpecifier() || isa<ObjCIvarDecl>(FD); if (NextToken.is(tok::equal)) @@ -70,6 +74,10 @@ return CorrectionCandidateCallback::ValidateCandidate(candidate); } + std::unique_ptr<CorrectionCandidateCallback> clone() override { + return std::make_unique<StatementFilterCCC>(*this); + } + private: Token NextToken; };