[llvm] [NameAnonGlobals] Mark the pass as required (PR #78161)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 15 05:42:12 PST 2024


https://github.com/nikic created https://github.com/llvm/llvm-project/pull/78161

NameAnonGlobals is required when emitting ThinLTO bitcode, otherwise the bitcode writer will crash.

>From eae24361422578e154e774441a120d3f047a9494 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Mon, 15 Jan 2024 14:40:56 +0100
Subject: [PATCH] [NameAnonGlobals] Mark the pass as required

NameAnonGlobals is required when emitting ThinLTO bitcode,
otherwise the bitcode writer will crash.
---
 llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h b/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h
index a59f9bc3ebfb32f..b1c181c1211b487 100644
--- a/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h
+++ b/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h
@@ -24,6 +24,8 @@ class NameAnonGlobalPass : public PassInfoMixin<NameAnonGlobalPass> {
   NameAnonGlobalPass() = default;
 
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
+
+  static bool isRequired() { return true; }
 };
 
 } // end namespace llvm



More information about the llvm-commits mailing list