diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2010-08-19 20:04:19 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2010-08-19 20:04:19 +0000 |
commit | b57326c8aab6f6089b29e324c39811d494d6fc42 (patch) | |
tree | aabf6674340d3302ccf75e8c951277de3f7139ce /tools/llvmc | |
parent | 8f2766df7fe421dc4ae4aa03e461f802fe2ab7aa (diff) | |
download | external_llvm-b57326c8aab6f6089b29e324c39811d494d6fc42.zip external_llvm-b57326c8aab6f6089b29e324c39811d494d6fc42.tar.gz external_llvm-b57326c8aab6f6089b29e324c39811d494d6fc42.tar.bz2 |
llvmc: Update examples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc')
-rw-r--r-- | tools/llvmc/Makefile | 4 | ||||
-rw-r--r-- | tools/llvmc/example/Hello/Hello.cpp | 33 | ||||
-rw-r--r-- | tools/llvmc/example/Simple/PluginMain.cpp | 1 | ||||
-rw-r--r-- | tools/llvmc/example/Skeleton/Makefile | 24 | ||||
-rw-r--r-- | tools/llvmc/example/Skeleton/driver/Makefile | 13 | ||||
-rw-r--r-- | tools/llvmc/example/Skeleton/plugins/Makefile | 18 | ||||
-rw-r--r-- | tools/llvmc/example/Skeleton/plugins/Plugin/PluginMain.cpp | 1 | ||||
-rw-r--r-- | tools/llvmc/example/mcc16/Makefile | 18 | ||||
-rw-r--r-- | tools/llvmc/example/mcc16/driver/Makefile | 13 | ||||
-rw-r--r-- | tools/llvmc/example/mcc16/plugins/Makefile | 18 | ||||
-rw-r--r-- | tools/llvmc/examples/Hello/Hello.cpp | 29 | ||||
-rw-r--r-- | tools/llvmc/examples/Hello/Makefile (renamed from tools/llvmc/example/Hello/Makefile) | 2 | ||||
-rw-r--r-- | tools/llvmc/examples/Makefile (renamed from tools/llvmc/example/Skeleton/plugins/Plugin/Makefile) | 9 | ||||
-rw-r--r-- | tools/llvmc/examples/Simple/Makefile (renamed from tools/llvmc/example/Simple/Makefile) | 6 | ||||
-rw-r--r-- | tools/llvmc/examples/Simple/Simple.cpp | 2 | ||||
-rw-r--r-- | tools/llvmc/examples/Simple/Simple.td (renamed from tools/llvmc/example/Simple/Simple.td) | 20 | ||||
-rw-r--r-- | tools/llvmc/examples/Skeleton/AutoGenerated.td (renamed from tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td) | 4 | ||||
-rw-r--r-- | tools/llvmc/examples/Skeleton/Hooks.cpp | 12 | ||||
-rw-r--r-- | tools/llvmc/examples/Skeleton/Main.cpp (renamed from tools/llvmc/example/Skeleton/driver/Main.cpp) | 3 | ||||
-rw-r--r-- | tools/llvmc/examples/Skeleton/Makefile | 20 | ||||
-rw-r--r-- | tools/llvmc/examples/Skeleton/README (renamed from tools/llvmc/example/Skeleton/README) | 2 | ||||
-rw-r--r-- | tools/llvmc/examples/mcc16/Hooks.cpp (renamed from tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp) | 18 | ||||
-rw-r--r-- | tools/llvmc/examples/mcc16/Main.cpp (renamed from tools/llvmc/example/mcc16/driver/Main.cpp) | 17 | ||||
-rw-r--r-- | tools/llvmc/examples/mcc16/Makefile (renamed from tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile) | 10 | ||||
-rw-r--r-- | tools/llvmc/examples/mcc16/PIC16.td (renamed from tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td) | 2 | ||||
-rw-r--r-- | tools/llvmc/examples/mcc16/README (renamed from tools/llvmc/example/mcc16/README) | 2 |
26 files changed, 116 insertions, 185 deletions
diff --git a/tools/llvmc/Makefile b/tools/llvmc/Makefile index 9bcb96c..7c03e2a 100644 --- a/tools/llvmc/Makefile +++ b/tools/llvmc/Makefile @@ -11,4 +11,8 @@ LEVEL = ../.. DIRS = src +ifeq ($(BUILD_EXAMPLES),1) + OPTIONAL_DIRS += examples +endif + include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/example/Hello/Hello.cpp b/tools/llvmc/example/Hello/Hello.cpp deleted file mode 100644 index a7179ea..0000000 --- a/tools/llvmc/example/Hello/Hello.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//===- Hello.cpp - Example code from "Writing an LLVMC Plugin" ------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Test plugin for LLVMC. Shows how to write plugins without using TableGen. -// -//===----------------------------------------------------------------------===// - -#include "llvm/CompilerDriver/CompilationGraph.h" -#include "llvm/CompilerDriver/Plugin.h" -#include "llvm/Support/raw_ostream.h" - -namespace { -struct MyPlugin : public llvmc::BasePlugin { - - void PreprocessOptions() const - {} - - void PopulateLanguageMap(llvmc::LanguageMap&) const - { outs() << "Hello!\n"; } - - void PopulateCompilationGraph(llvmc::CompilationGraph&) const - {} -}; - -static llvmc::RegisterPlugin<MyPlugin> RP("Hello", "Hello World plugin"); - -} diff --git a/tools/llvmc/example/Simple/PluginMain.cpp b/tools/llvmc/example/Simple/PluginMain.cpp deleted file mode 100644 index add8acb..0000000 --- a/tools/llvmc/example/Simple/PluginMain.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "AutoGenerated.inc" diff --git a/tools/llvmc/example/Skeleton/Makefile b/tools/llvmc/example/Skeleton/Makefile deleted file mode 100644 index f489abf..0000000 --- a/tools/llvmc/example/Skeleton/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -##===- llvmc/example/Skeleton/Makefile ---------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -# Change this so that $(BASE_LEVEL)/Makefile.common refers to -# $LLVM_DIR/Makefile.common or $YOUR_LLVM_BASED_PROJECT/Makefile.common. -export LLVMC_BASE_LEVEL = ../../../.. - -# Change this to the name of your LLVMC-based driver. -export LLVMC_BASED_DRIVER_NAME = llvmc-skeleton - -# List your plugin names here -export LLVMC_BUILTIN_PLUGINS = # Plugin - -LEVEL = $(LLVMC_BASE_LEVEL) - -DIRS = plugins driver - -include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/example/Skeleton/driver/Makefile b/tools/llvmc/example/Skeleton/driver/Makefile deleted file mode 100644 index 93e795b..0000000 --- a/tools/llvmc/example/Skeleton/driver/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -##===- llvmc/example/Skeleton/driver/Makefile --------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = $(LLVMC_BASE_LEVEL)/.. -LLVMC_BASED_DRIVER = $(LLVMC_BASED_DRIVER_NAME) - -include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/example/Skeleton/plugins/Makefile b/tools/llvmc/example/Skeleton/plugins/Makefile deleted file mode 100644 index fb07f23..0000000 --- a/tools/llvmc/example/Skeleton/plugins/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -##===- llvmc/example/Skeleton/plugins/Makefile -------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = $(LLVMC_BASE_LEVEL)/.. - -ifneq ($(LLVMC_BUILTIN_PLUGINS),) -DIRS = $(LLVMC_BUILTIN_PLUGINS) -endif - -export LLVMC_BUILTIN_PLUGIN=1 - -include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/example/Skeleton/plugins/Plugin/PluginMain.cpp b/tools/llvmc/example/Skeleton/plugins/Plugin/PluginMain.cpp deleted file mode 100644 index add8acb..0000000 --- a/tools/llvmc/example/Skeleton/plugins/Plugin/PluginMain.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "AutoGenerated.inc" diff --git a/tools/llvmc/example/mcc16/Makefile b/tools/llvmc/example/mcc16/Makefile deleted file mode 100644 index e94bca2..0000000 --- a/tools/llvmc/example/mcc16/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -##===- llvmc/example/mcc16/Makefile ------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -export LLVMC_BASE_LEVEL = ../../../.. -export LLVMC_BASED_DRIVER_NAME = mcc16 -export LLVMC_BUILTIN_PLUGINS = PIC16Base - -LEVEL = $(LLVMC_BASE_LEVEL) - -DIRS = plugins driver - -include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/example/mcc16/driver/Makefile b/tools/llvmc/example/mcc16/driver/Makefile deleted file mode 100644 index 670d8bd..0000000 --- a/tools/llvmc/example/mcc16/driver/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -##===- llvmc/example/mcc16/driver/Makefile -----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = $(LLVMC_BASE_LEVEL)/.. -LLVMC_BASED_DRIVER = $(LLVMC_BASED_DRIVER_NAME) - -include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/example/mcc16/plugins/Makefile b/tools/llvmc/example/mcc16/plugins/Makefile deleted file mode 100644 index fb07f23..0000000 --- a/tools/llvmc/example/mcc16/plugins/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -##===- llvmc/example/Skeleton/plugins/Makefile -------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = $(LLVMC_BASE_LEVEL)/.. - -ifneq ($(LLVMC_BUILTIN_PLUGINS),) -DIRS = $(LLVMC_BUILTIN_PLUGINS) -endif - -export LLVMC_BUILTIN_PLUGIN=1 - -include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/examples/Hello/Hello.cpp b/tools/llvmc/examples/Hello/Hello.cpp new file mode 100644 index 0000000..71f04fd --- /dev/null +++ b/tools/llvmc/examples/Hello/Hello.cpp @@ -0,0 +1,29 @@ +//===- Hello.cpp - Example code from "Writing an LLVMC Plugin" ------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Shows how to write llvmc-based drivers without using TableGen. +// +//===----------------------------------------------------------------------===// + +#include "llvm/CompilerDriver/AutoGenerated.h" +#include "llvm/CompilerDriver/Main.inc" + +#include "llvm/Support/raw_ostream.h" + +namespace llvmc { +namespace autogenerated { + +int PreprocessOptions () { return 0; } + +int PopulateLanguageMap (LanguageMap&) { llvm::outs() << "Hello!\n"; return 0; } + +int PopulateCompilationGraph (CompilationGraph&) { return 0; } + +} +} diff --git a/tools/llvmc/example/Hello/Makefile b/tools/llvmc/examples/Hello/Makefile index 10325e6..5b7dccb 100644 --- a/tools/llvmc/example/Hello/Makefile +++ b/tools/llvmc/examples/Hello/Makefile @@ -9,6 +9,6 @@ LEVEL = ../../../.. -LLVMC_PLUGIN = Hello +LLVMC_BASED_DRIVER = Hello include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile b/tools/llvmc/examples/Makefile index 54f7221..8468e93 100644 --- a/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile +++ b/tools/llvmc/examples/Makefile @@ -1,4 +1,4 @@ -##===- llvmc/example/Skeleton/plugins/Plugin/Makefile ------*- Makefile -*-===## +##===- tools/llvmc/examples/Makefile -----------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # @@ -7,11 +7,8 @@ # ##===----------------------------------------------------------------------===## -LEVEL = $(LLVMC_BASE_LEVEL)/../.. +LEVEL=../../.. -# Change this to the name of your plugin. -LLVMC_PLUGIN = Plugin - -BUILT_SOURCES = AutoGenerated.inc +PARALLEL_DIRS := Hello Simple mcc16 Skeleton include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/example/Simple/Makefile b/tools/llvmc/examples/Simple/Makefile index d7adb5d..c10387c 100644 --- a/tools/llvmc/example/Simple/Makefile +++ b/tools/llvmc/examples/Simple/Makefile @@ -1,4 +1,4 @@ -##===- tools/llvmc/plugins/Simple/Makefile -----------------*- Makefile -*-===## +##===- llvmc/examples/Simple/Makefile ----------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # @@ -9,7 +9,7 @@ LEVEL = ../../../.. -LLVMC_PLUGIN = Simple -BUILT_SOURCES = AutoGenerated.inc +LLVMC_BASED_DRIVER = Simple +BUILT_SOURCES = Simple.inc include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/examples/Simple/Simple.cpp b/tools/llvmc/examples/Simple/Simple.cpp new file mode 100644 index 0000000..8ac7313 --- /dev/null +++ b/tools/llvmc/examples/Simple/Simple.cpp @@ -0,0 +1,2 @@ +#include "llvm/CompilerDriver/Main.inc" +#include "Simple.inc" diff --git a/tools/llvmc/example/Simple/Simple.td b/tools/llvmc/examples/Simple/Simple.td index 87bc385..7ceee93 100644 --- a/tools/llvmc/example/Simple/Simple.td +++ b/tools/llvmc/examples/Simple/Simple.td @@ -1,4 +1,4 @@ -//===- Simple.td - A simple plugin for LLVMC ------------------------------===// +//===- Simple.td - A simple LLVMC-based driver ----------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,19 +7,19 @@ // //===----------------------------------------------------------------------===// // -// A simple LLVMC-based gcc wrapper that shows how to write LLVMC plugins. +// A simple LLVMC-based gcc wrapper. // // To compile, use this command: // -// $ cd $LLVMC_DIR/example/Simple -// $ make +// $ cd $LLVM_OBJ_DIR/tools/llvmc +// $ make BUILD_EXAMPLES=1 // // Run as: // -// $ llvmc -load $LLVM_DIR/Release/lib/plugin_llvmc_Simple.so +// $ $LLVM_OBJ_DIR/$(BuildMode)/bin/Simple // // For instructions on how to build your own LLVMC-based driver, see -// the 'example/Skeleton' directory. +// the 'examples/Skeleton' directory. //===----------------------------------------------------------------------===// include "llvm/CompilerDriver/Common.td" @@ -28,8 +28,12 @@ def gcc : Tool< [(in_language "c"), (out_language "executable"), (output_suffix "out"), - (cmd_line "gcc $INFILE -o $OUTFILE"), - (sink) + (command "gcc"), + (sink), + + // -o is what is used by default, out_file_option here is included for + // instructive purposes. + (out_file_option "-o") ]>; def LanguageMap : LanguageMap<[LangToSuffixes<"c", ["c"]>]>; diff --git a/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td b/tools/llvmc/examples/Skeleton/AutoGenerated.td index febb9ad..97483ce 100644 --- a/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td +++ b/tools/llvmc/examples/Skeleton/AutoGenerated.td @@ -1,6 +1,6 @@ -//===- Plugin.td - A skeleton plugin for LLVMC -------------*- tablegen -*-===// +//===- AutoGenerated.td ------------------------------------*- tablegen -*-===// // -// Write the code for your plugin here. +// Write the TableGen description of your llvmc-based driver here. // //===----------------------------------------------------------------------===// diff --git a/tools/llvmc/examples/Skeleton/Hooks.cpp b/tools/llvmc/examples/Skeleton/Hooks.cpp new file mode 100644 index 0000000..ddd38f6 --- /dev/null +++ b/tools/llvmc/examples/Skeleton/Hooks.cpp @@ -0,0 +1,12 @@ +//===--- Hooks.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open +// Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Hook definitions should go here. +// +//===----------------------------------------------------------------------===// diff --git a/tools/llvmc/example/Skeleton/driver/Main.cpp b/tools/llvmc/examples/Skeleton/Main.cpp index b1f5b67..24c7768 100644 --- a/tools/llvmc/example/Skeleton/driver/Main.cpp +++ b/tools/llvmc/examples/Skeleton/Main.cpp @@ -7,8 +7,9 @@ // //===----------------------------------------------------------------------===// // -// Just include CompilerDriver/Main.inc. +// Just include CompilerDriver/Main.inc and AutoGenerated.inc. // //===----------------------------------------------------------------------===// #include "llvm/CompilerDriver/Main.inc" +#include "AutoGenerated.inc" diff --git a/tools/llvmc/examples/Skeleton/Makefile b/tools/llvmc/examples/Skeleton/Makefile new file mode 100644 index 0000000..41ca823 --- /dev/null +++ b/tools/llvmc/examples/Skeleton/Makefile @@ -0,0 +1,20 @@ +##===- llvmc/examples/Skeleton/Makefile --------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open +# Source License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +# Change this so that $(LEVEL)/Makefile.common refers to +# $LLVM_OBJ_DIR/Makefile.common or $YOUR_LLVM_BASED_PROJECT/Makefile.common. +export LEVEL = ../../../.. + +# Change this to the name of your LLVMC-based driver. +LLVMC_BASED_DRIVER = llvmc-skeleton + +# Change this to the name of .inc file built from your .td file. +BUILT_SOURCES = AutoGenerated.inc + +include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/example/Skeleton/README b/tools/llvmc/examples/Skeleton/README index 92216ae..61ff6fb 100644 --- a/tools/llvmc/example/Skeleton/README +++ b/tools/llvmc/examples/Skeleton/README @@ -1,6 +1,6 @@ This is a template that can be used to create your own LLVMC-based drivers. Just copy the `Skeleton` directory to the location of your preference and edit -`Skeleton/Makefile` and `Skeleton/plugins/Plugin`. +`Skeleton/Makefile` and `Skeleton/AutoGenerated.inc`. The build system assumes that your project is based on LLVM. diff --git a/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp b/tools/llvmc/examples/mcc16/Hooks.cpp index e7db750..aa31c89 100644 --- a/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp +++ b/tools/llvmc/examples/mcc16/Hooks.cpp @@ -1,19 +1,20 @@ -#include "AutoGenerated.inc" - #include "llvm/System/Path.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" +#include <string> + using namespace llvm; namespace llvmc { extern char *ProgramName; } - +extern cl::opt<std::string> AutoGeneratedParameter_p; // Returns the platform specific directory separator via #ifdefs. -// FIXME: This currently work on linux and windows only. It does not -// work on other unices. +// FIXME: This currently work on linux and windows only. It does not +// work on other unices. static std::string GetDirSeparator() { #if __linux__ || __APPLE__ return "/"; @@ -59,12 +60,11 @@ GetUpperCasePartDefine(void) { return "__" + UpperCase; } - // Get the dir where c16 executables reside. std::string GetBinDir() { - // Construct a Path object from the program name. + // Construct a Path object from the program name. void *P = (void*) (intptr_t) GetBinDir; - sys::Path ProgramFullPath + sys::Path ProgramFullPath = sys::Path::GetMainExecutable(llvmc::ProgramName, P); // Get the dir name for the program. It's last component should be 'bin'. @@ -80,7 +80,7 @@ std::string GetInstallDir() { // Go one more level up to get the install dir. std::string InstallDir = BinDirPath.getDirname(); - + return InstallDir + GetDirSeparator(); } diff --git a/tools/llvmc/example/mcc16/driver/Main.cpp b/tools/llvmc/examples/mcc16/Main.cpp index e66e2f9..55ae912 100644 --- a/tools/llvmc/example/mcc16/driver/Main.cpp +++ b/tools/llvmc/examples/mcc16/Main.cpp @@ -13,21 +13,25 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Config/config.h" #include "llvm/CompilerDriver/BuiltinOptions.h" -#include "llvm/CompilerDriver/ForceLinkage.h" +#include "llvm/CompilerDriver/Main.h" + #include "llvm/System/Path.h" +#include "llvm/Config/config.h" + #include <iostream> -namespace llvmc { - int Main(int argc, char** argv); -} +#include "PIC16.inc" + +namespace { // Modify the PACKAGE_VERSION to use build number in top level configure file. void PIC16VersionPrinter(void) { std::cout << "MPLAB C16 1.0 " << PACKAGE_VERSION << "\n"; } +} + int main(int argc, char** argv) { // HACK @@ -36,7 +40,7 @@ int main(int argc, char** argv) { Languages.setHiddenFlag(llvm::cl::Hidden); DryRun.setHiddenFlag(llvm::cl::Hidden); - llvm::cl::SetVersionPrinter(PIC16VersionPrinter); + llvm::cl::SetVersionPrinter(PIC16VersionPrinter); // Ask for a standard temp dir, but just cache its basename., and delete it. llvm::sys::Path tempDir; @@ -49,6 +53,5 @@ int main(int argc, char** argv) { tempDir = TempDirname; tempDir.eraseFromDisk(true); - llvmc::ForceLinkage(); return llvmc::Main(argc, argv); } diff --git a/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile b/tools/llvmc/examples/mcc16/Makefile index 5d785fd..4409cff 100644 --- a/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile +++ b/tools/llvmc/examples/mcc16/Makefile @@ -1,4 +1,4 @@ -##===- llvmc/example/Skeleton/plugins/Plugin/Makefile ------*- Makefile -*-===## +##===- llvmc/examples/mcc16/Makefile -----------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # @@ -7,11 +7,9 @@ # ##===----------------------------------------------------------------------===## -LEVEL = $(LLVMC_BASE_LEVEL)/../.. +LEVEL = ../../../.. -# Change this to the name of your plugin. -LLVMC_PLUGIN = PIC16Base - -BUILT_SOURCES = AutoGenerated.inc +LLVMC_BASED_DRIVER = mcc16 +BUILT_SOURCES = PIC16.inc include $(LEVEL)/Makefile.common diff --git a/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td b/tools/llvmc/examples/mcc16/PIC16.td index 25149ad..4f07284 100644 --- a/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td +++ b/tools/llvmc/examples/mcc16/PIC16.td @@ -1,4 +1,4 @@ -//===- PIC16Base.td - PIC16 toolchain driver ---------------*- tablegen -*-===// +//===- PIC16.td - PIC16 toolchain driver -------------------*- tablegen -*-===// // // A basic driver for the PIC16 toolchain. // diff --git a/tools/llvmc/example/mcc16/README b/tools/llvmc/examples/mcc16/README index eeef6a4..6d2b73d 100644 --- a/tools/llvmc/example/mcc16/README +++ b/tools/llvmc/examples/mcc16/README @@ -1,5 +1,5 @@ This is a basic compiler driver for the PIC16 toolchain that shows how to create -your own llvmc-based drivers. It is based on the example/Skeleton template. +your own llvmc-based drivers. It is based on the examples/Skeleton template. The PIC16 toolchain looks like this: |