[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-31 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. In D101921#2786245 , @MaskRay wrote: > Because of `new MCObjectFileInfo`, we cannot use a forward declaration > (incomplete class) to replace `#include "llvm/MC/MCObjectFileInfo.h"` in > `TargetRegistry.h`. > > I thought about

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-28 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added subscribers: compnerd, dblaikie. MaskRay added a comment. Because of `new MCObjectFileInfo`, we cannot use a forward declaration (incomplete class) to replace `#include "llvm/MC/MCObjectFileInfo.h"` in `TargetRegistry.h`. I thought about moving `TargetRegistry.{h,cpp}` from

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-26 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 added inline comments. Comment at: llvm/include/llvm/Support/TargetRegistry.h:26 #include "llvm/ADT/iterator_range.h" +#include "llvm/MC/MCObjectFileInfo.h" #include "llvm/Support/CodeGen.h" flip1995 wrote: > MaskRay wrote: > >

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-26 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 added inline comments. Comment at: llvm/include/llvm/Support/TargetRegistry.h:26 #include "llvm/ADT/iterator_range.h" +#include "llvm/MC/MCObjectFileInfo.h" #include "llvm/Support/CodeGen.h" MaskRay wrote: > `include/llvm/Support/TargetRegistry.h now

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-25 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: llvm/include/llvm/Support/TargetRegistry.h:26 #include "llvm/ADT/iterator_range.h" +#include "llvm/MC/MCObjectFileInfo.h" #include "llvm/Support/CodeGen.h" `include/llvm/Support/TargetRegistry.h now has cyclic

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-24 Thread Fangrui Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc2f819af73c5: [MC] Refactor MCObjectFileInfo initialization and allow targets to create… (authored by flip1995, committed by MaskRay). Repository:

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-21 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. This revision is now accepted and ready to land. LGTM. This looks like an improvement because it avoids a temporary `MCObjectFileInfo MOFI;` (which appeared to be initialized in two subsequent calls) in numerous places. Repository: rG

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-14 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 updated this revision to Diff 345432. flip1995 added a comment. - [MC] Don't check if constructed MOFI is a nullptr Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101921/new/ https://reviews.llvm.org/D101921 Files:

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-13 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 added a comment. In D101921#2754426 , @MaskRay wrote: > Can `createMCObjectFileInfo` return `MCObjectFileInfo` instead of > `std::unique_ptr`? `createMCObjectfileInfo` returns a `MCObjectFileInfo *` similar to every other `create*` function

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-13 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Can `createMCObjectFileInfo` return `MCObjectFileInfo` instead of `std::unique_ptr`? Comment at: clang/lib/Parse/ParseStmtAsm.cpp:590 + if (!MAI || !MII || !MOFI || !STI) { Diag(AsmLoc, diag::err_msasm_unable_to_create_target)

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-13 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 updated this revision to Diff 344849. flip1995 added a comment. Herald added subscribers: lldb-commits, atanasyan, jrtc27. Herald added a project: LLDB. rebased and addressed review comments: - [MC] Remove MOFI argument from MCContext constructor - [MC] Remove getTextSectionAlignment

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-12 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 marked an inline comment as done. flip1995 added inline comments. Comment at: clang/tools/driver/cc1as_main.cpp:407 - MOFI->initMCObjectFileInfo(Ctx, PIC); + // FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and + // MCObjectFileInfo needs a

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/tools/driver/cc1as_main.cpp:407 - MOFI->initMCObjectFileInfo(Ctx, PIC); + // FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and + // MCObjectFileInfo needs a MCContext reference in order to initialize

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: llvm/include/llvm/MC/MCObjectFileInfo.h:255 + virtual unsigned getTextSectionAlignment() const { return 4; } MCSection *getTextSection() const { return TextSection; } This should be moved to D102052

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-07 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 updated this revision to Diff 343605. flip1995 added a comment. Remove redundant item names in doc comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101921/new/ https://reviews.llvm.org/D101921 Files:

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-07 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 added a comment. In D101921#2743735 , @MaskRay wrote: > Can you post the RISCV patch depending on this one? Yes, sure. See https://reviews.llvm.org/D102052. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-07 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 added inline comments. Comment at: llvm/lib/DWARFLinker/DWARFStreamer.cpp:57 - MOFI.reset(new MCObjectFileInfo); - MC.reset( - new MCContext(TheTriple, MAI.get(), MRI.get(), MOFI.get(), MSTI.get())); - MOFI->initMCObjectFileInfo(*MC, /*PIC=*/false); +

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-07 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 added a comment. In D101921#2743735 , @MaskRay wrote: > Can you post the RISCV patch depending on this one? Yes, sure. See https://reviews.llvm.org/D102052. Comment at: llvm/include/llvm/Support/TargetRegistry.h:1029 +///

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-07 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Can you post the RISCV patch depending on this one? Comment at: llvm/include/llvm/Support/TargetRegistry.h:1029 +/// RegisterMCObjectFileInfo - Helper template for registering a target object +/// file info implementation. This invokes the static

[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

2021-05-06 Thread Philipp Krones via Phabricator via cfe-commits
flip1995 created this revision. Herald added subscribers: dcaballe, cota, teijeong, dexonsmith, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, csigg, antiagainst, shauheen, rriddle, mehdi_amini, rupprecht, gbedwell,