Mercurial > projects > ldc
comparison gen/runtime.cpp @ 191:2900754a6989 trunk
[svn r207] Fixed: the runtime support didn't handle string switch.
author | lindquist |
---|---|
date | Mon, 12 May 2008 14:58:55 +0200 |
parents | db9890b3fb64 |
children | bfcb657756f6 |
comparison
equal
deleted
inserted
replaced
190:36044016709a | 191:2900754a6989 |
---|---|
694 std::vector<const llvm::Type*> types; | 694 std::vector<const llvm::Type*> types; |
695 types.push_back(objectTy); | 695 types.push_back(objectTy); |
696 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false); | 696 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false); |
697 new llvm::Function(fty, llvm::GlobalValue::ExternalLinkage, fname, M); | 697 new llvm::Function(fty, llvm::GlobalValue::ExternalLinkage, fname, M); |
698 } | 698 } |
699 } | 699 |
700 | 700 ///////////////////////////////////////////////////////////////////////////////////// |
701 | 701 ///////////////////////////////////////////////////////////////////////////////////// |
702 | 702 ///////////////////////////////////////////////////////////////////////////////////// |
703 | 703 |
704 | 704 // int _d_switch_string(char[][] table, char[] ca) |
705 | 705 { |
706 std::string fname("_d_switch_string"); | |
707 std::vector<const llvm::Type*> types; | |
708 types.push_back(rt_array(stringTy)); | |
709 types.push_back(stringTy); | |
710 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); | |
711 new llvm::Function(fty, llvm::GlobalValue::ExternalLinkage, fname, M); | |
712 } | |
713 | |
714 // int _d_switch_ustring(wchar[][] table, wchar[] ca) | |
715 { | |
716 std::string fname("_d_switch_ustring"); | |
717 std::vector<const llvm::Type*> types; | |
718 types.push_back(rt_array(wstringTy)); | |
719 types.push_back(wstringTy); | |
720 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); | |
721 new llvm::Function(fty, llvm::GlobalValue::ExternalLinkage, fname, M); | |
722 } | |
723 | |
724 // int _d_switch_dstring(dchar[][] table, dchar[] ca) | |
725 { | |
726 std::string fname("_d_switch_dstring"); | |
727 std::vector<const llvm::Type*> types; | |
728 types.push_back(rt_array(dstringTy)); | |
729 types.push_back(dstringTy); | |
730 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); | |
731 new llvm::Function(fty, llvm::GlobalValue::ExternalLinkage, fname, M); | |
732 } | |
733 } | |
734 | |
735 | |
736 | |
737 | |
738 | |
739 |