aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/LambdaMangleContext.h
blob: bbaee26494a927ab7fa3f743dc93337a53fffc87 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//===--- LambdaMangleContext.h - Context for mangling lambdas ---*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This file defines the LambdaMangleContext interface, which keeps track of
//  the Itanium C++ ABI mangling numbers for lambda expressions.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_LAMBDAMANGLECONTEXT_H
#define LLVM_CLANG_LAMBDAMANGLECONTEXT_H

#include "clang/Basic/LLVM.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"

namespace clang {

class CXXMethodDecl;
class FunctionProtoType;

/// \brief Keeps track of the mangled names of lambda expressions within a
/// particular context.
class LambdaMangleContext : public RefCountedBase<LambdaMangleContext> {
  llvm::DenseMap<const FunctionProtoType *, unsigned> ManglingNumbers;
  
public:
  /// \brief Retrieve the mangling number of a new lambda expression with the
  /// given call operator within this lambda context.
  unsigned getManglingNumber(CXXMethodDecl *CallOperator);
};
  
} // end namespace clang
#endif