llvm/bolt/include/bolt/Passes/StackPointerTracking.h

//===- bolt/Passes/StackPointerTracking.h -----------------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//

#ifndef BOLT_PASSES_STACKPOINTERTRACKING_H
#define BOLT_PASSES_STACKPOINTERTRACKING_H

#include "bolt/Passes/DataflowAnalysis.h"
#include "llvm/Support/CommandLine.h"

namespace opts {
extern llvm::cl::opt<bool> TimeOpts;
} // namespace opts

namespace llvm {
namespace bolt {

/// Perform a dataflow analysis to track the value of SP as an offset relative
/// to the CFA.
template <typename Derived>
class StackPointerTrackingBase
    : public DataflowAnalysis<Derived, std::pair<int, int>> {};

class StackPointerTracking
    : public StackPointerTrackingBase<StackPointerTracking> {};

} // end namespace bolt

llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
                              const std::pair<int, int> &Val);

} // end namespace llvm

#endif