Path: blob/main/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangUtil.h
39654 views
//===-- ClangUtil.h ---------------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6// A collection of helper methods and data structures for manipulating clang7// types and decls.8//===----------------------------------------------------------------------===//910#ifndef LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGUTIL_H11#define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGUTIL_H1213#include "clang/AST/DeclBase.h"14#include "clang/AST/Type.h"1516#include "lldb/Symbol/CompilerType.h"1718namespace clang {19class TagDecl;20}2122namespace lldb_private {23struct ClangUtil {24static bool IsClangType(const CompilerType &ct);2526/// Returns the clang::Decl of the given CompilerDecl.27/// CompilerDecl has to be valid and represent a clang::Decl.28static clang::Decl *GetDecl(const CompilerDecl &decl);2930static clang::QualType GetQualType(const CompilerType &ct);3132static clang::QualType GetCanonicalQualType(const CompilerType &ct);3334static CompilerType RemoveFastQualifiers(const CompilerType &ct);3536static clang::TagDecl *GetAsTagDecl(const CompilerType &type);3738/// Returns a textual representation of the given Decl's AST. Does not39/// deserialize any child nodes.40static std::string DumpDecl(const clang::Decl *d);41/// Returns a textual representation of the given type.42static std::string ToString(const clang::Type *t);43/// Returns a textual representation of the given CompilerType (assuming44/// its underlying type is a Clang type).45static std::string ToString(const CompilerType &c);46};47}4849#endif505152