[PATCH] D70344: [macho] Allow CPUSubtype to be adjusted before writing it to a file

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 14:59:45 PST 2019


dsanders created this revision.
dsanders added a reviewer: pete.
Herald added a project: LLVM.

It's not always possible for a target to provide a MachO CPUSubtype up
front as is required by the current implementation. Sometimes you need more
information like the particular CPU implementation you are targeting.

Give MCMachObjectTargetWriter subclasses the opportunity to modify the
CPUSubtype after the MCMachObjectTargetWriter is created but before the
object starts being written. Typically this would be done in response to
instructions from a TargetStreamer.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70344

Files:
  llvm/include/llvm/MC/MCMachObjectWriter.h


Index: llvm/include/llvm/MC/MCMachObjectWriter.h
===================================================================
--- llvm/include/llvm/MC/MCMachObjectWriter.h
+++ llvm/include/llvm/MC/MCMachObjectWriter.h
@@ -28,7 +28,9 @@
 class MCMachObjectTargetWriter : public MCObjectTargetWriter {
   const unsigned Is64Bit : 1;
   const uint32_t CPUType;
-  const uint32_t CPUSubtype;
+protected:
+  uint32_t CPUSubtype;
+public:
   unsigned LocalDifference_RIT;
 
 protected:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70344.229647.patch
Type: text/x-patch
Size: 471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191115/a633e448/attachment-0001.bin>


More information about the llvm-commits mailing list