mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-23 00:03:14 +01:00
[svn r207] Fixed: the runtime support didn't handle string switch.
This commit is contained in:
@@ -696,6 +696,40 @@ static void LLVM_D_BuildRuntimeModule()
|
||||
const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false);
|
||||
new llvm::Function(fty, llvm::GlobalValue::ExternalLinkage, fname, M);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// int _d_switch_string(char[][] table, char[] ca)
|
||||
{
|
||||
std::string fname("_d_switch_string");
|
||||
std::vector<const llvm::Type*> types;
|
||||
types.push_back(rt_array(stringTy));
|
||||
types.push_back(stringTy);
|
||||
const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false);
|
||||
new llvm::Function(fty, llvm::GlobalValue::ExternalLinkage, fname, M);
|
||||
}
|
||||
|
||||
// int _d_switch_ustring(wchar[][] table, wchar[] ca)
|
||||
{
|
||||
std::string fname("_d_switch_ustring");
|
||||
std::vector<const llvm::Type*> types;
|
||||
types.push_back(rt_array(wstringTy));
|
||||
types.push_back(wstringTy);
|
||||
const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false);
|
||||
new llvm::Function(fty, llvm::GlobalValue::ExternalLinkage, fname, M);
|
||||
}
|
||||
|
||||
// int _d_switch_dstring(dchar[][] table, dchar[] ca)
|
||||
{
|
||||
std::string fname("_d_switch_dstring");
|
||||
std::vector<const llvm::Type*> types;
|
||||
types.push_back(rt_array(dstringTy));
|
||||
types.push_back(dstringTy);
|
||||
const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false);
|
||||
new llvm::Function(fty, llvm::GlobalValue::ExternalLinkage, fname, M);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user