clang  14.0.0git
MangleNumberingContext.h
Go to the documentation of this file.
1 //=== MangleNumberingContext.h - Context for mangling numbers ---*- 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 // This file defines the LambdaBlockMangleContext interface, which keeps track
10 // of the Itanium C++ ABI mangling numbers for lambda expressions and block
11 // literals.
12 //
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_AST_MANGLENUMBERINGCONTEXT_H
15 #define LLVM_CLANG_AST_MANGLENUMBERINGCONTEXT_H
16 
17 #include "clang/Basic/LLVM.h"
18 #include "llvm/ADT/IntrusiveRefCntPtr.h"
19 
20 namespace clang {
21 
22 class BlockDecl;
23 class CXXMethodDecl;
24 class IdentifierInfo;
25 class TagDecl;
26 class Type;
27 class VarDecl;
28 
29 /// Keeps track of the mangled names of lambda expressions and block
30 /// literals within a particular context.
32 public:
34 
35  /// Retrieve the mangling number of a new lambda expression with the
36  /// given call operator within this context.
37  virtual unsigned getManglingNumber(const CXXMethodDecl *CallOperator) = 0;
38 
39  /// Retrieve the mangling number of a new block literal within this
40  /// context.
41  virtual unsigned getManglingNumber(const BlockDecl *BD) = 0;
42 
43  /// Static locals are numbered by source order.
44  virtual unsigned getStaticLocalNumber(const VarDecl *VD) = 0;
45 
46  /// Retrieve the mangling number of a static local variable within
47  /// this context.
48  virtual unsigned getManglingNumber(const VarDecl *VD,
49  unsigned MSLocalManglingNumber) = 0;
50 
51  /// Retrieve the mangling number of a static local variable within
52  /// this context.
53  virtual unsigned getManglingNumber(const TagDecl *TD,
54  unsigned MSLocalManglingNumber) = 0;
55 
56  /// Retrieve the mangling number of a new lambda expression with the
57  /// given call operator within the device context. No device number is
58  /// assigned if there's no device numbering context is associated.
59  virtual unsigned getDeviceManglingNumber(const CXXMethodDecl *) { return 0; }
60 };
61 
62 } // end namespace clang
63 #endif
clang::MangleNumberingContext::getManglingNumber
virtual unsigned getManglingNumber(const CXXMethodDecl *CallOperator)=0
Retrieve the mangling number of a new lambda expression with the given call operator within this cont...
clang::MangleNumberingContext::getDeviceManglingNumber
virtual unsigned getDeviceManglingNumber(const CXXMethodDecl *)
Retrieve the mangling number of a new lambda expression with the given call operator within the devic...
Definition: MangleNumberingContext.h:59
clang::BlockDecl
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4153
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:876
clang::TagDecl
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3328
clang::MangleNumberingContext::~MangleNumberingContext
virtual ~MangleNumberingContext()
Definition: MangleNumberingContext.h:33
clang::MangleNumberingContext::getStaticLocalNumber
virtual unsigned getStaticLocalNumber(const VarDecl *VD)=0
Static locals are numbered by source order.
LLVM.h
clang::MangleNumberingContext
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
Definition: MangleNumberingContext.h:31
clang
Definition: CalledOnceCheck.h:17
clang::CXXMethodDecl
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:1948
Type
MatchType Type
Definition: ASTMatchFinder.cpp:70