From 908a831a9a1fb043bc4758d6712d78255099ae51 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 27 May 2012 18:28:35 +0000 Subject: move some code around so that Verifier.cpp can get access to the intrinsic info table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157540 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/IntrinsicEmitter.cpp | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) (limited to 'utils') diff --git a/utils/TableGen/IntrinsicEmitter.cpp b/utils/TableGen/IntrinsicEmitter.cpp index 6578a5b8be..9c024a4981 100644 --- a/utils/TableGen/IntrinsicEmitter.cpp +++ b/utils/TableGen/IntrinsicEmitter.cpp @@ -310,7 +310,7 @@ void IntrinsicEmitter::EmitVerifier(const std::vector &Ints, } -// NOTE: This must be kept in synch with the version emitted to the .gen file! +// NOTE: This must be kept in synch with the copy in lib/VMCore/Function.cpp! enum IIT_Info { // Common values should be encoded with 0-15. IIT_Done = 0, @@ -481,38 +481,6 @@ void printIITEntry(raw_ostream &OS, unsigned char X) { void IntrinsicEmitter::EmitGenerator(const std::vector &Ints, raw_ostream &OS) { - OS << "// Global intrinsic function declaration type table.\n"; - OS << "#ifdef GET_INTRINSIC_GENERATOR_GLOBAL\n"; - // NOTE: These enums must be kept in sync with the ones above! - OS << "enum IIT_Info {\n"; - OS << " IIT_Done = 0,\n"; - OS << " IIT_I1 = 1,\n"; - OS << " IIT_I8 = 2,\n"; - OS << " IIT_I16 = 3,\n"; - OS << " IIT_I32 = 4,\n"; - OS << " IIT_I64 = 5,\n"; - OS << " IIT_F32 = 6,\n"; - OS << " IIT_F64 = 7,\n"; - OS << " IIT_V2 = 8,\n"; - OS << " IIT_V4 = 9,\n"; - OS << " IIT_V8 = 10,\n"; - OS << " IIT_V16 = 11,\n"; - OS << " IIT_V32 = 12,\n"; - OS << " IIT_MMX = 13,\n"; - OS << " IIT_PTR = 14,\n"; - OS << " IIT_ARG = 15,\n"; - OS << " IIT_METADATA = 16,\n"; - OS << " IIT_EMPTYSTRUCT = 17,\n"; - OS << " IIT_STRUCT2 = 18,\n"; - OS << " IIT_STRUCT3 = 19,\n"; - OS << " IIT_STRUCT4 = 20,\n"; - OS << " IIT_STRUCT5 = 21,\n"; - OS << " IIT_EXTEND_VEC_ARG = 22,\n"; - OS << " IIT_TRUNC_VEC_ARG = 23,\n"; - OS << " IIT_ANYPTR = 24\n"; - OS << "};\n\n"; - - // If we can compute a 32-bit fixed encoding for this intrinsic, do so and // capture it in this vector, otherwise store a ~0U. std::vector FixedEncodings; @@ -558,6 +526,9 @@ void IntrinsicEmitter::EmitGenerator(const std::vector &Ints, LongEncodingTable.layout(); + OS << "// Global intrinsic function declaration type table.\n"; + OS << "#ifdef GET_INTRINSIC_GENERATOR_GLOBAL\n"; + OS << "static const unsigned IIT_Table[] = {\n "; for (unsigned i = 0, e = FixedEncodings.size(); i != e; ++i) { -- cgit v1.2.3-18-g5258