Fixes VS support for llvmc mcc16 llvmc example.

Patch by arrowdodger!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135918 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Oscar Fuentes 2011-07-25 17:24:54 +00:00
parent cc866d5d2d
commit 796f925175

View File

@ -3,9 +3,10 @@
#include "llvm/Support/raw_ostream.h"
#include <string>
#include <locale>
namespace llvmc {
extern char *ProgramName;
extern const char *ProgramName;
namespace autogenerated {
extern llvm::cl::opt<std::string> Parameter_p;
@ -31,6 +32,7 @@ namespace hooks {
// It is __partname format in lower case.
std::string
GetLowerCasePartDefine(void) {
std::locale loc;
std::string Partname;
if (autogenerated::Parameter_p.empty()) {
Partname = "16f1xxx";
@ -40,7 +42,7 @@ GetLowerCasePartDefine(void) {
std::string LowerCase;
for (unsigned i = 0; i < Partname.size(); i++) {
LowerCase.push_back(std::tolower(Partname[i]));
LowerCase.push_back(std::tolower(Partname[i], loc));
}
return "__" + LowerCase;
@ -48,6 +50,7 @@ GetLowerCasePartDefine(void) {
std::string
GetUpperCasePartDefine(void) {
std::locale loc;
std::string Partname;
if (autogenerated::Parameter_p.empty()) {
Partname = "16f1xxx";
@ -57,7 +60,7 @@ GetUpperCasePartDefine(void) {
std::string UpperCase;
for (unsigned i = 0; i < Partname.size(); i++) {
UpperCase.push_back(std::toupper(Partname[i]));
UpperCase.push_back(std::toupper(Partname[i], loc));
}
return "__" + UpperCase;