[llvm-commits] [dragonegg] r133396 - /dragonegg/trunk/src/Convert.cpp
Duncan Sands
baldrick at free.fr
Sun Jun 19 09:19:16 PDT 2011
Author: baldrick
Date: Sun Jun 19 11:19:16 2011
New Revision: 133396
URL: http://llvm.org/viewvc/llvm-project?rev=133396&view=rev
Log:
Hack to access reg_raw_mode from gcc-4.6. The correct solution is to
have GCC install the regs.h header as a plugin header.
Modified:
dragonegg/trunk/src/Convert.cpp
Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=133396&r1=133395&r2=133396&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Sun Jun 19 11:19:16 2011
@@ -60,7 +60,19 @@
#include "tree-flow.h"
#include "tree-pass.h"
+#if (GCC_MINOR < 6)
extern enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
+#else
+// TODO: Submit a GCC patch to install "regs.h" as a plugin header.
+struct target_regs {
+ unsigned char x_hard_regno_nregs[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
+ enum machine_mode x_reg_raw_mode[FIRST_PSEUDO_REGISTER];
+};
+
+extern struct target_regs default_target_regs;
+
+#define reg_raw_mode (default_target_regs.x_reg_raw_mode)
+#endif
}
static LLVMContext &Context = getGlobalContext();
More information about the llvm-commits
mailing list