diff options
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp index ad3ad99..eb37265 100644 --- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp +++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp @@ -1,3 +1,11 @@ +//===-- AssignmentTrackingAnalysis.cpp ------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + #include "llvm/CodeGen/AssignmentTrackingAnalysis.h" #include "LiveDebugValues/LiveDebugValues.h" #include "llvm/ADT/BitVector.h" @@ -2553,6 +2561,32 @@ static void analyzeFunction(Function &Fn, const DataLayout &Layout, } } +FunctionVarLocs +DebugAssignmentTrackingAnalysis::run(Function &F, + FunctionAnalysisManager &FAM) { + if (!isAssignmentTrackingEnabled(*F.getParent())) + return FunctionVarLocs(); + + auto &DL = F.getParent()->getDataLayout(); + + FunctionVarLocsBuilder Builder; + analyzeFunction(F, DL, &Builder); + + // Save these results. + FunctionVarLocs Results; + Results.init(Builder); + return Results; +} + +AnalysisKey DebugAssignmentTrackingAnalysis::Key; + +PreservedAnalyses +DebugAssignmentTrackingPrinterPass::run(Function &F, + FunctionAnalysisManager &FAM) { + FAM.getResult<DebugAssignmentTrackingAnalysis>(F).print(OS, F); + return PreservedAnalyses::all(); +} + bool AssignmentTrackingAnalysis::runOnFunction(Function &F) { if (!isAssignmentTrackingEnabled(*F.getParent())) return false; |