diff --git a/tools/llvmc/Makefile b/tools/llvmc/Makefile index 9bcb96c954e..7c03e2a74f7 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 a7179eae8bd..00000000000 --- 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 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 add8acb4a57..00000000000 --- 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 f489abfbc57..00000000000 --- 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 93e795b198a..00000000000 --- 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 fb07f23d58e..00000000000 --- 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 add8acb4a57..00000000000 --- 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 e94bca2330d..00000000000 --- 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 670d8bdf94c..00000000000 --- 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 fb07f23d58e..00000000000 --- 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 00000000000..71f04fdd49d --- /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 similarity index 93% rename from tools/llvmc/example/Hello/Makefile rename to tools/llvmc/examples/Hello/Makefile index 10325e6a6d5..5b7dccb6d93 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 similarity index 60% rename from tools/llvmc/example/Skeleton/plugins/Plugin/Makefile rename to tools/llvmc/examples/Makefile index 54f722165dc..8468e931044 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 similarity index 73% rename from tools/llvmc/example/Simple/Makefile rename to tools/llvmc/examples/Simple/Makefile index d7adb5d851e..c10387c4f55 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 00000000000..8ac73130f9e --- /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 similarity index 64% rename from tools/llvmc/example/Simple/Simple.td rename to tools/llvmc/examples/Simple/Simple.td index 87bc385b7a7..7ceee93d7cd 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 similarity index 52% rename from tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td rename to tools/llvmc/examples/Skeleton/AutoGenerated.td index febb9ad374e..97483ce9282 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 00000000000..ddd38f6e707 --- /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 similarity index 83% rename from tools/llvmc/example/Skeleton/driver/Main.cpp rename to tools/llvmc/examples/Skeleton/Main.cpp index b1f5b6798ae..24c7768f93b 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 00000000000..41ca8235e24 --- /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 similarity index 80% rename from tools/llvmc/example/Skeleton/README rename to tools/llvmc/examples/Skeleton/README index 92216ae5045..61ff6fbf235 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 similarity index 91% rename from tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp rename to tools/llvmc/examples/mcc16/Hooks.cpp index e7db750ca28..aa31c89c8f7 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 + using namespace llvm; namespace llvmc { extern char *ProgramName; } - +extern cl::opt 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 similarity index 90% rename from tools/llvmc/example/mcc16/driver/Main.cpp rename to tools/llvmc/examples/mcc16/Main.cpp index e66e2f9c67c..55ae9128394 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 -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 similarity index 60% rename from tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile rename to tools/llvmc/examples/mcc16/Makefile index 5d785fd4821..4409cffb553 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 similarity index 99% rename from tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td rename to tools/llvmc/examples/mcc16/PIC16.td index 25149ad72f4..4f07284b153 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 similarity index 96% rename from tools/llvmc/example/mcc16/README rename to tools/llvmc/examples/mcc16/README index eeef6a4f8f1..6d2b73d5d97 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: diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 2d445507821..b091419f91e 100644 --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -2950,8 +2950,6 @@ void EmitIncludes(raw_ostream& O) { << "using namespace llvm;\n" << "using namespace llvmc;\n\n" - << "extern cl::opt OutputFilename;\n\n" - << "inline const char* checkCString(const char* s)\n" << "{ return s == NULL ? \"\" : s; }\n\n"; }