[clang] [clang] Add __has_feature(swiftcc) that checks whether the target supports the Swift calling convention (PR #72159)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 13 13:10:05 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Kuba (Brecka) Mracek (kubamracek)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/72159.diff
1 Files Affected:
- (modified) clang/include/clang/Basic/Features.def (+3)
``````````diff
diff --git a/clang/include/clang/Basic/Features.def b/clang/include/clang/Basic/Features.def
index da77aee8de36990..f69d52a0c24f88e 100644
--- a/clang/include/clang/Basic/Features.def
+++ b/clang/include/clang/Basic/Features.def
@@ -99,6 +99,9 @@ FEATURE(memory_sanitizer,
FEATURE(thread_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Thread))
FEATURE(dataflow_sanitizer, LangOpts.Sanitize.has(SanitizerKind::DataFlow))
FEATURE(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo))
+FEATURE(swiftcc,
+ PP.getTargetInfo().checkCallingConvention(CC_Swift) ==
+ clang::TargetInfo::CCCR_OK)
FEATURE(swiftasynccc,
PP.getTargetInfo().checkCallingConvention(CC_SwiftAsync) ==
clang::TargetInfo::CCCR_OK)
``````````
</details>
https://github.com/llvm/llvm-project/pull/72159
More information about the cfe-commits
mailing list