1 //=== MangleNumberingContext.h - Context for mangling numbers ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the LambdaBlockMangleContext interface, which keeps track
11 // of the Itanium C++ ABI mangling numbers for lambda expressions and block
14 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_MANGLENUMBERINGCONTEXT_H
16 #define LLVM_CLANG_MANGLENUMBERINGCONTEXT_H
18 #include "clang/Basic/LLVM.h"
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/ADT/IntrusiveRefCntPtr.h"
31 /// \brief Keeps track of the mangled names of lambda expressions and block
32 /// literals within a particular context.
33 class MangleNumberingContext
34 : public RefCountedBase<MangleNumberingContext> {
35 llvm::DenseMap<const Type *, unsigned> ManglingNumbers;
36 llvm::DenseMap<IdentifierInfo*, unsigned> TagManglingNumbers;
39 virtual ~MangleNumberingContext() {}
41 /// \brief Retrieve the mangling number of a new lambda expression with the
42 /// given call operator within this context.
43 unsigned getManglingNumber(const CXXMethodDecl *CallOperator);
45 /// \brief Retrieve the mangling number of a new block literal within this
47 unsigned getManglingNumber(const BlockDecl *BD);
49 /// \brief Retrieve the mangling number of a static local variable within
51 virtual unsigned getManglingNumber(const VarDecl *VD) = 0;
53 /// \brief Retrieve the mangling number of a static local variable within
55 unsigned getManglingNumber(const TagDecl *TD);
58 } // end namespace clang