[LLVMdev] Question about MCExpr and subclasses

Jim Grosbach grosbach at apple.com
Mon Oct 17 17:30:49 PDT 2011

That just means the ELF writer doesn't know yet how to deal with the target-specific data. It needs taught how to map them onto relocations and such.

Do you really need to subclass MCTargetExpr? That's ordinarily only for operands that aren't representable via the normal MC stuff (for example, the ARM movw/movt relocations). You should be able represent normal symbol operands w/o needing a MCTargetExpr instance. The ARM or x86 targets may me useful reference points.


On Oct 17, 2011, at 5:10 PM, Akira Hatanaka wrote:

> I have a question about MCExpr and its subclasses defined in MCExpr.h.
> I am trying to get Mips' direct object emission working.
> Line 283 of MCElfStreamer.cpp reads like this:
> 00283   case MCExpr::Target: llvm_unreachable("Can't handle target exprs yet!");
> Does this mean that if I use a subclass of MCTargetExpr to lower
> MachineOperands to MCOperands, it won't work?
> Currently, symbol operands are lowered to MipsMCSymbolRefExpr (a
> subclass of MCTargetExpr) objects.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

More information about the llvm-dev mailing list