[llvm-commits] [llvm] r57636 - in /llvm/trunk/tools/llvmc2: Makefile doc/LLVMC-Reference.rst plugins/Base/Makefile plugins/Base/PluginMain.cpp plugins/Clang/Makefile plugins/Clang/PluginMain.cpp plugins/Makefile plugins/Simple/Makefile plugins/Simple/PluginMain.cpp plugins/Simple/Simple.td

Mikhail Glushenkov foldr at codedgers.com
Thu Oct 16 07:02:30 PDT 2008


Author: foldr
Date: Thu Oct 16 09:02:29 2008
New Revision: 57636

URL: http://llvm.org/viewvc/llvm-project?rev=57636&view=rev
Log:
Re-apply Makefile changes. Fix build with srcdir != objdir.

Added:
    llvm/trunk/tools/llvmc2/plugins/Base/PluginMain.cpp
    llvm/trunk/tools/llvmc2/plugins/Clang/PluginMain.cpp
    llvm/trunk/tools/llvmc2/plugins/Simple/Makefile
      - copied, changed from r57635, llvm/trunk/tools/llvmc2/plugins/Base/Makefile
    llvm/trunk/tools/llvmc2/plugins/Simple/PluginMain.cpp
    llvm/trunk/tools/llvmc2/plugins/Simple/Simple.td
Modified:
    llvm/trunk/tools/llvmc2/Makefile
    llvm/trunk/tools/llvmc2/doc/LLVMC-Reference.rst
    llvm/trunk/tools/llvmc2/plugins/Base/Makefile
    llvm/trunk/tools/llvmc2/plugins/Clang/Makefile
    llvm/trunk/tools/llvmc2/plugins/Makefile

Modified: llvm/trunk/tools/llvmc2/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/Makefile?rev=57636&r1=57635&r2=57636&view=diff

==============================================================================
--- llvm/trunk/tools/llvmc2/Makefile (original)
+++ llvm/trunk/tools/llvmc2/Makefile Thu Oct 16 09:02:29 2008
@@ -9,11 +9,9 @@
 
 LEVEL = ../..
 
-##### FIXME: Does not work when objdir != srcdir
-#####BUILTIN_PLUGINS = Base
-
+BUILTIN_PLUGINS = Base
 DRIVER_NAME = llvmc2
-DIRS = plugins driver 
+DIRS = plugins driver
 
 export BUILTIN_PLUGINS
 export DRIVER_NAME

Modified: llvm/trunk/tools/llvmc2/doc/LLVMC-Reference.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/doc/LLVMC-Reference.rst?rev=57636&r1=57635&r2=57636&view=diff

==============================================================================
--- llvm/trunk/tools/llvmc2/doc/LLVMC-Reference.rst (original)
+++ llvm/trunk/tools/llvmc2/doc/LLVMC-Reference.rst Thu Oct 16 09:02:29 2008
@@ -121,7 +121,7 @@
 
    $ mv Simple.td MyPlugin.td
 
-Note that the plugin source directory should be placed into
+Note that the plugin source directory should be placed under
 ``$LLVMC_DIR/plugins`` to make use of the existing build
 infrastructure. To build a version of the LLVMC executable called
 ``mydriver`` with your plugin compiled in, use the following command::

Modified: llvm/trunk/tools/llvmc2/plugins/Base/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/plugins/Base/Makefile?rev=57636&r1=57635&r2=57636&view=diff

==============================================================================
--- llvm/trunk/tools/llvmc2/plugins/Base/Makefile (original)
+++ llvm/trunk/tools/llvmc2/plugins/Base/Makefile Thu Oct 16 09:02:29 2008
@@ -8,5 +8,6 @@
 ##===----------------------------------------------------------------------===##
 
 LLVMC_PLUGIN = Base
+BUILT_SOURCES = AutoGenerated.inc
 
 include ../Makefile

Added: llvm/trunk/tools/llvmc2/plugins/Base/PluginMain.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/plugins/Base/PluginMain.cpp?rev=57636&view=auto

==============================================================================
--- llvm/trunk/tools/llvmc2/plugins/Base/PluginMain.cpp (added)
+++ llvm/trunk/tools/llvmc2/plugins/Base/PluginMain.cpp Thu Oct 16 09:02:29 2008
@@ -0,0 +1 @@
+#include "AutoGenerated.inc"

Modified: llvm/trunk/tools/llvmc2/plugins/Clang/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/plugins/Clang/Makefile?rev=57636&r1=57635&r2=57636&view=diff

==============================================================================
--- llvm/trunk/tools/llvmc2/plugins/Clang/Makefile (original)
+++ llvm/trunk/tools/llvmc2/plugins/Clang/Makefile Thu Oct 16 09:02:29 2008
@@ -8,6 +8,7 @@
 ##===----------------------------------------------------------------------===##
 
 LLVMC_PLUGIN = Clang
+BUILT_SOURCES = AutoGenerated.inc
 
 include ../Makefile
 

Added: llvm/trunk/tools/llvmc2/plugins/Clang/PluginMain.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/plugins/Clang/PluginMain.cpp?rev=57636&view=auto

==============================================================================
--- llvm/trunk/tools/llvmc2/plugins/Clang/PluginMain.cpp (added)
+++ llvm/trunk/tools/llvmc2/plugins/Clang/PluginMain.cpp Thu Oct 16 09:02:29 2008
@@ -0,0 +1 @@
+#include "AutoGenerated.inc"

Modified: llvm/trunk/tools/llvmc2/plugins/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/plugins/Makefile?rev=57636&r1=57635&r2=57636&view=diff

==============================================================================
--- llvm/trunk/tools/llvmc2/plugins/Makefile (original)
+++ llvm/trunk/tools/llvmc2/plugins/Makefile Thu Oct 16 09:02:29 2008
@@ -12,8 +12,7 @@
 LEVEL = ../../..
 DIRS = $(BUILTIN_PLUGINS)
 
-# TOFIX: DSO versions of plugins are not built
-
+# TOFIX: Should we also build DSO versions of plugins?
 export BUILTIN_LLVMC_PLUGIN=1
 
 include $(LEVEL)/Makefile.common
@@ -22,25 +21,27 @@
 
 LEVEL = ../../../..
 
-LIBRARYNAME = $(patsubst %,LLVMC%,$(LLVMC_PLUGIN))
-TOOLS_SOURCE = $(wildcard $(PROJ_SRC_DIR)/*.td)
+LIBRARYNAME := $(patsubst %,LLVMC%,$(LLVMC_PLUGIN))
 REQUIRES_EH = 1
 
 ifndef BUILTIN_LLVMC_PLUGIN
 LOADABLE_MODULE = 1
 endif
 
-ifneq ($(TOOLS_SOURCE),"")
+ifneq ($(BUILT_SOURCES),)
 BUILD_AUTOGENERATED_INC=1
-BUILT_SOURCES = AutoGenerated.inc
 endif
 
 include $(LEVEL)/Makefile.common
 
-# TOFIX: This should go into Makefile.rules
+# TOFIX: This probably should go into Makefile.rules
 
 ifdef BUILD_AUTOGENERATED_INC
-TD_COMMON = $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td)
+
+TOOLS_SOURCE := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td))
+
+TD_COMMON :=$(strip $(wildcard \
+		$(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td))
 
 $(ObjDir)/AutoGenerated.inc.tmp: $(TOOLS_SOURCE) $(ObjDir)/.dir \
 				$(TBLGEN) $(TD_COMMON)

Copied: llvm/trunk/tools/llvmc2/plugins/Simple/Makefile (from r57635, llvm/trunk/tools/llvmc2/plugins/Base/Makefile)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/plugins/Simple/Makefile?p2=llvm/trunk/tools/llvmc2/plugins/Simple/Makefile&p1=llvm/trunk/tools/llvmc2/plugins/Base/Makefile&r1=57635&r2=57636&rev=57636&view=diff

==============================================================================
--- llvm/trunk/tools/llvmc2/plugins/Base/Makefile (original)
+++ llvm/trunk/tools/llvmc2/plugins/Simple/Makefile Thu Oct 16 09:02:29 2008
@@ -1,4 +1,4 @@
-##===- tools/llvmc2/plugins/Base/Makefile ------------------*- Makefile -*-===##
+##===- tools/llvmc2/plugins/Simple/Makefile ------------------*- Makefile -*-===##
 #
 #                     The LLVM Compiler Infrastructure
 #
@@ -7,6 +7,7 @@
 #
 ##===----------------------------------------------------------------------===##
 
-LLVMC_PLUGIN = Base
+LLVMC_PLUGIN = Simple
+BUILT_SOURCES = AutoGenerated.inc
 
 include ../Makefile

Added: llvm/trunk/tools/llvmc2/plugins/Simple/PluginMain.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/plugins/Simple/PluginMain.cpp?rev=57636&view=auto

==============================================================================
--- llvm/trunk/tools/llvmc2/plugins/Simple/PluginMain.cpp (added)
+++ llvm/trunk/tools/llvmc2/plugins/Simple/PluginMain.cpp Thu Oct 16 09:02:29 2008
@@ -0,0 +1 @@
+#include "AutoGenerated.inc"

Added: llvm/trunk/tools/llvmc2/plugins/Simple/Simple.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/plugins/Simple/Simple.td?rev=57636&view=auto

==============================================================================
--- llvm/trunk/tools/llvmc2/plugins/Simple/Simple.td (added)
+++ llvm/trunk/tools/llvmc2/plugins/Simple/Simple.td Thu Oct 16 09:02:29 2008
@@ -0,0 +1,30 @@
+// A simple wrapper for gcc.
+// To compile, use this command:
+//
+//      $ cd $LLVMC2_DIR
+//      $ make DRIVER_NAME=mygcc BUILTIN_PLUGINS=Simple
+//
+// To build this plugin as a dynamic library:
+//
+//      $ cd $LLVMC2_DIR
+//      $ make BUILTIN_PLUGINS=""
+//      $ cd plugins/Simple
+//      $ make
+//
+// Run as:
+//
+//      $ llvmc2 -load $LLVM_DIR/Release/lib/LLVMCSimple.so
+
+include "llvm/CompilerDriver/Common.td"
+
+def gcc : Tool<
+[(in_language "c"),
+ (out_language "executable"),
+ (output_suffix "out"),
+ (cmd_line "gcc $INFILE -o $OUTFILE"),
+ (sink)
+]>;
+
+def LanguageMap : LanguageMap<[LangToSuffixes<"c", ["c"]>]>;
+
+def CompilationGraph : CompilationGraph<[Edge<root, gcc>]>;





More information about the llvm-commits mailing list