[llvm] f791049 - [Intrinsic] Delete tablegen rules of llvm.{sig, }{setjmp, longjmp}
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 27 18:04:46 PST 2019
Author: Fangrui Song
Date: 2019-12-27T18:04:39-08:00
New Revision: f7910496c83eb785c12cde3139f21b34cf72f78e
URL: https://github.com/llvm/llvm-project/commit/f7910496c83eb785c12cde3139f21b34cf72f78e
DIFF: https://github.com/llvm/llvm-project/commit/f7910496c83eb785c12cde3139f21b34cf72f78e.diff
LOG: [Intrinsic] Delete tablegen rules of llvm.{sig,}{setjmp,longjmp}
Added:
Modified:
llvm/include/llvm/IR/Intrinsics.td
llvm/utils/TableGen/IntrinsicEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td
index 914c605bada3..90cac9759c76 100644
--- a/llvm/include/llvm/IR/Intrinsics.td
+++ b/llvm/include/llvm/IR/Intrinsics.td
@@ -582,12 +582,6 @@ def int_maximum : Intrinsic<[llvm_anyfloat_ty],
[IntrNoMem, IntrSpeculatable, IntrWillReturn, Commutative]
>;
-// NOTE: these are internal interfaces.
-def int_setjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>;
-def int_longjmp : Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrNoReturn]>;
-def int_sigsetjmp : Intrinsic<[llvm_i32_ty] , [llvm_ptr_ty, llvm_i32_ty]>;
-def int_siglongjmp : Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrNoReturn]>;
-
// Internal interface for object size checking
def int_objectsize : Intrinsic<[llvm_anyint_ty],
[llvm_anyptr_ty, llvm_i1_ty,
diff --git a/llvm/utils/TableGen/IntrinsicEmitter.cpp b/llvm/utils/TableGen/IntrinsicEmitter.cpp
index 08002365736f..9a12571ac6bc 100644
--- a/llvm/utils/TableGen/IntrinsicEmitter.cpp
+++ b/llvm/utils/TableGen/IntrinsicEmitter.cpp
@@ -39,8 +39,6 @@ class IntrinsicEmitter {
void run(raw_ostream &OS, bool Enums);
- void EmitPrefix(raw_ostream &OS);
-
void EmitEnumInfo(const CodeGenIntrinsicTable &Ints, raw_ostream &OS);
void EmitTargetInfo(const CodeGenIntrinsicTable &Ints, raw_ostream &OS);
void EmitIntrinsicToNameTable(const CodeGenIntrinsicTable &Ints,
@@ -51,7 +49,6 @@ class IntrinsicEmitter {
void EmitAttributes(const CodeGenIntrinsicTable &Ints, raw_ostream &OS);
void EmitIntrinsicToBuiltinMap(const CodeGenIntrinsicTable &Ints, bool IsGCC,
raw_ostream &OS);
- void EmitSuffix(raw_ostream &OS);
};
} // End anonymous namespace
@@ -68,8 +65,6 @@ void IntrinsicEmitter::run(raw_ostream &OS, bool Enums) {
// Emit the enum information.
EmitEnumInfo(Ints, OS);
} else {
- EmitPrefix(OS);
-
// Emit the target metadata.
EmitTargetInfo(Ints, OS);
@@ -90,29 +85,9 @@ void IntrinsicEmitter::run(raw_ostream &OS, bool Enums) {
// Emit code to translate MS builtins into LLVM intrinsics.
EmitIntrinsicToBuiltinMap(Ints, false, OS);
-
- EmitSuffix(OS);
}
}
-void IntrinsicEmitter::EmitPrefix(raw_ostream &OS) {
- OS << "// VisualStudio defines setjmp as _setjmp\n"
- "#if defined(_MSC_VER) && defined(setjmp) && \\\n"
- " !defined(setjmp_undefined_for_msvc)\n"
- "# pragma push_macro(\"setjmp\")\n"
- "# undef setjmp\n"
- "# define setjmp_undefined_for_msvc\n"
- "#endif\n\n";
-}
-
-void IntrinsicEmitter::EmitSuffix(raw_ostream &OS) {
- OS << "#if defined(_MSC_VER) && defined(setjmp_undefined_for_msvc)\n"
- "// let's return it to _setjmp state\n"
- "# pragma pop_macro(\"setjmp\")\n"
- "# undef setjmp_undefined_for_msvc\n"
- "#endif\n\n";
-}
-
void IntrinsicEmitter::EmitEnumInfo(const CodeGenIntrinsicTable &Ints,
raw_ostream &OS) {
// Find the TargetSet for which to generate enums. There will be an initial
@@ -143,8 +118,6 @@ void IntrinsicEmitter::EmitEnumInfo(const CodeGenIntrinsicTable &Ints,
OS << "namespace llvm {\n";
OS << "namespace Intrinsic {\n";
OS << "enum " << UpperPrefix << "Intrinsics : unsigned {\n";
- } else {
- EmitPrefix(OS);
}
OS << "// Enum values for intrinsics\n";
@@ -165,7 +138,6 @@ void IntrinsicEmitter::EmitEnumInfo(const CodeGenIntrinsicTable &Ints,
// Emit num_intrinsics into the target neutral enum.
if (IntrinsicPrefix.empty()) {
OS << " num_intrinsics = " << (Ints.size() + 1) << "\n";
- EmitSuffix(OS);
} else {
OS << "}; // enum\n";
OS << "} // namespace Intrinsic\n";
More information about the llvm-commits
mailing list