aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/EphemeralValuesCache.cpp
blob: 8b68df46950e1c5cfdf5811a33a0b4601644ddb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//===- EphemeralValuesCache.cpp - Cache collecting ephemeral values -------===//
//
// 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/Analysis/EphemeralValuesCache.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/CodeMetrics.h"

namespace llvm {

void EphemeralValuesCache::collectEphemeralValues() {
  CodeMetrics::collectEphemeralValues(&F, &AC, EphValues);
  Collected = true;
}

AnalysisKey EphemeralValuesAnalysis::Key;

EphemeralValuesCache
EphemeralValuesAnalysis::run(Function &F, FunctionAnalysisManager &FAM) {
  auto &AC = FAM.getResult<AssumptionAnalysis>(F);
  return EphemeralValuesCache(F, AC);
}

} // namespace llvm