[clang] eb9cd80 - [Clang][TableGen] Add Features to TargetBuiltin
via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 9 04:28:37 PST 2024
Author: Wang Pengcheng
Date: 2024-02-09T20:28:34+08:00
New Revision: eb9cd800b3c8c787f75c00e7d9de3ae6a2e5f876
URL: https://github.com/llvm/llvm-project/commit/eb9cd800b3c8c787f75c00e7d9de3ae6a2e5f876
DIFF: https://github.com/llvm/llvm-project/commit/eb9cd800b3c8c787f75c00e7d9de3ae6a2e5f876.diff
LOG: [Clang][TableGen] Add Features to TargetBuiltin
RISCV target will use this parameter, so we need a way to specify
it.
Reviewers: AaronBallman, philnik777
Reviewed By: AaronBallman
Pull Request: https://github.com/llvm/llvm-project/pull/80279
Added:
Modified:
clang/include/clang/Basic/BuiltinsBase.td
clang/utils/TableGen/ClangBuiltinsEmitter.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/BuiltinsBase.td b/clang/include/clang/Basic/BuiltinsBase.td
index b65b41be03265..bfccff5600ddb 100644
--- a/clang/include/clang/Basic/BuiltinsBase.td
+++ b/clang/include/clang/Basic/BuiltinsBase.td
@@ -87,7 +87,9 @@ class CustomEntry {
}
class AtomicBuiltin : Builtin;
-class TargetBuiltin : Builtin;
+class TargetBuiltin : Builtin {
+ string Features = "";
+}
class LibBuiltin<string header, string languages = "ALL_LANGUAGES"> : Builtin {
string Header = header;
diff --git a/clang/utils/TableGen/ClangBuiltinsEmitter.cpp b/clang/utils/TableGen/ClangBuiltinsEmitter.cpp
index dc10fa14c5959..48f55b8af97e4 100644
--- a/clang/utils/TableGen/ClangBuiltinsEmitter.cpp
+++ b/clang/utils/TableGen/ClangBuiltinsEmitter.cpp
@@ -219,7 +219,7 @@ void EmitBuiltinDef(llvm::raw_ostream &OS, StringRef Substitution,
break;
}
case BuiltinType::TargetBuiltin:
- OS << ", \"\"";
+ OS << ", \"" << Builtin->getValueAsString("Features") << "\"";
break;
case BuiltinType::AtomicBuiltin:
case BuiltinType::Builtin:
More information about the cfe-commits
mailing list