SNSystems / llvm-project-prepo

Fork of LLVM with modifications to support a program repository
26 stars 0 forks source link

Assertion failure when emitting the debug_loc section. #175

Closed MaggieYingYi closed 2 years ago

MaggieYingYi commented 2 years ago

Compile the following code:

$ less test.cpp
struct a {
  virtual void b();
};
class c {
public:
  c(int);
};
int d;
void e(a) { c f(d); }

using

$ rm clang.db
$ REPOFILE=clang.db clang++ -c -g -O2 -o test.o test.cpp

clang++: /home/maggie/github/llvm-project-prepo/llvm/lib/MC/MCStreamer.cpp:1112: virtual void llvm::MCStreamer::SwitchSection(llvm::MCSection*, const llvm::MCExpr*): Assertion `Section && "Cannot switch to a null section!"' failed.
MaggieYingYi commented 2 years ago

Section is switched to a null DebugLocSection. We need to create DebugLocSection as a dummy section which enable the assembler to have a "default" section.

paulhuggett commented 2 years ago

Can this now be closed?

MaggieYingYi commented 2 years ago

Can this now be closed?

Yes, thanks Paul.