@@ -162,6 +162,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
162
162
std::unique_ptr<llvm::IRBuilder<>> builder;
163
163
Platform platform;
164
164
bool emit_debug_info;
165
+ std::string infile;
165
166
bool emit_debug_line_column;
166
167
Allocator &al;
167
168
@@ -240,12 +241,14 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
240
241
llvm::DIFile *debug_Unit;
241
242
242
243
ASRToLLVMVisitor (Allocator &al, llvm::LLVMContext &context, Platform platform,
243
- bool emit_debug_info, diag::Diagnostics &diagnostics) :
244
+ bool emit_debug_info, std::string infile, bool emit_debug_line_column,
245
+ diag::Diagnostics &diagnostics) :
244
246
diag{diagnostics},
245
247
context (context),
246
248
builder (std::make_unique<llvm::IRBuilder<>>(context)),
247
249
platform{platform},
248
250
emit_debug_info{emit_debug_info},
251
+ infile{infile},
249
252
emit_debug_line_column{emit_debug_line_column},
250
253
al{al},
251
254
prototype_only (false ),
@@ -1160,7 +1163,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
1160
1163
if (emit_debug_info) {
1161
1164
DBuilder = std::make_unique<llvm::DIBuilder>(*module );
1162
1165
debug_CU = DBuilder->createCompileUnit (
1163
- llvm::dwarf::DW_LANG_C, DBuilder->createFile (" xxexpr.py " , " /yy/ " ),
1166
+ llvm::dwarf::DW_LANG_C, DBuilder->createFile (infile , " . " ),
1164
1167
" LPython Compiler" , false , " " , 0 );
1165
1168
}
1166
1169
@@ -6369,12 +6372,14 @@ Result<std::unique_ptr<LLVMModule>> asr_to_llvm(ASR::TranslationUnit_t &asr,
6369
6372
diag::Diagnostics &diagnostics,
6370
6373
llvm::LLVMContext &context, Allocator &al,
6371
6374
LCompilers::PassManager& pass_manager,
6372
- CompilerOptions &co, const std::string &run_fn)
6375
+ CompilerOptions &co, const std::string &run_fn,
6376
+ const std::string &infile)
6373
6377
{
6374
6378
#if LLVM_VERSION_MAJOR >= 15
6375
6379
context.setOpaquePointers (false );
6376
6380
#endif
6377
- ASRToLLVMVisitor v (al, context, co.platform , co.emit_debug_info , diagnostics);
6381
+ ASRToLLVMVisitor v (al, context, co.platform , co.emit_debug_info , infile,
6382
+ co.emit_debug_line_column , diagnostics);
6378
6383
LCompilers::PassOptions pass_options;
6379
6384
pass_options.run_fun = run_fn;
6380
6385
pass_options.always_run = false ;
0 commit comments