[llvm-commits] [gcc-plugin] r76739 - in /gcc-plugin/trunk: bits_and_bobs.cpp gcc-patches/extern-c.diff i386/llvm-i386.cpp llvm-abi.h llvm-backend.cpp llvm-cache.h llvm-convert.cpp llvm-debug.cpp llvm-debug.h llvm-internal.h llvm-types.cpp

Duncan Sands baldrick at free.fr
Wed Jul 22 08:31:32 PDT 2009


Author: baldrick
Date: Wed Jul 22 10:31:21 2009
New Revision: 76739

URL: http://llvm.org/viewvc/llvm-project?rev=76739&view=rev
Log:
Remove the need to add 'extern "C"' wrappers inside
gcc headers by wrapping the inclusions of gcc headers
in 'extern "C"' instead, and preventively including
gmp.h beforehand instead (gcc headers include gmp.h,
which includes C++ headers if compiling with g++, so
normally you get templates etc with C linkage, causing
the compiler to barf, if you wrap the inclusion in
'extern "C"'; but by including gmp.h earlier, directly
from the C++, it doesn't get processed again when the
gcc headers include it - this trick was suggested by
Diego Novillo).

Removed:
    gcc-plugin/trunk/gcc-patches/extern-c.diff
Modified:
    gcc-plugin/trunk/bits_and_bobs.cpp
    gcc-plugin/trunk/i386/llvm-i386.cpp
    gcc-plugin/trunk/llvm-abi.h
    gcc-plugin/trunk/llvm-backend.cpp
    gcc-plugin/trunk/llvm-cache.h
    gcc-plugin/trunk/llvm-convert.cpp
    gcc-plugin/trunk/llvm-debug.cpp
    gcc-plugin/trunk/llvm-debug.h
    gcc-plugin/trunk/llvm-internal.h
    gcc-plugin/trunk/llvm-types.cpp

Modified: gcc-plugin/trunk/bits_and_bobs.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/bits_and_bobs.cpp?rev=76739&r1=76738&r2=76739&view=diff

==============================================================================
--- gcc-plugin/trunk/bits_and_bobs.cpp (original)
+++ gcc-plugin/trunk/bits_and_bobs.cpp Wed Jul 22 10:31:21 2009
@@ -2,16 +2,19 @@
 #include "llvm/Constant.h"
 #include "llvm/Value.h"
 
+// System headers
+#include <gmp.h>
+
 // GCC headers
 #undef VISIBILITY_HIDDEN
 
-#include "config.h"
 extern "C" {
+#include "config.h"
 #include "system.h"
-}
 #include "coretypes.h"
 #include "target.h"
 #include "tree.h"
+}
 
 using namespace llvm;
 

Removed: gcc-plugin/trunk/gcc-patches/extern-c.diff
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/gcc-patches/extern-c.diff?rev=76738&view=auto

==============================================================================
--- gcc-plugin/trunk/gcc-patches/extern-c.diff (original)
+++ gcc-plugin/trunk/gcc-patches/extern-c.diff (removed)
@@ -1,536 +0,0 @@
-Index: gcc.fsf.master/gcc/flags.h
-===================================================================
---- gcc.fsf.master.orig/gcc/flags.h	2009-07-20 07:06:07.888082273 +0200
-+++ gcc.fsf.master/gcc/flags.h	2009-07-20 07:06:41.568127963 +0200
-@@ -26,6 +26,10 @@
- #include "options.h"
- #include "real.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- enum debug_info_type
- {
-   NO_DEBUG,	    /* Write no debug info.  */
-@@ -401,4 +405,8 @@
- /* Whether to emit an overflow warning whose code is C.  */
- #define issue_strict_overflow_warning(c) (warn_strict_overflow >= (int) (c))
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* ! GCC_FLAGS_H */
-Index: gcc.fsf.master/gcc/opth-gen.awk
-===================================================================
---- gcc.fsf.master.orig/gcc/opth-gen.awk	2009-07-20 07:03:59.825100430 +0200
-+++ gcc.fsf.master/gcc/opth-gen.awk	2009-07-20 07:06:41.572076368 +0200
-@@ -66,6 +66,10 @@
- print "#ifndef OPTIONS_H"
- print "#define OPTIONS_H"
- print ""
-+print "#ifdef __cplusplus"
-+print "extern \"C\" {"
-+print "#endif /* __cplusplus */"
-+print ""
- print "extern int target_flags;"
- print "extern int target_flags_explicit;"
- print ""
-@@ -365,5 +369,9 @@
- print "  N_OPTS"
- print "};"
- print ""
-+print "#ifdef __cplusplus"
-+print "}"
-+print "#endif /* __cplusplus */"
-+print ""
- print "#endif /* OPTIONS_H */"
- }
-Index: gcc.fsf.master/gcc/tree.h
-===================================================================
---- gcc.fsf.master.orig/gcc/tree.h	2009-07-20 07:06:07.960172997 +0200
-+++ gcc.fsf.master/gcc/tree.h	2009-07-20 07:06:41.576076736 +0200
-@@ -31,6 +31,10 @@
- #include "alias.h"
- #include "options.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- /* Codes of tree nodes */
- 
- #define DEFTREECODE(SYM, STRING, TYPE, NARGS)   SYM,
-@@ -5344,4 +5348,8 @@
-   for ((arg) = first_const_call_expr_arg ((call), &(iter)); (arg);	\
-        (arg) = next_const_call_expr_arg (&(iter)))
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif  /* GCC_TREE_H  */
-Index: gcc.fsf.master/gcc/tree-flow.h
-===================================================================
---- gcc.fsf.master.orig/gcc/tree-flow.h	2009-07-20 07:04:00.009074849 +0200
-+++ gcc.fsf.master/gcc/tree-flow.h	2009-07-20 07:06:41.576076736 +0200
-@@ -32,6 +32,10 @@
- #include "ipa-reference.h"
- #include "tree-ssa-alias.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- 
- /* Gimple dataflow datastructure. All publicly available fields shall have
-    gimple_ accessor defined in tree-flow-inline.h, all publicly modifiable
-@@ -920,4 +924,8 @@
- int least_common_multiple (int, int);
- edge redirect_eh_edge (edge e, basic_block new_bb);
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* _TREE_FLOW_H  */
-Index: gcc.fsf.master/gcc/gimple.h
-===================================================================
---- gcc.fsf.master.orig/gcc/gimple.h	2009-07-20 07:06:08.300077288 +0200
-+++ gcc.fsf.master/gcc/gimple.h	2009-07-20 07:06:41.580076966 +0200
-@@ -30,6 +30,10 @@
- #include "basic-block.h"
- #include "tree-ssa-operands.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- DEF_VEC_P(gimple);
- DEF_VEC_ALLOC_P(gimple,heap);
- DEF_VEC_ALLOC_P(gimple,gc);
-@@ -4485,4 +4489,8 @@
- 
- extern void dump_gimple_statistics (void);
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif  /* GCC_GIMPLE_H */
-Index: gcc.fsf.master/gcc/configure
-===================================================================
---- gcc.fsf.master.orig/gcc/configure	2009-07-20 07:04:00.253070167 +0200
-+++ gcc.fsf.master/gcc/configure	2009-07-20 07:06:41.592072275 +0200
-@@ -13982,6 +13982,10 @@
- cat > plugin-version.h <<EOF
- #include "configargs.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- static char basever[] = "$gcc_BASEVER";
- static char datestamp[] = "$gcc_DATESTAMP";
- static char devphase[] = "$gcc_DEVPHASE";
-@@ -13993,6 +13997,10 @@
- static struct plugin_gcc_version gcc_version = {basever, datestamp,
- 						devphase, revision,
- 						configuration_arguments};
-+
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
- EOF
- 
- # Internationalization
-Index: gcc.fsf.master/gcc/configure.ac
-===================================================================
---- gcc.fsf.master.orig/gcc/configure.ac	2009-07-20 07:03:59.781102378 +0200
-+++ gcc.fsf.master/gcc/configure.ac	2009-07-20 07:06:41.592072275 +0200
-@@ -1521,6 +1521,10 @@
- cat > plugin-version.h <<EOF
- #include "configargs.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- static char basever[] = "$gcc_BASEVER";
- static char datestamp[] = "$gcc_DATESTAMP";
- static char devphase[] = "$gcc_DEVPHASE";
-@@ -1532,6 +1536,10 @@
- static struct plugin_gcc_version gcc_version = {basever, datestamp,
- 						devphase, revision,
- 						configuration_arguments};
-+
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
- EOF
- changequote([,])dnl
- 
-Index: gcc.fsf.master/gcc/coretypes.h
-===================================================================
---- gcc.fsf.master.orig/gcc/coretypes.h	2009-07-20 07:04:00.261070835 +0200
-+++ gcc.fsf.master/gcc/coretypes.h	2009-07-20 07:06:41.592072275 +0200
-@@ -37,6 +37,10 @@
- #ifndef GCC_CORETYPES_H
- #define GCC_CORETYPES_H
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- #ifndef GTY
- #define GTY(x)  /* nothing - marker for gengtype */
- #endif
-@@ -117,5 +121,8 @@
- 
- #endif
- 
--#endif /* coretypes.h */
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
- 
-+#endif /* coretypes.h */
-Index: gcc.fsf.master/gcc/gcc-plugin.h
-===================================================================
---- gcc.fsf.master.orig/gcc/gcc-plugin.h	2009-07-20 07:03:59.909072554 +0200
-+++ gcc.fsf.master/gcc/gcc-plugin.h	2009-07-20 07:06:41.592072275 +0200
-@@ -27,6 +27,10 @@
- #include "config.h"
- #include "system.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- /* Event names.  Keep in sync with plugin_event_name[].  */
- enum plugin_event
- {
-@@ -153,4 +157,8 @@
-                                plugin_callback_func callback,
-                                void *user_data);
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* GCC_PLUGIN_H */
-Index: gcc.fsf.master/gcc/target.h
-===================================================================
---- gcc.fsf.master.orig/gcc/target.h	2009-07-20 07:04:00.097102020 +0200
-+++ gcc.fsf.master/gcc/target.h	2009-07-20 07:06:41.592072275 +0200
-@@ -52,6 +52,10 @@
- #include "tm.h"
- #include "insn-modes.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- /* Types used by the record_gcc_switches() target function.  */
- typedef enum
- {
-@@ -1149,4 +1153,8 @@
- /* Each target can provide their own.  */
- extern struct gcc_targetcm targetcm;
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* GCC_TARGET_H */
-Index: gcc.fsf.master/gcc/toplev.h
-===================================================================
---- gcc.fsf.master.orig/gcc/toplev.h	2009-07-20 07:04:00.021070366 +0200
-+++ gcc.fsf.master/gcc/toplev.h	2009-07-20 07:06:41.592072275 +0200
-@@ -23,6 +23,10 @@
- #include "input.h"
- #include "bversion.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- /* If non-NULL, return one past-the-end of the matching SUBPART of
-    the WHOLE string.  */
- #define skip_leading_substring(whole,  part) \
-@@ -216,4 +220,8 @@
- extern const char *get_random_seed (bool);
- extern const char *set_random_seed (const char *);
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* ! GCC_TOPLEV_H */
-Index: gcc.fsf.master/gcc/tree-pass.h
-===================================================================
---- gcc.fsf.master.orig/gcc/tree-pass.h	2009-07-20 07:06:07.980077199 +0200
-+++ gcc.fsf.master/gcc/tree-pass.h	2009-07-20 07:06:41.592072275 +0200
-@@ -25,6 +25,10 @@
- 
- #include "timevar.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- /* Different tree dump places.  When you add new tree dump places,
-    extend the DUMP_FILES array in tree-dump.c.  */
- enum tree_dump_index
-@@ -549,4 +553,8 @@
-    directly in jump threading, and avoid peeling them next time.  */
- extern bool first_pass_instance;
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* GCC_TREE_PASS_H */
-Index: gcc.fsf.master/gcc/rtl.h
-===================================================================
---- gcc.fsf.master.orig/gcc/rtl.h	2009-07-20 07:04:00.113072835 +0200
-+++ gcc.fsf.master/gcc/rtl.h	2009-07-20 07:06:41.592072275 +0200
-@@ -30,6 +30,10 @@
- #include "fixed-value.h"
- #include "alias.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- #undef FFS  /* Some systems predefine this symbol; don't let it interfere.  */
- #undef FLOAT /* Likewise.  */
- #undef ABS /* Likewise.  */
-@@ -2375,4 +2379,8 @@
- extern bool optimize_insn_for_size_p (void);
- extern bool optimize_insn_for_speed_p (void);
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* ! GCC_RTL_H */
-Index: gcc.fsf.master/gcc/genflags.c
-===================================================================
---- gcc.fsf.master.orig/gcc/genflags.c	2009-07-20 07:04:00.025070804 +0200
-+++ gcc.fsf.master/gcc/genflags.c	2009-07-20 07:06:41.596071945 +0200
-@@ -268,6 +268,9 @@
-   puts ("   from the machine description file `md'.  */\n");
-   puts ("#ifndef GCC_INSN_FLAGS_H");
-   puts ("#define GCC_INSN_FLAGS_H\n");
-+  puts ("#ifdef __cplusplus");
-+  puts ("extern \"C\" {");
-+  puts ("#endif /* __cplusplus */\n");
- 
-   /* Read the machine description.  */
- 
-@@ -290,7 +293,10 @@
-   for (insn_ptr = insns; *insn_ptr; insn_ptr++)
-     gen_proto (*insn_ptr);
- 
--  puts("\n#endif /* GCC_INSN_FLAGS_H */");
-+  puts ("\n#ifdef __cplusplus");
-+  puts ("}");
-+  puts ("#endif /* __cplusplus */\n");
-+  puts ("#endif /* GCC_INSN_FLAGS_H */");
- 
-   if (have_error || ferror (stdout) || fflush (stdout) || fclose (stdout))
-     return FATAL_EXIT_CODE;
-Index: gcc.fsf.master/gcc/genpreds.c
-===================================================================
---- gcc.fsf.master.orig/gcc/genpreds.c	2009-07-20 07:03:59.809073113 +0200
-+++ gcc.fsf.master/gcc/genpreds.c	2009-07-20 07:06:41.596071945 +0200
-@@ -1257,6 +1257,8 @@
- \n\
- #ifdef HAVE_MACHINE_MODES");
- 
-+  puts ("\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n");
-+
-   FOR_ALL_PREDICATES (p)
-     printf ("extern int %s (rtx, enum machine_mode);\n", p->name);
- 
-@@ -1317,6 +1319,8 @@
- 	puts ("#define EXTRA_ADDRESS_CONSTRAINT(c_,s_) false\n");
-     }
- 
-+  puts ("#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n");
-+
-   puts ("#endif /* tm-preds.h */");
- }
- 
-Index: gcc.fsf.master/gcc/input.h
-===================================================================
---- gcc.fsf.master.orig/gcc/input.h	2009-07-20 07:04:00.013091770 +0200
-+++ gcc.fsf.master/gcc/input.h	2009-07-20 07:06:41.596071945 +0200
-@@ -24,6 +24,10 @@
- 
- #include "line-map.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- extern GTY(()) struct line_maps *line_table;
- 
- /* A value which will never be used to represent a real location.  */
-@@ -65,4 +69,8 @@
- #define in_system_header_at(LOC) ((expand_location (LOC)).sysp != 0)
- #define in_system_header (in_system_header_at (input_location))
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif
-Index: gcc.fsf.master/gcc/output.h
-===================================================================
---- gcc.fsf.master.orig/gcc/output.h	2009-07-20 07:03:59.873072659 +0200
-+++ gcc.fsf.master/gcc/output.h	2009-07-20 07:06:41.596071945 +0200
-@@ -22,6 +22,10 @@
- #ifndef GCC_OUTPUT_H
- #define GCC_OUTPUT_H
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- /* Initialize data in final at the beginning of a compilation.  */
- extern void init_final (const char *);
- 
-@@ -654,4 +658,8 @@
- 
- #endif
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* ! GCC_OUTPUT_H */
-Index: gcc.fsf.master/gcc/machmode.h
-===================================================================
---- gcc.fsf.master.orig/gcc/machmode.h	2009-07-20 07:04:00.065101936 +0200
-+++ gcc.fsf.master/gcc/machmode.h	2009-07-20 07:06:41.596071945 +0200
-@@ -23,6 +23,12 @@
- 
- /* Make an enum class that gives all the machine modes.  */
- #include "insn-modes.h"
-+/* Mode classes.  */
-+#include "mode-classes.def"
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
- 
- /* Get the name of mode MODE as a string.  */
- 
-@@ -270,4 +276,8 @@
- /* Target-dependent machine mode initialization - in insn-modes.c.  */
- extern void init_adjust_machine_modes (void);
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* not HAVE_MACHINE_MODES */
-Index: gcc.fsf.master/gcc/real.h
-===================================================================
---- gcc.fsf.master.orig/gcc/real.h	2009-07-20 07:06:07.996076507 +0200
-+++ gcc.fsf.master/gcc/real.h	2009-07-20 07:06:41.596071945 +0200
-@@ -33,6 +33,10 @@
- #endif
- #include "machmode.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- /* An expanded form of the represented number.  */
- 
- /* Enumerate the special cases of numbers that we encounter.  */
-@@ -489,4 +493,9 @@
-    number, (1 - b**-p) * b**emax for a given FP format FMT as a hex
-    float string.  BUF must be large enough to contain the result.  */
- extern void get_max_float (const struct real_format *, char *, size_t);
-+
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* ! GCC_REAL_H */
-Index: gcc.fsf.master/gcc/vec.h
-===================================================================
---- gcc.fsf.master.orig/gcc/vec.h	2009-07-20 07:03:59.861072460 +0200
-+++ gcc.fsf.master/gcc/vec.h	2009-07-20 07:06:41.596071945 +0200
-@@ -21,6 +21,10 @@
- #ifndef GCC_VEC_H
- #define GCC_VEC_H
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- /* The macros here implement a set of templated vector types and
-    associated interfaces.  These templates are implemented with
-    macros, as we're not in C++ land.  The interface functions are
-@@ -1278,4 +1282,8 @@
-   return ((VEC(T,stack) *) vec_stack_p_reserve_exact_1 (alloc_, space);   \
- }
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* GCC_VEC_H */
-Index: gcc.fsf.master/gcc/diagnostic.h
-===================================================================
---- gcc.fsf.master.orig/gcc/diagnostic.h	2009-07-20 07:03:59.841073131 +0200
-+++ gcc.fsf.master/gcc/diagnostic.h	2009-07-20 07:06:41.596071945 +0200
-@@ -25,6 +25,10 @@
- #include "pretty-print.h"
- #include "options.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- /* Constants used to discriminate diagnostics.  */
- typedef enum
- {
-@@ -239,4 +243,8 @@
- extern void print_gimple_expr (FILE *, gimple, int, int);
- extern void dump_gimple_stmt (pretty_printer *, gimple, int, int);
- 
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
- #endif /* ! GCC_DIAGNOSTIC_H */
-Index: gcc.fsf.master/gcc/except.h
-===================================================================
---- gcc.fsf.master.orig/gcc/except.h	2009-07-20 07:03:59.793103415 +0200
-+++ gcc.fsf.master/gcc/except.h	2009-07-20 07:06:41.596071945 +0200
-@@ -22,6 +22,10 @@
- #include "sbitmap.h"
- #include "vecprim.h"
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- struct function;
- 
- /* The type of an exception region.  */
-@@ -277,3 +281,7 @@
- extern bitmap must_not_throw_labels (void);
- extern struct eh_region_d *redirect_eh_edge_to_label (struct edge_def *, tree, bool, bool, int);
- extern int get_next_region_sharing_label (int);
-+
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */

Modified: gcc-plugin/trunk/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/i386/llvm-i386.cpp?rev=76739&r1=76738&r2=76739&view=diff

==============================================================================
--- gcc-plugin/trunk/i386/llvm-i386.cpp (original)
+++ gcc-plugin/trunk/i386/llvm-i386.cpp Wed Jul 22 10:31:21 2009
@@ -30,17 +30,20 @@
 #include "llvm/LLVMContext.h"
 #include "llvm/Module.h"
 
+// System headers
+#include <gmp.h>
+
 // GCC headers
 #undef VISIBILITY_HIDDEN
 
-#include "config.h"
 extern "C" {
+#include "config.h"
 #include "system.h"
-}
 #include "coretypes.h"
 #include "target.h"
 #include "toplev.h"
 #include "tree.h"
+}
 
 // Plugin headers
 #include "llvm-abi.h"

Modified: gcc-plugin/trunk/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-abi.h?rev=76739&r1=76738&r2=76739&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-abi.h (original)
+++ gcc-plugin/trunk/llvm-abi.h Wed Jul 22 10:31:21 2009
@@ -28,16 +28,18 @@
 #ifndef LLVM_ABI_H
 #define LLVM_ABI_H
 
-#include "llvm-internal.h"
-#include "llvm-target.h"
+// LLVM headers
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Attributes.h"
 #include "llvm/Target/TargetData.h"
 
-namespace llvm {
-  class BasicBlock;
-}
+// System headers
+#include <gmp.h>
+
+// GCC headers
+#undef VISIBILITY_HIDDEN
+
 extern "C" {
 #include "config.h"
 #include "system.h"
@@ -46,6 +48,14 @@
 #include "tree.h"
 }  
 
+// Plugin headers
+#include "llvm-internal.h"
+#include "llvm-target.h"
+
+namespace llvm {
+  class BasicBlock;
+}
+
 /// DefaultABIClient - This is a simple implementation of the ABI client
 /// interface that can be subclassed.
 struct DefaultABIClient {

Modified: gcc-plugin/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=76739&r1=76738&r2=76739&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-backend.cpp (original)
+++ gcc-plugin/trunk/llvm-backend.cpp Wed Jul 22 10:31:21 2009
@@ -53,14 +53,14 @@
 
 // System headers
 #include <cassert>
+#include <gmp.h>
 
 // GCC headers
 #undef VISIBILITY_HIDDEN
 
-#include "config.h"
 extern "C" {
+#include "config.h"
 #include "system.h"
-}
 #include "coretypes.h"
 #include "target.h"
 #include "tree.h"
@@ -70,9 +70,7 @@
 #include "flags.h"
 #include "function.h"
 #include "gcc-plugin.h"
-extern "C" {
 #include "intl.h"
-}
 #include "langhooks.h"
 #include "output.h"
 #include "params.h"
@@ -82,6 +80,7 @@
 #include "tree-inline.h"
 #include "tree-flow.h"
 #include "tree-pass.h"
+}
 
 // Plugin headers
 #include "llvm-internal.h"

Modified: gcc-plugin/trunk/llvm-cache.h
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-cache.h?rev=76739&r1=76738&r2=76739&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-cache.h (original)
+++ gcc-plugin/trunk/llvm-cache.h Wed Jul 22 10:31:21 2009
@@ -35,10 +35,6 @@
 #include "target.h"
 #include "tree.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 struct GTY(()) tree_llvm_map {
   struct tree_map_base base;
   const void *val;
@@ -53,8 +49,4 @@
 
 extern void llvm_init_cache (void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
 #endif /* LLVM_CACHE_H */

Modified: gcc-plugin/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=76739&r1=76738&r2=76739&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-convert.cpp (original)
+++ gcc-plugin/trunk/llvm-convert.cpp Wed Jul 22 10:31:21 2009
@@ -44,15 +44,15 @@
 #include "llvm/ADT/DenseMap.h"
 
 // System headers
+#include <gmp.h>
 #include <iostream>
 
 // GCC headers
 #undef VISIBILITY_HIDDEN
 
-#include "config.h"
 extern "C" {
+#include "config.h"
 #include "system.h"
-}
 #include "coretypes.h"
 #include "target.h"
 #include "tree.h"
@@ -72,7 +72,7 @@
 #include "libfuncs.h"
 #include "tree-flow.h"
 #include "rtl.h"
-extern "C" {
+
 extern int get_pointer_alignment (tree exp, unsigned int max_align);
 extern enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
 }

Modified: gcc-plugin/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-debug.cpp?rev=76739&r1=76738&r2=76739&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-debug.cpp (original)
+++ gcc-plugin/trunk/llvm-debug.cpp Wed Jul 22 10:31:21 2009
@@ -35,13 +35,15 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/SmallVector.h"
 
+// System headers
+#include <gmp.h>
+
 // GCC headers
 #undef VISIBILITY_HIDDEN
 
-#include "config.h"
 extern "C" {
+#include "config.h"
 #include "system.h"
-}
 #include "coretypes.h"
 #include "target.h"
 #include "tree.h"
@@ -50,6 +52,7 @@
 #include "langhooks.h"
 #include "toplev.h"
 #include "version.h"
+}
 
 // Plugin headers
 #include "llvm-abi.h"

Modified: gcc-plugin/trunk/llvm-debug.h
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-debug.h?rev=76739&r1=76738&r2=76739&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-debug.h (original)
+++ gcc-plugin/trunk/llvm-debug.h Wed Jul 22 10:31:21 2009
@@ -27,9 +27,11 @@
 #ifndef LLVM_DEBUG_H
 #define LLVM_DEBUG_H
 
+// LLVM headers
 #include "llvm/Analysis/DebugInfo.h"
 #include "llvm/Support/Dwarf.h"
 
+// System headers
 #include <string>
 #include <map>
 #include <vector>

Modified: gcc-plugin/trunk/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=76739&r1=76738&r2=76739&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-internal.h (original)
+++ gcc-plugin/trunk/llvm-internal.h Wed Jul 22 10:31:21 2009
@@ -27,10 +27,7 @@
 #ifndef LLVM_INTERNAL_H
 #define LLVM_INTERNAL_H
 
-#include <vector>
-#include <cassert>
-#include <map>
-#include <string>
+// LLVM headers
 #include "llvm/Intrinsics.h"
 #include "llvm/ADT/IndexedMap.h"
 #include "llvm/ADT/SmallVector.h"
@@ -41,6 +38,12 @@
 #include "llvm/Support/Streams.h"
 #include "llvm/Support/TargetFolder.h"
 
+// System headers
+#include <vector>
+#include <cassert>
+#include <map>
+#include <string>
+
 namespace llvm {
   class Module;
   class GlobalVariable;

Modified: gcc-plugin/trunk/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-types.cpp?rev=76739&r1=76738&r2=76739&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-types.cpp (original)
+++ gcc-plugin/trunk/llvm-types.cpp Wed Jul 22 10:31:21 2009
@@ -37,21 +37,24 @@
 #include "llvm/Support/raw_ostream.h"
 
 // System headers
+#include <gmp.h>
 #include <map>
 
 // GCC headers
 #undef VISIBILITY_HIDDEN
 
-#include "config.h"
 extern "C" {
+#include "config.h"
 #include "system.h"
-}
 #include "coretypes.h"
 #include "tree.h"
+}
 
 // Plugin headers
 #include "llvm-abi.h"
+extern "C" {
 #include "llvm-cache.h"
+}
 #include "bits_and_bobs.h"
 
 static LLVMContext &Context = getGlobalContext();





More information about the llvm-commits mailing list