1 //=== MangleNumberingContext.h - Context for mangling numbers ---*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines the LambdaBlockMangleContext interface, which keeps track
10 // of the Itanium C++ ABI mangling numbers for lambda expressions and block
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_AST_MANGLENUMBERINGCONTEXT_H
15 #define LLVM_CLANG_AST_MANGLENUMBERINGCONTEXT_H
17 #include "clang/Basic/LLVM.h"
18 #include "llvm/ADT/IntrusiveRefCntPtr.h"
29 /// Keeps track of the mangled names of lambda expressions and block
30 /// literals within a particular context.
31 class MangleNumberingContext {
33 virtual ~MangleNumberingContext() {}
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;
39 /// Retrieve the mangling number of a new block literal within this
41 virtual unsigned getManglingNumber(const BlockDecl *BD) = 0;
43 /// Static locals are numbered by source order.
44 virtual unsigned getStaticLocalNumber(const VarDecl *VD) = 0;
46 /// Retrieve the mangling number of a static local variable within
48 virtual unsigned getManglingNumber(const VarDecl *VD,
49 unsigned MSLocalManglingNumber) = 0;
51 /// Retrieve the mangling number of a static local variable within
53 virtual unsigned getManglingNumber(const TagDecl *TD,
54 unsigned MSLocalManglingNumber) = 0;
57 } // end namespace clang