From 4ece50737d5385fb80cfa23f5297d1111f8eed39 Mon Sep 17 00:00:00 2001 From: OCHyams Date: Fri, 20 Jan 2023 14:19:14 +0000 Subject: [Assignment Tracking][NFC] Replace LLVM command line option with a module flag Remove LLVM flag -experimental-assignment-tracking. Assignment tracking is still enabled from Clang with the command line -Xclang -fexperimental-assignment-tracking which tells Clang to ask LLVM to run the pass declare-to-assign. That pass converts conventional debug intrinsics to assignment tracking metadata. With this patch it now also sets a module flag debug-info-assignment-tracking with the value `i1 true` (using the flag conflict rule `Max` since enabling assignment tracking on IR that contains only conventional debug intrinsics should cause no issues). Update the docs and tests too. Reviewed By: CarlosAlbertoEnciso Differential Revision: https://reviews.llvm.org/D142027 --- llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp') diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp index ba51c3b..16782a3 100644 --- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp +++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp @@ -2389,6 +2389,9 @@ static void analyzeFunction(Function &Fn, const DataLayout &Layout, } bool AssignmentTrackingAnalysis::runOnFunction(Function &F) { + if (!isAssignmentTrackingEnabled(*F.getParent())) + return false; + LLVM_DEBUG(dbgs() << "AssignmentTrackingAnalysis run on " << F.getName() << "\n"); auto DL = std::make_unique(F.getParent()); -- cgit v1.1