mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-20 08:51:04 +00:00
Bug 1814134 - Fix clang plugin to build with recent clang trunk. r=firefox-build-system-reviewers,ahochheiden
Clang trunk recently removed Optional (replaced with std::optional). Differential Revision: https://phabricator.services.mozilla.com/D168406
This commit is contained in:
parent
2fe409322f
commit
1248412d66
@ -113,7 +113,7 @@ bool MustReturnFromCallerChecker::immediatelyReturns(
|
||||
}
|
||||
|
||||
for (size_t I = FromIdx; I < Block->size(); ++I) {
|
||||
Optional<CFGStmt> S = (*Block)[I].getAs<CFGStmt>();
|
||||
auto S = (*Block)[I].getAs<CFGStmt>();
|
||||
if (!S) {
|
||||
continue;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
: Context(TheContext) {
|
||||
for (const auto *B : *TheCFG) {
|
||||
for (size_t I = 0; I < B->size(); ++I) {
|
||||
if (Optional<CFGStmt> S = (*B)[I].getAs<CFGStmt>()) {
|
||||
if (auto S = (*B)[I].getAs<CFGStmt>()) {
|
||||
Map[S->getStmt()] = std::make_pair(B, I);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ std::vector<const Stmt *> getUsageAsRvalue(const ValueDecl *ValueDeclaration,
|
||||
for (auto &Block : *StatementCFG) {
|
||||
// We iterate through all the statements of the block.
|
||||
for (auto &BlockItem : *Block) {
|
||||
Optional<CFGStmt> CFGStatement = BlockItem.getAs<CFGStmt>();
|
||||
auto CFGStatement = BlockItem.getAs<CFGStmt>();
|
||||
if (!CFGStatement) {
|
||||
continue;
|
||||
}
|
||||
|
@ -37,7 +37,11 @@ void NonStdMoveChecker::registerMatchers(MatchFinder *AstMatcher) {
|
||||
this);
|
||||
}
|
||||
|
||||
#if CLANG_VERSION_FULL >= 1600
|
||||
std::optional<FixItHint>
|
||||
#else
|
||||
Optional<FixItHint>
|
||||
#endif
|
||||
NonStdMoveChecker::makeFixItHint(const MatchFinder::MatchResult &Result,
|
||||
const Expr *const TargetExpr) {
|
||||
const auto *MaterializeExpr = Result.Nodes.getNodeAs<Expr>(kMaterializeExpr);
|
||||
|
@ -17,7 +17,12 @@ public:
|
||||
private:
|
||||
CompilerInstance *CI;
|
||||
|
||||
static Optional<FixItHint>
|
||||
static
|
||||
#if CLANG_VERSION_FULL >= 1600
|
||||
std::optional<FixItHint>
|
||||
#else
|
||||
Optional<FixItHint>
|
||||
#endif
|
||||
makeFixItHint(const MatchFinder::MatchResult &Result, const Expr *TargetExpr);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user