clang API Documentation

MangleNumberingContext.h
Go to the documentation of this file.
00001 //=== MangleNumberingContext.h - Context for mangling numbers ---*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 //  This file defines the LambdaBlockMangleContext interface, which keeps track
00011 //  of the Itanium C++ ABI mangling numbers for lambda expressions and block
00012 //  literals.
00013 //
00014 //===----------------------------------------------------------------------===//
00015 #ifndef LLVM_CLANG_AST_MANGLENUMBERINGCONTEXT_H
00016 #define LLVM_CLANG_AST_MANGLENUMBERINGCONTEXT_H
00017 
00018 #include "clang/Basic/LLVM.h"
00019 #include "llvm/ADT/DenseMap.h"
00020 #include "llvm/ADT/IntrusiveRefCntPtr.h"
00021 
00022 namespace clang {
00023 
00024 class BlockDecl;
00025 class CXXMethodDecl;
00026 class IdentifierInfo;
00027 class TagDecl;
00028 class Type;
00029 class VarDecl;
00030 
00031 /// \brief Keeps track of the mangled names of lambda expressions and block
00032 /// literals within a particular context.
00033 class MangleNumberingContext : public RefCountedBase<MangleNumberingContext> {
00034 public:
00035   virtual ~MangleNumberingContext() {}
00036 
00037   /// \brief Retrieve the mangling number of a new lambda expression with the
00038   /// given call operator within this context.
00039   virtual unsigned getManglingNumber(const CXXMethodDecl *CallOperator) = 0;
00040 
00041   /// \brief Retrieve the mangling number of a new block literal within this
00042   /// context.
00043   virtual unsigned getManglingNumber(const BlockDecl *BD) = 0;
00044 
00045   /// Static locals are numbered by source order.
00046   virtual unsigned getStaticLocalNumber(const VarDecl *VD) = 0;
00047 
00048   /// \brief Retrieve the mangling number of a static local variable within
00049   /// this context.
00050   virtual unsigned getManglingNumber(const VarDecl *VD,
00051                                      unsigned MSLocalManglingNumber) = 0;
00052 
00053   /// \brief Retrieve the mangling number of a static local variable within
00054   /// this context.
00055   virtual unsigned getManglingNumber(const TagDecl *TD,
00056                                      unsigned MSLocalManglingNumber) = 0;
00057 };
00058 
00059 } // end namespace clang
00060 #endif