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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 21:24:37 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)...);
----------------
MaskRay wrote:

Agree that allocAndAdd is not useful. Removed.

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


More information about the llvm-commits mailing list