================
@@ -1490,33 +1490,15 @@ bool StdLibraryFunctionsChecker::evalCall(const
CallEvent &Call,
llvm_unreachable("Unknown invalidation kind!");
}
-/// Returns whether the signatures should match based on the restrict
-/// qualifier.
-/// The "restrict" keyword is illegal in C++, however, many libc
-/// implementations use the "__restrict" compiler intrinsic in functions
-/// prototypes. The "__restrict" keyword qualifies a type as a restricted type
-/// even in C++.
-/// In case of any non-C99 languages, we don't want to match based on the
-/// restrict qualifier because we cannot know if the given libc implementation
-/// qualifies the paramter type or not.
-/// The Microsoft C runtime (e.g. UCRT) omits the restrict qualifiers of the
-/// standard prototypes even in C99 and later, so we don't match based on the
-/// restrict qualifier when targeting the MSVC environment either.
-static bool isRestrictSignificant(const ASTContext &ACtx) {
- return ACtx.getLangOpts().C99 &&
- !ACtx.getTargetInfo().getTriple().isWindowsMSVCEnvironment();
-}
-
bool StdLibraryFunctionsChecker::Signature::matches(
const FunctionDecl *FD) const {
assert(!isInvalid());
// Check the number of arguments.
if (FD->param_size() != ArgTys.size())
return false;
- auto RemoveRestrict = [&FD](QualType T) {
- if (!isRestrictSignificant(FD->getASTContext()))
- T.removeLocalRestrict();
+ auto RemoveRestrict = [](QualType T) {
+ T.removeLocalRestrict();
----------------
necto wrote:
The top-level `restrict` qualifier should be exposed by the
`.getCanonicalType()` so a `typedef` should not be an issue. In any case, this
change preserves the pre-existing `RemoveRestrict` mechanism, and only applies
it more broadly.
https://github.com/llvm/llvm-project/pull/238383
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits