clang 23.0.0git
MacroBase.h
Go to the documentation of this file.
1//===--- MacroBase.h - Forward declarations for macros ----------*- 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/// Forward-declares types that need PointerLikeTypeTraits.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_LEX_MACROBASE_H
15#define LLVM_CLANG_LEX_MACROBASE_H
16
17#include "llvm/Support/PointerLikeTypeTraits.h"
18
19namespace clang {
20class MacroInfo;
21} // namespace clang
22
23namespace llvm {
24template <> struct PointerLikeTypeTraits<::clang::MacroInfo *> {
25 static inline void *getAsVoidPointer(::clang::MacroInfo *P) { return P; }
26 static inline ::clang::MacroInfo *getFromVoidPointer(void *P) {
27 return static_cast<::clang::MacroInfo *>(P);
28 }
29 static constexpr int NumLowBitsAvailable = 2;
30};
31
32template <> struct PointerLikeTypeTraits<const ::clang::MacroInfo *> {
33 static inline const void *getAsVoidPointer(const ::clang::MacroInfo *P) {
34 return P;
35 }
36 static inline const ::clang::MacroInfo *getFromVoidPointer(const void *P) {
37 return static_cast<const ::clang::MacroInfo *>(P);
38 }
39 static constexpr int NumLowBitsAvailable = 2;
40};
41} // namespace llvm
42
43#endif // LLVM_CLANG_LEX_MACROBASE_H
Encapsulates the data about a macro definition (e.g.
Definition MacroInfo.h:40
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30
static const ::clang::MacroInfo * getFromVoidPointer(const void *P)
Definition MacroBase.h:36
static const void * getAsVoidPointer(const ::clang::MacroInfo *P)
Definition MacroBase.h:33
static inline ::clang::MacroInfo * getFromVoidPointer(void *P)
Definition MacroBase.h:26
static void * getAsVoidPointer(::clang::MacroInfo *P)
Definition MacroBase.h:25