1//===- ExtractAPI/TypedefUnderlyingTypeResolver.h ---------------*- C++ -*-===// 2// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6// 7//===----------------------------------------------------------------------===// 8/// 9/// \file 10/// This file defines the UnderlyingTypeResolver which is a helper type for 11/// resolving the undelrying type for a given QualType and exposing that 12/// information in various forms. 13/// 14//===----------------------------------------------------------------------===// 15 16#ifndef LLVM_CLANG_UNDERLYING_TYPE_RESOLVER_H 17#define LLVM_CLANG_UNDERLYING_TYPE_RESOLVER_H 18 19#include "clang/AST/ASTContext.h" 20#include "clang/AST/Decl.h" 21#include "clang/ExtractAPI/API.h" 22 23#include <string> 24 25namespace clang { 26namespace extractapi { 27 28struct TypedefUnderlyingTypeResolver { 29 /// Gets the underlying type declaration. 30 const NamedDecl *getUnderlyingTypeDecl(QualType Type) const; 31 32 /// Get a SymbolReference for the given type. 33 SymbolReference getSymbolReferenceForType(QualType Type, APISet &API) const; 34 35 /// Get a USR for the given type. 36 std::string getUSRForType(QualType Type) const; 37 38 explicit TypedefUnderlyingTypeResolver(ASTContext &Context) 39 : Context(Context) {} 40 41private: 42 ASTContext &Context; 43}; 44 45} // namespace extractapi 46} // namespace clang 47 48#endif // LLVM_CLANG_UNDERLYING_TYPE_RESOLVER_H 49