// Part of the Crubit project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#ifndef DEVTOOLS_RUST_CC_INTEROP_LIFETIME_ANALYSIS_TEMPLATE_PLACEHOLDER_SUPPORT_H_
#define DEVTOOLS_RUST_CC_INTEROP_LIFETIME_ANALYSIS_TEMPLATE_PLACEHOLDER_SUPPORT_H_

#include <functional>
#include <string>

#include "clang/AST/Decl.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/Error.h"

namespace clang {
namespace tidy {
namespace lifetimes {

struct GeneratedCode {
  std::string filename;
  std::string code;
};

// Generates a source code that includes the original code for `tu`
// and also has explicit template instantiation code with placeholder
// classes for the templates in `templates`.
// For example, if the main file for the `tu` has the filename
// "original-file.cc" and looks like the following:
//
//    template <typename T>
//    T* target(T* t) {
//      return t;
//    }
//
//  This will generate and return the code like the following
//  (actual generated placeholder classnames will be more cryptic than `T0`):
//
//    #include "original-file.cc"
//    struct T0 {};
//    template T0* target<T0>(T0* t);
//
llvm::Expected<GeneratedCode> GenerateTemplateInstantiationCode(
    const clang::TranslationUnitDecl* tu,
    const llvm::DenseMap<clang::FunctionTemplateDecl*,
                         const clang::FunctionDecl*>& templates);

// Runs the given `operation` on the `code` with `filename`. The `code` is
// turned into a memory-backed file on a memory filesystem overlaid on top
// of the original filesystem that's being used by `original_context`.
void RunToolOnCodeWithOverlay(
    clang::ASTContext& original_context, const std::string& filename,
    const std::string& code, std::function<void(clang::ASTContext&)> operation);

}  // namespace lifetimes
}  // namespace tidy
}  // namespace clang

#endif  // DEVTOOLS_RUST_CC_INTEROP_LIFETIME_ANALYSIS_TEMPLATE_PLACEHOLDER_SUPPORT_H_
