mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
ab125b35b0
Change company name to "rev.ng Labs Srl" in all license headers to reflect changed company name and legal status Add missing license headers to files that didn't have one
33 lines
819 B
C++
33 lines
819 B
C++
#pragma once
|
|
|
|
//
|
|
// Copyright rev.ng Labs Srl. See LICENSE.md for details.
|
|
//
|
|
#include <map>
|
|
|
|
#include "llvm/IR/Value.h"
|
|
#include "llvm/Pass.h"
|
|
|
|
#include "revng-c/ValueManipulationAnalysis/TypeColors.h"
|
|
|
|
/// Assign a type color for each Use and Value of a function
|
|
class ValueManipulationAnalysis : public llvm::FunctionPass {
|
|
public:
|
|
using ColorMapT = std::map<const llvm::Value *, const vma::ColorSet>;
|
|
static char ID;
|
|
|
|
// Ctors
|
|
ValueManipulationAnalysis() : llvm::FunctionPass(ID) {}
|
|
|
|
// FunctionPass methods
|
|
bool runOnFunction(llvm::Function &F) override;
|
|
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override;
|
|
|
|
/// ColorMap getter
|
|
///\return A map between `llvm::Value*`s and their type color
|
|
const ColorMapT &getColorMap() const { return ColorMap; }
|
|
|
|
private:
|
|
ColorMapT ColorMap;
|
|
};
|