diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/ARCMigrate/ObjCMT.cpp | 6 | ||||
-rw-r--r-- | clang/lib/AST/TypeLoc.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Analysis/ThreadSafety.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Basic/SanitizerBlacklist.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CoverageMappingGen.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Frontend/DiagnosticRenderer.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Frontend/Rewrite/InclusionRewriter.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Frontend/TextDiagnostic.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/DeclSpec.cpp | 2 |
10 files changed, 15 insertions, 15 deletions
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index 921495824e0..1747dca0666 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -736,7 +736,7 @@ static bool rewriteToNSEnumDecl(const EnumDecl *EnumDcl, SourceLocation EndOfEnumDclLoc = EnumDcl->getLocEnd(); EndOfEnumDclLoc = trans::findSemiAfterLocation(EndOfEnumDclLoc, NS.getASTContext(), /*IsDecl*/true); - if (!EndOfEnumDclLoc.isInvalid()) { + if (EndOfEnumDclLoc.isValid()) { SourceRange EnumDclRange(EnumDcl->getLocStart(), EndOfEnumDclLoc); commit.insertFromRange(TypedefDcl->getLocStart(), EnumDclRange); } @@ -746,7 +746,7 @@ static bool rewriteToNSEnumDecl(const EnumDecl *EnumDcl, SourceLocation EndTypedefDclLoc = TypedefDcl->getLocEnd(); EndTypedefDclLoc = trans::findSemiAfterLocation(EndTypedefDclLoc, NS.getASTContext(), /*IsDecl*/true); - if (!EndTypedefDclLoc.isInvalid()) { + if (EndTypedefDclLoc.isValid()) { SourceRange TDRange(TypedefDcl->getLocStart(), EndTypedefDclLoc); commit.remove(TDRange); } @@ -755,7 +755,7 @@ static bool rewriteToNSEnumDecl(const EnumDecl *EnumDcl, EndOfEnumDclLoc = trans::findLocationAfterSemi(EnumDcl->getLocEnd(), NS.getASTContext(), /*IsDecl*/true); - if (!EndOfEnumDclLoc.isInvalid()) { + if (EndOfEnumDclLoc.isValid()) { SourceLocation BeginOfEnumDclLoc = EnumDcl->getLocStart(); // FIXME. This assumes that enum decl; is immediately preceded by eoln. // It is trying to remove the enum decl. lines entirely. diff --git a/clang/lib/AST/TypeLoc.cpp b/clang/lib/AST/TypeLoc.cpp index f7f7b05b38b..d08b07b2ccd 100644 --- a/clang/lib/AST/TypeLoc.cpp +++ b/clang/lib/AST/TypeLoc.cpp @@ -192,7 +192,7 @@ SourceLocation TypeLoc::getBeginLoc() const { Cur = Cur.getNextTypeLoc(); continue; default: - if (!Cur.getLocalSourceRange().getBegin().isInvalid()) + if (Cur.getLocalSourceRange().getBegin().isValid()) LeftMost = Cur; Cur = Cur.getNextTypeLoc(); if (Cur.isNull()) diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index 922b157a2ab..bce5175ece2 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -787,7 +787,7 @@ static void findBlockLocations(CFG *CFGraph, } } - if (!CurrBlockInfo->ExitLoc.isInvalid()) { + if (CurrBlockInfo->ExitLoc.isValid()) { // This block contains at least one statement. Find the source location // of the first statement in the block. for (CFGBlock::const_iterator BI = CurrBlock->begin(), diff --git a/clang/lib/Basic/SanitizerBlacklist.cpp b/clang/lib/Basic/SanitizerBlacklist.cpp index 095fcd6ccae..de78c94bc19 100644 --- a/clang/lib/Basic/SanitizerBlacklist.cpp +++ b/clang/lib/Basic/SanitizerBlacklist.cpp @@ -40,7 +40,7 @@ bool SanitizerBlacklist::isBlacklistedFile(StringRef FileName, bool SanitizerBlacklist::isBlacklistedLocation(SourceLocation Loc, StringRef Category) const { - return !Loc.isInvalid() && + return Loc.isValid() && isBlacklistedFile(SM.getFilename(SM.getFileLoc(Loc)), Category); } diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 647cf0bd6a6..9e9963cd192 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1281,7 +1281,7 @@ bool CodeGenModule::isInSanitizerBlacklist(llvm::Function *Fn, if (SanitizerBL.isBlacklistedFunction(Fn->getName())) return true; // Blacklist by location. - if (!Loc.isInvalid()) + if (Loc.isValid()) return SanitizerBL.isBlacklistedLocation(Loc); // If location is unknown, this may be a compiler-generated function. Assume // it's located in the main file. diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp index 1c7656fa349..3561a57aae4 100644 --- a/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -163,7 +163,7 @@ public: unsigned Depth = 0; for (SourceLocation Parent = getIncludeOrExpansionLoc(Loc); - !Parent.isInvalid(); Parent = getIncludeOrExpansionLoc(Parent)) + Parent.isValid(); Parent = getIncludeOrExpansionLoc(Parent)) ++Depth; FileLocs.push_back(std::make_pair(Loc, Depth)); } @@ -569,7 +569,7 @@ struct CounterCoverageMappingBuilder } void VisitStmt(const Stmt *S) { - if (!S->getLocStart().isInvalid()) + if (S->getLocStart().isValid()) extendRegion(S); for (const Stmt *Child : S->children()) if (Child) diff --git a/clang/lib/Frontend/DiagnosticRenderer.cpp b/clang/lib/Frontend/DiagnosticRenderer.cpp index 923d5e97c13..6ef9a89d86f 100644 --- a/clang/lib/Frontend/DiagnosticRenderer.cpp +++ b/clang/lib/Frontend/DiagnosticRenderer.cpp @@ -518,7 +518,7 @@ void DiagnosticRenderer::emitMacroExpansions(SourceLocation Loc, ArrayRef<CharSourceRange> Ranges, ArrayRef<FixItHint> Hints, const SourceManager &SM) { - assert(!Loc.isInvalid() && "must have a valid source location here"); + assert(Loc.isValid() && "must have a valid source location here"); // Produce a stack of macro backtraces. SmallVector<SourceLocation, 8> LocationStack; @@ -541,7 +541,7 @@ void DiagnosticRenderer::emitMacroExpansions(SourceLocation Loc, // backtraces. if (Loc.isFileID()) Loc = SM.getImmediateMacroCallerLoc(LocationStack.back()); - assert(!Loc.isInvalid() && "must have a valid source location here"); + assert(Loc.isValid() && "must have a valid source location here"); } LocationStack.erase(LocationStack.begin(), @@ -598,7 +598,7 @@ void DiagnosticNoteRenderer::emitImportLocation(SourceLocation Loc, SmallString<200> MessageStorage; llvm::raw_svector_ostream Message(MessageStorage); Message << "in module '" << ModuleName; - if (!PLoc.isInvalid()) + if (PLoc.isValid()) Message << "' imported from " << PLoc.getFilename() << ':' << PLoc.getLine(); Message << ":"; diff --git a/clang/lib/Frontend/Rewrite/InclusionRewriter.cpp b/clang/lib/Frontend/Rewrite/InclusionRewriter.cpp index 08d6cf1f92c..97baa720233 100644 --- a/clang/lib/Frontend/Rewrite/InclusionRewriter.cpp +++ b/clang/lib/Frontend/Rewrite/InclusionRewriter.cpp @@ -160,7 +160,7 @@ void InclusionRewriter::FileChanged(SourceLocation Loc, void InclusionRewriter::FileSkipped(const FileEntry &/*SkippedFile*/, const Token &/*FilenameTok*/, SrcMgr::CharacteristicKind /*FileType*/) { - assert(!LastInclusionLocation.isInvalid() && + assert(LastInclusionLocation.isValid() && "A file, that wasn't found via an inclusion directive, was skipped"); LastInclusionLocation = SourceLocation(); } diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp index ee24c3b1c58..d2dd192561b 100644 --- a/clang/lib/Frontend/TextDiagnostic.cpp +++ b/clang/lib/Frontend/TextDiagnostic.cpp @@ -1060,7 +1060,7 @@ void TextDiagnostic::emitSnippetAndCaret( SmallVectorImpl<CharSourceRange>& Ranges, ArrayRef<FixItHint> Hints, const SourceManager &SM) { - assert(!Loc.isInvalid() && "must have a valid source location here"); + assert(Loc.isValid() && "must have a valid source location here"); assert(Loc.isFileID() && "must have a file location here"); // If caret diagnostics are enabled and we have location, we want to diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp index 2cf35b9d280..05ec5d4abc4 100644 --- a/clang/lib/Sema/DeclSpec.cpp +++ b/clang/lib/Sema/DeclSpec.cpp @@ -952,7 +952,7 @@ void DeclSpec::Finish(DiagnosticsEngine &D, Preprocessor &PP, const PrintingPoli FixItHint Hints[NumLocs]; SourceLocation FirstLoc; for (unsigned I = 0; I != NumLocs; ++I) { - if (!ExtraLocs[I].isInvalid()) { + if (ExtraLocs[I].isValid()) { if (FirstLoc.isInvalid() || PP.getSourceManager().isBeforeInTranslationUnit(ExtraLocs[I], FirstLoc)) |