-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
creduce: Update to 2.10.0.r110.g31e855e
- Loading branch information
Showing
2 changed files
with
111 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- creduce/clang_delta/ExpressionDetector.cpp 2024-11-13 22:04:35.755591600 +0100 | ||
+++ creduce/clang_delta/ExpressionDetector.cpp 2024-11-13 22:01:03.336578100 +0100 | ||
@@ -64,7 +64,8 @@ | ||
StringRef FileName, bool IsAngled, | ||
CharSourceRange FilenameRange, OptionalFileEntryRef File, | ||
StringRef SearchPath, StringRef RelativePath, | ||
- const Module *Imported, | ||
+ const Module *SuggestedModule, | ||
+ bool ModuleImported, | ||
SrcMgr::CharacteristicKind FileType) override; | ||
|
||
private: | ||
@@ -85,7 +86,8 @@ | ||
OptionalFileEntryRef /*File*/, | ||
StringRef /*SearchPath*/, | ||
StringRef /*RelativePath*/, | ||
- const Module * /*Imported*/, | ||
+ const Module * /*SuggestedModule*/, | ||
+ bool /*ModuleImported*/, | ||
SrcMgr::CharacteristicKind /*FileType*/) | ||
{ | ||
if (!SrcManager.isInMainFile(HashLoc)) | ||
@@ -118,7 +120,7 @@ | ||
const VarDecl *VD = dyn_cast<VarDecl>(DRE->getDecl()); | ||
if (!VD) | ||
return true; | ||
- if (VD->getName().startswith(Prefix)) | ||
+ if (VD->getName().starts_with(Prefix)) | ||
TmpVars.push_back(VD); | ||
return true; | ||
} | ||
@@ -363,7 +365,7 @@ | ||
{ | ||
if (!VD) | ||
return; | ||
- if (!VD->getName().startswith(TmpVarNamePrefix)) | ||
+ if (!VD->getName().starts_with(TmpVarNamePrefix)) | ||
return; | ||
if (const Expr *E = VD->getInit()) | ||
ProcessedExprs[VD] = E->IgnoreParenImpCasts(); | ||
@@ -374,9 +376,9 @@ | ||
StringRef Name = ND->getName(); | ||
// We don't want to repeatly replace temporary variables | ||
// __creduce_expr_tmp_xxx, __creduce_printed_yy and __creduce_checked_zzz. | ||
- return Name.startswith(TmpVarNamePrefix) || | ||
- Name.startswith(PrintedVarNamePrefix) || | ||
- Name.startswith(CheckedVarNamePrefix); | ||
+ return Name.starts_with(TmpVarNamePrefix) || | ||
+ Name.starts_with(PrintedVarNamePrefix) || | ||
+ Name.starts_with(CheckedVarNamePrefix); | ||
} | ||
|
||
// Reference: IdenticalExprChecker.cpp from Clang | ||
@@ -524,8 +526,8 @@ | ||
if (const DeclRefExpr *SubE = | ||
dyn_cast<DeclRefExpr>(UO->getSubExpr()->IgnoreParenCasts())) { | ||
StringRef SubEName = SubE->getDecl()->getName(); | ||
- if (SubEName.startswith(PrintedVarNamePrefix) || | ||
- SubEName.startswith(CheckedVarNamePrefix)) | ||
+ if (SubEName.starts_with(PrintedVarNamePrefix) || | ||
+ SubEName.starts_with(CheckedVarNamePrefix)) | ||
return false; | ||
} | ||
} | ||
@@ -541,7 +543,7 @@ | ||
bool IsLit = SC == Stmt::IntegerLiteralClass || | ||
SC == Stmt::FloatingLiteralClass; | ||
if (IsLit && DRE && | ||
- DRE->getDecl()->getName().startswith(TmpVarNamePrefix) && | ||
+ DRE->getDecl()->getName().starts_with(TmpVarNamePrefix) && | ||
S->getStmtClass() == Stmt::IfStmtClass) { | ||
return false; | ||
} | ||
diff -Nur creduce/clang_delta/RemoveNamespace.cpp creduce/clang_delta/RemoveNamespace.cpp | ||
--- creduce/clang_delta/RemoveNamespace.cpp 2024-11-13 22:04:35.771339900 +0100 | ||
+++ creduce/clang_delta/RemoveNamespace.cpp 2024-11-13 21:55:02.235178400 +0100 | ||
@@ -944,7 +944,7 @@ | ||
TransAssert(IdInfo && "Invalid IdentifierInfo!"); | ||
NewName += IdInfo->getName(); | ||
// Make sure we have valid suffix for user literals | ||
- if (IsUserLiteral && IdInfo->getName().startswith("_")) { | ||
+ if (IsUserLiteral && IdInfo->getName().starts_with("_")) { | ||
NewName = "_" + NewName; | ||
} | ||
NamedDeclToNewName[ND] = NewName; | ||
diff -Nur creduce/clang_delta/RenameCXXMethod.cpp creduce/clang_delta/RenameCXXMethod.cpp | ||
--- creduce/clang_delta/RenameCXXMethod.cpp 2024-11-13 22:04:35.787084600 +0100 | ||
+++ creduce/clang_delta/RenameCXXMethod.cpp 2024-11-13 22:03:22.949186100 +0100 | ||
@@ -426,7 +426,7 @@ | ||
{ | ||
size_t PrefixLen = MethodNamePrefix.length(); | ||
StringRef NamePrefix = Name.substr(0, PrefixLen); | ||
- if (!NamePrefix.equals(MethodNamePrefix)) | ||
+ if (NamePrefix != MethodNamePrefix) | ||
return false; | ||
llvm::APInt Num; | ||
return !Name.drop_front(PrefixLen).getAsInteger(10, Num); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters