flip1995 updated this revision to Diff 342352. flip1995 marked 3 inline comments as done. flip1995 edited the summary of this revision. flip1995 added a comment. Herald added subscribers: dcaballe, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, stephenneuendorffer, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, csigg, nicolasvasilache, antiagainst, shauheen, rriddle, mehdi_amini. Herald added a reviewer: herhut. Herald added a project: MLIR.
Rename InitMCObjectFileInfo and reorder arguments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101462/new/ https://reviews.llvm.org/D101462 Files: clang/lib/Parse/ParseStmtAsm.cpp clang/tools/driver/cc1as_main.cpp llvm/include/llvm/MC/MCObjectFileInfo.h llvm/lib/DWARFLinker/DWARFStreamer.cpp llvm/lib/MC/MCObjectFileInfo.cpp llvm/lib/Object/ModuleSymbolTable.cpp llvm/lib/Target/TargetLoweringObjectFile.cpp llvm/tools/llvm-dwp/llvm-dwp.cpp llvm/tools/llvm-exegesis/lib/SnippetFile.cpp llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp llvm/tools/llvm-mc/llvm-mc.cpp llvm/tools/llvm-mca/llvm-mca.cpp llvm/tools/llvm-ml/llvm-ml.cpp llvm/tools/llvm-objdump/llvm-objdump.cpp llvm/tools/llvm-profgen/ProfiledBinary.cpp llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
Index: mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp =================================================================== --- mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp +++ mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp @@ -169,8 +169,8 @@ mai->setRelaxELFRelocations(true); llvm::MCObjectFileInfo mofi; - llvm::MCContext ctx(mai.get(), mri.get(), &mofi, &srcMgr, &mcOptions); - mofi.InitMCObjectFileInfo(triple, false, ctx, false); + llvm::MCContext ctx(triple, mai.get(), mri.get(), &mofi, &srcMgr, &mcOptions); + mofi.initMCObjectFileInfo(ctx, /*PIC=*/false, /*LargeCodeModel=*/false); SmallString<128> cwd; if (!llvm::sys::fs::current_path(cwd)) Index: llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp =================================================================== --- llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp +++ llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp @@ -107,7 +107,7 @@ Ctx.reset(new MCContext(Triple, MUPMAI.get(), MRI.get(), &MOFI, MSTI.get(), &SrcMgr, &MCOptions)); - MOFI.InitMCObjectFileInfo(/*PIC=*/false, *Ctx, /*LargeCodeModel=*/false); + MOFI.initMCObjectFileInfo(*Ctx, /*PIC=*/false, /*LargeCodeModel=*/false); Str.reset(TheTarget->createNullStreamer(*Ctx)); Index: llvm/tools/llvm-profgen/ProfiledBinary.cpp =================================================================== --- llvm/tools/llvm-profgen/ProfiledBinary.cpp +++ llvm/tools/llvm-profgen/ProfiledBinary.cpp @@ -334,7 +334,7 @@ MCObjectFileInfo MOFI; MCContext Ctx(Triple(TripleName), AsmInfo.get(), MRI.get(), &MOFI, STI.get()); - MOFI.InitMCObjectFileInfo(/*PIC=*/false, Ctx); + MOFI.initMCObjectFileInfo(Ctx, /*PIC=*/false); DisAsm.reset(TheTarget->createMCDisassembler(*STI, Ctx)); if (!DisAsm) exitWithError("no disassembler for target " + TripleName, FileName); Index: llvm/tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- llvm/tools/llvm-objdump/llvm-objdump.cpp +++ llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -1579,7 +1579,7 @@ MCObjectFileInfo MOFI; MCContext Ctx(Triple(TripleName), AsmInfo.get(), MRI.get(), &MOFI, STI.get()); // FIXME: for now initialize MCObjectFileInfo with default values - MOFI.InitMCObjectFileInfo(/*PIC=*/false, Ctx); + MOFI.initMCObjectFileInfo(Ctx, /*PIC=*/false); std::unique_ptr<MCDisassembler> DisAsm( TheTarget->createMCDisassembler(*STI, Ctx)); Index: llvm/tools/llvm-ml/llvm-ml.cpp =================================================================== --- llvm/tools/llvm-ml/llvm-ml.cpp +++ llvm/tools/llvm-ml/llvm-ml.cpp @@ -283,7 +283,7 @@ // MCObjectFileInfo needs a MCContext reference in order to initialize itself. MCObjectFileInfo MOFI; MCContext Ctx(TheTriple, MAI.get(), MRI.get(), &MOFI, STI.get(), &SrcMgr); - MOFI.InitMCObjectFileInfo(/*PIC=*/false, Ctx, + MOFI.initMCObjectFileInfo(Ctx, /*PIC=*/false, /*LargeCodeModel=*/true); if (InputArgs.hasArg(OPT_save_temp_labels)) Index: llvm/tools/llvm-mca/llvm-mca.cpp =================================================================== --- llvm/tools/llvm-mca/llvm-mca.cpp +++ llvm/tools/llvm-mca/llvm-mca.cpp @@ -379,7 +379,7 @@ MCContext Ctx(TheTriple, MAI.get(), MRI.get(), &MOFI, STI.get(), &SrcMgr); - MOFI.InitMCObjectFileInfo(/*PIC=*/false, Ctx); + MOFI.initMCObjectFileInfo(Ctx, /*PIC=*/false); std::unique_ptr<buffer_ostream> BOS; Index: llvm/tools/llvm-mc/llvm-mc.cpp =================================================================== --- llvm/tools/llvm-mc/llvm-mc.cpp +++ llvm/tools/llvm-mc/llvm-mc.cpp @@ -397,7 +397,7 @@ MCObjectFileInfo MOFI; MCContext Ctx(TheTriple, MAI.get(), MRI.get(), &MOFI, STI.get(), &SrcMgr, &MCOptions); - MOFI.InitMCObjectFileInfo(PIC, Ctx, LargeCodeModel); + MOFI.initMCObjectFileInfo(Ctx, PIC, LargeCodeModel); if (SaveTempLabels) Ctx.setAllowTemporaryLabels(false); Index: llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp =================================================================== --- llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp +++ llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp @@ -176,7 +176,7 @@ MCObjectFileInfo MOFI; MCContext Ctx(TheTriple, MAI.get(), MRI.get(), &MOFI, STI.get(), &SrcMgr); static const bool UsePIC = false; - MOFI.InitMCObjectFileInfo(UsePIC, Ctx); + MOFI.initMCObjectFileInfo(Ctx, UsePIC); const unsigned OutputAsmVariant = 0; std::unique_ptr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo()); Index: llvm/tools/llvm-exegesis/lib/SnippetFile.cpp =================================================================== --- llvm/tools/llvm-exegesis/lib/SnippetFile.cpp +++ llvm/tools/llvm-exegesis/lib/SnippetFile.cpp @@ -136,7 +136,7 @@ TM.getMCRegisterInfo(), &ObjectFileInfo, TM.getMCSubtargetInfo()); Context.initInlineSourceManager(); - ObjectFileInfo.InitMCObjectFileInfo(/*PIC=*/false, Context); + ObjectFileInfo.initMCObjectFileInfo(Context, /*PIC=*/false); BenchmarkCodeStreamer Streamer(&Context, TM.getMCRegisterInfo(), &Result); std::string Error; Index: llvm/tools/llvm-dwp/llvm-dwp.cpp =================================================================== --- llvm/tools/llvm-dwp/llvm-dwp.cpp +++ llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -882,7 +882,7 @@ MCObjectFileInfo MOFI; MCContext MC(*ErrOrTriple, MAI.get(), MRI.get(), &MOFI, MSTI.get()); - MOFI.InitMCObjectFileInfo(/*PIC=*/false, MC); + MOFI.initMCObjectFileInfo(MC, /*PIC=*/false); MCTargetOptions Options; auto MAB = TheTarget->createMCAsmBackend(*MSTI, *MRI, Options); Index: llvm/lib/Target/TargetLoweringObjectFile.cpp =================================================================== --- llvm/lib/Target/TargetLoweringObjectFile.cpp +++ llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -44,7 +44,7 @@ // `Initialize` can be called more than once. delete Mang; Mang = new Mangler(); - InitMCObjectFileInfo(TM.isPositionIndependent(), ctx, + initMCObjectFileInfo(ctx, TM.isPositionIndependent(), TM.getCodeModel() == CodeModel::Large); // Reset various EH DWARF encodings. Index: llvm/lib/Object/ModuleSymbolTable.cpp =================================================================== --- llvm/lib/Object/ModuleSymbolTable.cpp +++ llvm/lib/Object/ModuleSymbolTable.cpp @@ -101,7 +101,7 @@ MCObjectFileInfo MOFI; MCContext MCCtx(TT, MAI.get(), MRI.get(), &MOFI, STI.get()); - MOFI.InitMCObjectFileInfo(/*PIC=*/false, MCCtx); + MOFI.initMCObjectFileInfo(MCCtx, /*PIC=*/false); MOFI.setSDKVersion(M.getSDKVersion()); RecordStreamer Streamer(MCCtx, M); T->createNullTargetStreamer(Streamer); Index: llvm/lib/MC/MCObjectFileInfo.cpp =================================================================== --- llvm/lib/MC/MCObjectFileInfo.cpp +++ llvm/lib/MC/MCObjectFileInfo.cpp @@ -959,10 +959,10 @@ /* MultiSymbolsAllowed */ true, ".dwmac", XCOFF::SSUBTYP_DWMAC); } -void MCObjectFileInfo::InitMCObjectFileInfo(bool PIC, MCContext &ctx, +void MCObjectFileInfo::initMCObjectFileInfo(MCContext &MCCtx, bool PIC, bool LargeCodeModel) { PositionIndependent = PIC; - Ctx = &ctx; + Ctx = &MCCtx; // Common. CommDirectiveSupportsAlignment = true; Index: llvm/lib/DWARFLinker/DWARFStreamer.cpp =================================================================== --- llvm/lib/DWARFLinker/DWARFStreamer.cpp +++ llvm/lib/DWARFLinker/DWARFStreamer.cpp @@ -57,7 +57,7 @@ MOFI.reset(new MCObjectFileInfo); MC.reset( new MCContext(TheTriple, MAI.get(), MRI.get(), MOFI.get(), MSTI.get())); - MOFI->InitMCObjectFileInfo(/*PIC=*/false, *MC); + MOFI->initMCObjectFileInfo(*MC, /*PIC=*/false); MAB = TheTarget->createMCAsmBackend(*MSTI, *MRI, MCOptions); if (!MAB) Index: llvm/include/llvm/MC/MCObjectFileInfo.h =================================================================== --- llvm/include/llvm/MC/MCObjectFileInfo.h +++ llvm/include/llvm/MC/MCObjectFileInfo.h @@ -227,7 +227,7 @@ MCSection *TOCBaseSection = nullptr; public: - void InitMCObjectFileInfo(bool PIC, MCContext &ctx, + void initMCObjectFileInfo(MCContext &MCCtx, bool PIC, bool LargeCodeModel = false); MCContext &getContext() const { return *Ctx; } Index: clang/tools/driver/cc1as_main.cpp =================================================================== --- clang/tools/driver/cc1as_main.cpp +++ clang/tools/driver/cc1as_main.cpp @@ -408,7 +408,7 @@ PIC = false; } - MOFI->InitMCObjectFileInfo(PIC, Ctx); + MOFI->initMCObjectFileInfo(Ctx, PIC); if (Opts.SaveTemporaryLabels) Ctx.setAllowTemporaryLabels(false); if (Opts.GenDwarfForAssembly) Index: clang/lib/Parse/ParseStmtAsm.cpp =================================================================== --- clang/lib/Parse/ParseStmtAsm.cpp +++ clang/lib/Parse/ParseStmtAsm.cpp @@ -590,7 +590,7 @@ llvm::SourceMgr TempSrcMgr; llvm::MCContext Ctx(TheTriple, MAI.get(), MRI.get(), MOFI.get(), STI.get(), &TempSrcMgr); - MOFI->InitMCObjectFileInfo(/*PIC=*/false, Ctx); + MOFI->initMCObjectFileInfo(Ctx, /*PIC=*/false); std::unique_ptr<llvm::MemoryBuffer> Buffer = llvm::MemoryBuffer::getMemBuffer(AsmString, "<MS inline asm>");
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits