[PATCH] D78138: [MC][ELF] Reject instructions in SHT_NOBITS sections

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 23:57:38 PDT 2020


skan added inline comments.


================
Comment at: llvm/include/llvm/MC/MCSection.h:189-190
 
+  virtual const char *getVirtualSectionKind() const { return "virtual"; }
+
   /// Add a pending label for the requested subsection. This label will be
----------------
I think "llvm::StringRef" is better than `const char *` here.

https://llvm.org/doxygen/classllvm_1_1StringRef.html#details


================
Comment at: llvm/lib/MC/MCObjectStreamer.cpp:372-373
+  if (Sec.isVirtualSection()) {
+    getContext().reportError(Inst.getLoc(),
+                             Twine(Sec.getVirtualSectionKind()) +
+                                 " section cannot have instructions");
----------------
`const MCSection &`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78138/new/

https://reviews.llvm.org/D78138





More information about the llvm-commits mailing list