================ @@ -0,0 +1,46 @@ +//===- ASTMapping.h - AST to SSAF Entity mapping ----------------*- 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 LLVM_CLANG_ANALYSIS_SCALABLE_ASTMAPPING_H +#define LLVM_CLANG_ANALYSIS_SCALABLE_ASTMAPPING_H + +#include "clang/Analysis/Scalable/Model/EntityName.h" +#include "clang/AST/Decl.h" +#include "llvm/ADT/StringRef.h" +#include <optional> + +namespace clang { +namespace ssaf { + +/// Maps a declaration to an EntityName. +/// +/// Supported declaration types for entity mapping: +/// - Functions and methods +/// - Global Variables +/// - Function parameters +/// - Struct/class/union type definitions +/// - Struct/class/union fields +/// +/// Implicit declarations and compiler builtins are not mapped. +/// +/// \param D The declaration to map. Must not be null. +/// +/// \return An EntityName if the declaration can be mapped, std::nullopt otherwise. +std::optional<EntityName> getLocalEntityNameForDecl(const Decl* D); + +/// Maps a function return type to an EntityName. ---------------- ymand wrote:
I think it would help to spell out in more detail what you mean/why this specialization is necessary. It's not really the type that's being identified, or you could just separately identify the type. It's specifically the return entity of this function. https://github.com/llvm/llvm-project/pull/169131 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
