diff options
author | Edwin Vane <edwin.vane@intel.com> | 2013-04-05 19:18:13 +0000 |
---|---|---|
committer | Edwin Vane <edwin.vane@intel.com> | 2013-04-05 19:18:13 +0000 |
commit | 6b191b0195f1c2cf1b048662d0777ae8456070fc (patch) | |
tree | fc4317cd3a478a36f1d73bb4a35d97561af048a5 /clang-tools-extra/cpp11-migrate/Core/Transforms.h | |
parent | 97a10e9f0461cf8e8e71f8b02dd354b446d8d2f1 (diff) | |
download | bcm5719-llvm-6b191b0195f1c2cf1b048662d0777ae8456070fc.tar.gz bcm5719-llvm-6b191b0195f1c2cf1b048662d0777ae8456070fc.zip |
Fix symbol dependency errors introduced with libmigrateCore
With cpp11-migrate core functionality moved to a separate library (for enabling
unit tests) this library contained code that referenced symbols that are still
in the main binary. On some platforms, the shared library build broke as a
result. This revision fixes the dependency problem and is safe for the eventual
lib-ification of the transforms as well.
llvm-svn: 178901
Diffstat (limited to 'clang-tools-extra/cpp11-migrate/Core/Transforms.h')
-rw-r--r-- | clang-tools-extra/cpp11-migrate/Core/Transforms.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/clang-tools-extra/cpp11-migrate/Core/Transforms.h b/clang-tools-extra/cpp11-migrate/Core/Transforms.h index e660ccf9207..67e38b025c8 100644 --- a/clang-tools-extra/cpp11-migrate/Core/Transforms.h +++ b/clang-tools-extra/cpp11-migrate/Core/Transforms.h @@ -17,6 +17,7 @@ #define LLVM_TOOLS_CLANG_TOOLS_EXTRA_CPP11_MIGRATE_TRANSFORMS_H #include "llvm/Support/CommandLine.h" +#include "llvm/ADT/StringRef.h" #include <vector> // Forward declarations @@ -28,6 +29,10 @@ class Option; class Transform; typedef Transform *(*TransformCreator)(); +template <typename T> +Transform *ConstructTransform() { + return new T(); +} /// \brief Class encapsulating the creation of command line bool options /// for each transform and instantiating transforms chosen by the user. @@ -40,10 +45,12 @@ public: ~Transforms(); - /// \brief Create command line options using LLVM's command line library. + /// \brief Registers a transform causing the transform to be made available + /// on the command line. /// - /// Be sure to call *before* parsing options. - void createTransformOpts(); + /// Be sure to register all transforms *before* parsing command line options. + void registerTransform(llvm::StringRef OptName, llvm::StringRef Description, + TransformCreator Creator); /// \brief Instantiate all transforms that were selected on the command line. /// |