ERROR:Segmentation fault

Hi Developer,

In my processor I am not using registers so I wrote Simple register.td file with bare minimum functions.

But when I am registering my target with llvm it is showing “Segmentation Fault(core dumped)” Error and also same error while generating table-gen for asm-writer.

Some one told comment out EditRegesterName function. because this error is due to EditRegisterName it seems but where should i comment means in which file should i comment this function Since i am not using it in any of my files.

please help me guys.

Could you attach your .td file

please help me guys

This is failing because in the file you attached to me you’re defining an empty register class.

include "llvm/Target/Target.td"

def Abc : Target
{
}

class Reg<string n> : Register<n> {
  let Namespace = "SYMPL";
}

def R1 : Reg<"r1">;

def NOReg : RegisterClass<"SYMPL", [ i32 ], 32, (add R1)>;

Here’s what it looks like when you define a register ‘r1’ and add it to the register class. I had to add a bunch of stuff at the top to get TableGen to compile it on its own.

When I run llvm-tblgen -gen-register-info SYMPLRegisterInfo.td it succeeds.

Help me Guys please

Dear Varun,

Your question doesn't provide enough information for anyone to provide a useful answer.

Your best course of action is to use a debugger (e.g., lldb or gdb) to determine why your code is triggering a segmentation fault. If you do that, you can figure out what pointer variable is pointing to NULL or to a bad memory location. With that information, you can either fix the problem yourself or develop a more focused question that people will be able to answer.

Regards,

John Criswell