aboutsummaryrefslogtreecommitdiff
path: root/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-08-19 20:04:19 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-08-19 20:04:19 +0000
commitb57326c8aab6f6089b29e324c39811d494d6fc42 (patch)
treeaabf6674340d3302ccf75e8c951277de3f7139ce /tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
parent8f2766df7fe421dc4ae4aa03e461f802fe2ab7aa (diff)
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/example/mcc16/plugins/PIC16Base/PluginMain.cpp')
-rw-r--r--tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp106
1 files changed, 0 insertions, 106 deletions
diff --git a/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp b/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
deleted file mode 100644
index e7db750ca2..0000000000
--- a/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-#include "AutoGenerated.inc"
-
-#include "llvm/System/Path.h"
-#include "llvm/Support/raw_ostream.h"
-
-using namespace llvm;
-
-namespace llvmc {
- extern char *ProgramName;
-}
-
-
-
-// Returns the platform specific directory separator via #ifdefs.
-// FIXME: This currently work on linux and windows only. It does not
-// work on other unices.
-static std::string GetDirSeparator() {
-#if __linux__ || __APPLE__
- return "/";
-#else
- return "\\";
-#endif
-}
-
-namespace hooks {
-// Get preprocessor define for the part.
-// It is __partname format in lower case.
-std::string
-GetLowerCasePartDefine(void) {
- std::string Partname;
- if (AutoGeneratedParameter_p.empty()) {
- Partname = "16f1xxx";
- } else {
- Partname = AutoGeneratedParameter_p;
- }
-
- std::string LowerCase;
- for (unsigned i = 0; i < Partname.size(); i++) {
- LowerCase.push_back(std::tolower(Partname[i]));
- }
-
- return "__" + LowerCase;
-}
-
-std::string
-GetUpperCasePartDefine(void) {
- std::string Partname;
- if (AutoGeneratedParameter_p.empty()) {
- Partname = "16f1xxx";
- } else {
- Partname = AutoGeneratedParameter_p;
- }
-
- std::string UpperCase;
- for (unsigned i = 0; i < Partname.size(); i++) {
- UpperCase.push_back(std::toupper(Partname[i]));
- }
-
- return "__" + UpperCase;
-}
-
-
-// Get the dir where c16 executables reside.
-std::string GetBinDir() {
- // Construct a Path object from the program name.
- void *P = (void*) (intptr_t) GetBinDir;
- sys::Path ProgramFullPath
- = sys::Path::GetMainExecutable(llvmc::ProgramName, P);
-
- // Get the dir name for the program. It's last component should be 'bin'.
- std::string BinDir = ProgramFullPath.getDirname();
-
- // llvm::errs() << "BinDir: " << BinDir << '\n';
- return BinDir + GetDirSeparator();
-}
-
-// Get the Top-level Installation dir for c16.
-std::string GetInstallDir() {
- sys::Path BinDirPath = sys::Path(GetBinDir());
-
- // Go one more level up to get the install dir.
- std::string InstallDir = BinDirPath.getDirname();
-
- return InstallDir + GetDirSeparator();
-}
-
-// Get the dir where the c16 header files reside.
-std::string GetStdHeadersDir() {
- return GetInstallDir() + "include";
-}
-
-// Get the dir where the assembler header files reside.
-std::string GetStdAsmHeadersDir() {
- return GetInstallDir() + "inc";
-}
-
-// Get the dir where the linker scripts reside.
-std::string GetStdLinkerScriptsDir() {
- return GetInstallDir() + "lkr";
-}
-
-// Get the dir where startup code, intrinsics and lib reside.
-std::string GetStdLibsDir() {
- return GetInstallDir() + "lib";
-}
-}