summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2010-02-08 05:56:37 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2010-02-08 05:56:37 +0000
commitb67dc69a785562e7d2972bd6c8b988b41071d477 (patch)
tree84c55498eac7f3c8c163ea1dfa6df7e9d8195b85 /llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
parent000a859f0550f25eabfb3895ceeca782221a02d8 (diff)
downloadbcm5719-llvm-b67dc69a785562e7d2972bd6c8b988b41071d477.tar.gz
bcm5719-llvm-b67dc69a785562e7d2972bd6c8b988b41071d477.zip
Add uppercase and lowercase part defines in driver.
Use a temp dir with a unique name in the current dir itself. Use forward_value instead of unpack_values. llvm-svn: 95530
Diffstat (limited to 'llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp')
-rw-r--r--llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp b/llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
index a6d2ff6b1ae..9b2f9fc5448 100644
--- a/llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
+++ b/llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
@@ -9,6 +9,8 @@ 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.
@@ -21,6 +23,43 @@ static std::string GetDirSeparator() {
}
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.
OpenPOWER on IntegriCloud