[all-commits] [llvm/llvm-project] 632ebc: [MC] Untangle MCContext and MCObjectFileInfo

Philipp Krones via All-commits all-commits at lists.llvm.org
Wed May 5 10:03:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 632ebc4ab4374e53fce1ec870465c587e0a33668
      https://github.com/llvm/llvm-project/commit/632ebc4ab4374e53fce1ec870465c587e0a33668
  Author: Philipp Krones <philipp.krones at embecosm.com>
  Date:   2021-05-05 (Wed, 05 May 2021)

  Changed paths:
    M clang/lib/Parse/ParseStmtAsm.cpp
    M clang/tools/driver/cc1as_main.cpp
    M lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
    M lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
    M lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
    M llvm/include/llvm/MC/MCContext.h
    M llvm/include/llvm/MC/MCObjectFileInfo.h
    M llvm/lib/CodeGen/MachineModuleInfo.cpp
    M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
    M llvm/lib/DWARFLinker/DWARFStreamer.cpp
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/lib/MC/MCContext.cpp
    M llvm/lib/MC/MCDisassembler/Disassembler.cpp
    M llvm/lib/MC/MCMachOStreamer.cpp
    M llvm/lib/MC/MCObjectFileInfo.cpp
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/MC/MCParser/COFFAsmParser.cpp
    M llvm/lib/MC/MCParser/DarwinAsmParser.cpp
    M llvm/lib/MC/MCParser/MasmParser.cpp
    M llvm/lib/MC/MCStreamer.cpp
    M llvm/lib/MC/MCWinCOFFStreamer.cpp
    M llvm/lib/Object/ModuleSymbolTable.cpp
    M llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
    M llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
    M llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXTargetStreamer.cpp
    M llvm/lib/Target/TargetLoweringObjectFile.cpp
    M llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
    M llvm/tools/llvm-dwp/llvm-dwp.cpp
    M llvm/tools/llvm-exegesis/lib/Analysis.cpp
    M llvm/tools/llvm-exegesis/lib/LlvmState.cpp
    M llvm/tools/llvm-exegesis/lib/SnippetFile.cpp
    M llvm/tools/llvm-jitlink/llvm-jitlink.cpp
    M llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
    M llvm/tools/llvm-mc/llvm-mc.cpp
    M llvm/tools/llvm-mca/llvm-mca.cpp
    M llvm/tools/llvm-ml/Disassembler.cpp
    M llvm/tools/llvm-ml/llvm-ml.cpp
    M llvm/tools/llvm-objdump/MachODump.cpp
    M llvm/tools/llvm-objdump/llvm-objdump.cpp
    M llvm/tools/llvm-profgen/ProfiledBinary.cpp
    M llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
    M llvm/tools/sancov/sancov.cpp
    M llvm/unittests/CodeGen/MachineInstrTest.cpp
    M llvm/unittests/CodeGen/MachineOperandTest.cpp
    M llvm/unittests/CodeGen/TestAsmPrinter.cpp
    M llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
    M llvm/unittests/MC/DwarfLineTables.cpp
    M llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
    M mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp

  Log Message:
  -----------
  [MC] Untangle MCContext and MCObjectFileInfo

This untangles the MCContext and the MCObjectFileInfo. There is a circular
dependency between MCContext and MCObjectFileInfo. Currently this dependency
also exists during construction: You can't contruct a MOFI without a MCContext
without constructing the MCContext with a dummy version of that MOFI first.
This removes this dependency during construction. In a perfect world,
MCObjectFileInfo wouldn't depend on MCContext at all, but only be stored in the
MCContext, like other MC information. This is future work.

This also shifts/adds more information to the MCContext making it more
available to the different targets. Namely:

- TargetTriple
- ObjectFileType
- SubtargetInfo

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D101462




More information about the All-commits mailing list