Skip to content

Commit df88006

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents bd12ae4 + 71a5f9e commit df88006

File tree

4 files changed

+2592
-0
lines changed

4 files changed

+2592
-0
lines changed

lib/codegen/EmitConfigParser.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ static void emit_data_for_symbol(
207207
if (is_eval && !is_func) {
208208
continue;
209209
}
210+
if (is_eval && !symbol->get_sort()->is_concrete()) {
211+
continue;
212+
}
210213
auto *case_block
211214
= llvm::BasicBlock::Create(ctx, "tag" + std::to_string(tag), func);
212215
auto *branch = llvm::BranchInst::Create(merge_block, case_block);
@@ -1310,8 +1313,13 @@ static void emit_return_sort_table(kore_definition *def, llvm::Module *mod) {
13101313
auto *char_type = llvm::Type::getInt8Ty(ctx);
13111314
auto *str_type = llvm::ArrayType::get(char_type, sort_str.size() + 1);
13121315

1316+
auto *str = llvm::ConstantDataArray::getString(ctx, sort_str, true);
13131317
auto *sort_name
13141318
= module->getOrInsertGlobal("sort_name_" + sort_str, str_type);
1319+
auto *global_var = llvm::cast<llvm::GlobalVariable>(sort_name);
1320+
if (!global_var->hasInitializer()) {
1321+
global_var->setInitializer(str);
1322+
}
13151323

13161324
auto *i64_type = llvm::Type::getInt64Ty(ctx);
13171325
auto *zero = llvm::ConstantInt::get(i64_type, 0);

0 commit comments

Comments
 (0)