[clang] Clean up strange uses of getAnalysisIfAvailable (PR #65729)

Björn Pettersson via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 11 02:08:09 PDT 2023


================
@@ -261,7 +261,7 @@ bool VirtRegRewriter::runOnMachineFunction(MachineFunction &fn) {
   Indexes = &getAnalysis<SlotIndexes>();
   LIS = &getAnalysis<LiveIntervals>();
   VRM = &getAnalysis<VirtRegMap>();
-  DebugVars = getAnalysisIfAvailable<LiveDebugVariables>();
+  DebugVars = &getAnalysis<LiveDebugVariables>();
----------------
bjope wrote:

Not sure how to add a comment on line 278 if I want to suggest an edit on that line (in Phabricator it would have been easy). But I guess the check if DebugVars is null or not on line 278 is redundant now.

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


More information about the cfe-commits mailing list