[llvm] [MC] Add MCFragment allocation helpers (PR #95197)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 01:00:34 PDT 2024


================
@@ -90,6 +90,12 @@ class MCObjectStreamer : public MCStreamer {
 
   MCFragment *getCurrentFragment() const;
 
+  template <typename F, typename... Args> F *allocAndAdd(Args &&...args) {
+    F *Frag = new F(std::forward<Args>(args)...);
----------------
aengelke wrote:

Use allocFragment from context?

https://github.com/llvm/llvm-project/pull/95197


More information about the llvm-commits mailing list