diff options
Diffstat (limited to 'lib/CodeGen/StringHandler.cc')
| -rw-r--r-- | lib/CodeGen/StringHandler.cc | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/CodeGen/StringHandler.cc b/lib/CodeGen/StringHandler.cc index 56b5aea..463bf96 100644 --- a/lib/CodeGen/StringHandler.cc +++ b/lib/CodeGen/StringHandler.cc @@ -6,9 +6,8 @@ using namespace llvm; using namespace cps; -StringHandler::StringHandler(LLVMContext &Ctx, IRBuilder<> &B, llvm::Module &M, - std::map<std::string, Value*> &NV) - : Context(Ctx), Builder(B), Module(M), NamedValues(NV) { +StringHandler::StringHandler(LLVMContext &Ctx, IRBuilder<> &B, llvm::Module &M) + : Context(Ctx), Builder(B), Module(M) { setupExternalFunctions(); } @@ -34,16 +33,6 @@ void StringHandler::setupExternalFunctions() { ToLowerFunc = Module.getOrInsertFunction("tolower", CharCaseType); } -void StringHandler::emitDeclare(const std::string &Name) { - Function *TheFunction = Builder.GetInsertBlock()->getParent(); - IRBuilder<> TmpB(&TheFunction->getEntryBlock(), TheFunction->getEntryBlock().begin()); - AllocaInst *Alloca = TmpB.CreateAlloca(PointerType::getUnqual(Context), nullptr, Name); - - Value *EmptyStr = createLiteral(""); - Builder.CreateStore(EmptyStr, Alloca); - NamedValues[Name] = Alloca; -} - Value *StringHandler::createLiteral(const std::string &Val) { return Builder.CreateGlobalStringPtr(Val); } |
