1303241Sdim//===-- ClangUtil.h ---------------------------------------------*- C++ -*-===// 2303241Sdim// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6303241Sdim// 7303241Sdim// A collection of helper methods and data structures for manipulating clang 8303241Sdim// types and decls. 9303241Sdim//===----------------------------------------------------------------------===// 10303241Sdim 11303241Sdim#ifndef LLDB_SYMBOL_CLANGUTIL_H 12303241Sdim#define LLDB_SYMBOL_CLANGUTIL_H 13303241Sdim 14360784Sdim#include "clang/AST/DeclBase.h" 15303241Sdim#include "clang/AST/Type.h" 16303241Sdim 17303241Sdim#include "lldb/Symbol/CompilerType.h" 18303241Sdim 19344779Sdimnamespace clang { 20344779Sdimclass TagDecl; 21344779Sdim} 22344779Sdim 23314564Sdimnamespace lldb_private { 24314564Sdimstruct ClangUtil { 25314564Sdim static bool IsClangType(const CompilerType &ct); 26303241Sdim 27314564Sdim static clang::QualType GetQualType(const CompilerType &ct); 28303241Sdim 29314564Sdim static clang::QualType GetCanonicalQualType(const CompilerType &ct); 30303241Sdim 31314564Sdim static CompilerType RemoveFastQualifiers(const CompilerType &ct); 32344779Sdim 33344779Sdim static clang::TagDecl *GetAsTagDecl(const CompilerType &type); 34360784Sdim 35360784Sdim /// Returns a textual representation of the given Decl's AST. Does not 36360784Sdim /// deserialize any child nodes. 37360784Sdim static std::string DumpDecl(const clang::Decl *d); 38360784Sdim /// Returns a textual representation of the given type. 39360784Sdim static std::string ToString(const clang::Type *t); 40360784Sdim /// Returns a textual representation of the given CompilerType (assuming 41360784Sdim /// its underlying type is a Clang type). 42360784Sdim static std::string ToString(const CompilerType &c); 43303241Sdim}; 44303241Sdim} 45303241Sdim 46303241Sdim#endif 47