================
@@ -34,6 +34,23 @@ namespace clang {
SemaAMDGPU::SemaAMDGPU(Sema &S) : SemaBase(S) {}
+bool SemaAMDGPU::checkBuiltinRequiredTargetFeatures(
+ unsigned BuiltinID, CallExpr *TheCall,
+ const llvm::StringMap<bool> &CallerFeatureMap) {
+ ASTContext &Ctx = getASTContext();
+ StringRef FeatureList(Ctx.BuiltinInfo.getRequiredFeatures(BuiltinID));
+ if (Builtin::evaluateRequiredTargetFeatures(FeatureList, CallerFeatureMap))
+ return false;
+
+ const FunctionDecl *BuiltinDecl = TheCall->getDirectCallee();
+ Diag(TheCall->getBeginLoc(), diag::err_builtin_needs_feature)
+ << (BuiltinDecl ? BuiltinDecl->getDeclName()
+ : DeclarationName(&Ctx.Idents.get(
----------------
Fznamznon wrote:
If we can always just get the function name from `ASTContext` using `BuiltinID`
why don't we always do that instead of using `CallExpr`?
https://github.com/llvm/llvm-project/pull/218358
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits