[llvm-commits] [PATCH 7/10] Initial TOC support for PowerPC64 object creation

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Oct 5 06:58:16 PDT 2012


+void MCStreamer::EmitTCEntry(const MCExpr *Expr) {
+  errs() << "Not implemented yet\n";
+  abort();
+}

The error message is not correct, this will never be implemented. If
this cannot be reached by a user running llvm-mc, we can probably use
a llvm_unreachable.

+    virtual unsigned GetRelocTypeInner(const MCValue &Target,
+                                       const MCFixup &Fixup,
+                                       bool IsPCRel) const;

Naming convention: please use lowercase function names for new code.

+  bool EmitThisSym = false;
+

Instead of the following switch you can just say

bool EmitThisSym = RelocType != ELF::R_PPC64_TOC.

no?

+  if (EmitThisSym && !Symbol.isTemporary())

Why the Symbol.isTemporary()?


I think the main question is why are you using ExplicitRelSym?
Wouldn't it be better to add a new hook with a default implementation
that returns &ASymbol? That way you can avoid all the
checkRelocationUndefined plumbing.

Cheers,
Rafael



More information about the llvm-commits mailing list