CGDebugInfo.h revision 9a84529ed075d8047bb93f278a9da5e417fd71f3
17f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei//===--- CGDebugInfo.h - DebugInfo for LLVM CodeGen -------------*- C++ -*-===//
27f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei//
37f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei//                     The LLVM Compiler Infrastructure
47f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei//
57f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei// This file is distributed under the University of Illinois Open Source
67f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei// License. See LICENSE.TXT for details.
77f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei//
87f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei//===----------------------------------------------------------------------===//
97f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei//
107f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei// This is the source level debug info generator for llvm translation.
117f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei//
127f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei//===----------------------------------------------------------------------===//
137f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
147f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#ifndef CLANG_CODEGEN_CGDEBUGINFO_H
157f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#define CLANG_CODEGEN_CGDEBUGINFO_H
167f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
177f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#include "CGBuilder.h"
187f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#include "clang/AST/Expr.h"
197f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#include "clang/AST/Type.h"
207f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#include "clang/Basic/SourceLocation.h"
2113c976710415041fca5aba25cc02d3813c74b990Eric Christopher#include "clang/Frontend/CodeGenOptions.h"
227f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#include "llvm/ADT/DenseMap.h"
237f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#include "llvm/DIBuilder.h"
247f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#include "llvm/DebugInfo.h"
257f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#include "llvm/Support/Allocator.h"
267f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#include "llvm/Support/ValueHandle.h"
277f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
287f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyeinamespace llvm {
297f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  class MDNode;
307f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei}
317f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
327f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyeinamespace clang {
337f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  class CXXMethodDecl;
347f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  class VarDecl;
357f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  class ObjCInterfaceDecl;
364919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl  class ObjCIvarDecl;
377f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  class ClassTemplateSpecializationDecl;
387f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  class GlobalDecl;
399faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie  class UsingDecl;
407f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
417f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyeinamespace CodeGen {
427f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  class CodeGenModule;
437f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  class CodeGenFunction;
447f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  class CGBlockInfo;
457f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
467f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei/// CGDebugInfo - This class gathers all debug information during compilation
477f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei/// and is responsible for emitting to llvm globals or pass directly to
487f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei/// the backend.
497f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyeiclass CGDebugInfo {
507f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  CodeGenModule &CGM;
513a7d82c4852dfd1e78f7ce7bdd94cc5eb1e4a0bcEric Christopher  const CodeGenOptions::DebugInfoKind DebugKind;
527f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIBuilder DBuilder;
537f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DICompileUnit TheCU;
547f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  SourceLocation CurLoc, PrevLoc;
557f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType VTablePtrType;
567f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType ClassTy;
57f068c92f22cc5c42433f5bd37b000a714a56670fEric Christopher  llvm::DICompositeType ObjTy;
587f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType SelTy;
59b13621d08e20ac7aa550e05896de8a57ee99c1e8Guy Benyei  llvm::DIType OCLImage1dDITy, OCLImage1dArrayDITy, OCLImage1dBufferDITy;
60b13621d08e20ac7aa550e05896de8a57ee99c1e8Guy Benyei  llvm::DIType OCLImage2dDITy, OCLImage2dArrayDITy;
61b13621d08e20ac7aa550e05896de8a57ee99c1e8Guy Benyei  llvm::DIType OCLImage3dDITy;
62e6b9d802fb7b16d93474c4f1c179ab36202e8a8bGuy Benyei  llvm::DIType OCLEventDITy;
637c811dc4874124ea083a2f812d227cf53027290bEric Christopher
647f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// TypeCache - Cache of previously constructed Types.
657f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DenseMap<void *, llvm::WeakVH> TypeCache;
667f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
674919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl  /// ObjCInterfaceCache - Cache of previously constructed interfaces
684919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl  /// which may change. Storing a pair of DIType and checksum.
694919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl  llvm::DenseMap<void *, std::pair<llvm::WeakVH, unsigned > >
704919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl    ObjCInterfaceCache;
714919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl
72ebbd7e07aa0f22722da6ed8dd3a55beed9699171Adrian Prantl  /// RetainedTypes - list of interfaces we want to keep even if orphaned.
73ebbd7e07aa0f22722da6ed8dd3a55beed9699171Adrian Prantl  std::vector<void *> RetainedTypes;
74ebbd7e07aa0f22722da6ed8dd3a55beed9699171Adrian Prantl
757f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// CompleteTypeCache - Cache of previously constructed complete RecordTypes.
767f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DenseMap<void *, llvm::WeakVH> CompletedTypeCache;
777f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
787f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// ReplaceMap - Cache of forward declared types to RAUW at the end of
797f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// compilation.
807f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  std::vector<std::pair<void *, llvm::WeakVH> >ReplaceMap;
817f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
827f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  bool BlockLiteralGenericSet;
837f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType BlockLiteralGeneric;
847f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
857f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  // LexicalBlockStack - Keep track of our current nested lexical block.
867f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  std::vector<llvm::TrackingVH<llvm::MDNode> > LexicalBlockStack;
877f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DenseMap<const Decl *, llvm::WeakVH> RegionMap;
887f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  // FnBeginRegionCount - Keep track of LexicalBlockStack counter at the
897f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  // beginning of a function. This is used to pop unbalanced regions at
907f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  // the end of a function.
917f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  std::vector<unsigned> FnBeginRegionCount;
927f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
937f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// DebugInfoNames - This is a storage for names that are
947f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// constructed on demand. For example, C++ destructors, C++ operators etc..
957f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::BumpPtrAllocator DebugInfoNames;
967f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  StringRef CWDName;
977f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
987f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DenseMap<const char *, llvm::WeakVH> DIFileCache;
997f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DenseMap<const FunctionDecl *, llvm::WeakVH> SPCache;
1009faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie  /// \brief Cache declarations relevant to DW_TAG_imported_declarations (C++
1019faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie  /// using declarations) that aren't covered by other more specific caches.
1029faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie  llvm::DenseMap<const Decl *, llvm::WeakVH> DeclCache;
1037f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DenseMap<const NamespaceDecl *, llvm::WeakVH> NameSpaceCache;
104fc46ebc2b1345723a894ae352cfb206c1d930295David Blaikie  llvm::DenseMap<const NamespaceAliasDecl *, llvm::WeakVH> NamespaceAliasCache;
1050395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher  llvm::DenseMap<const Decl *, llvm::WeakVH> StaticDataMemberCache;
1067f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
1077f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// Helper functions for getOrCreateType.
1084919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl  unsigned Checksum(const ObjCInterfaceDecl *InterfaceDecl);
1097f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const BuiltinType *Ty);
1107f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const ComplexType *Ty);
1117f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateQualifiedType(QualType Ty, llvm::DIFile F);
1127f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const TypedefType *Ty, llvm::DIFile F);
1137f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const ObjCObjectPointerType *Ty,
1147f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                          llvm::DIFile F);
1157f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const PointerType *Ty, llvm::DIFile F);
1167f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const BlockPointerType *Ty, llvm::DIFile F);
1177f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const FunctionType *Ty, llvm::DIFile F);
1187f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const RecordType *Ty);
1197f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateLimitedType(const RecordType *Ty);
1207f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const ObjCInterfaceType *Ty, llvm::DIFile F);
1217f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const ObjCObjectType *Ty, llvm::DIFile F);
1227f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const VectorType *Ty, llvm::DIFile F);
1237f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const ArrayType *Ty, llvm::DIFile F);
1247f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const LValueReferenceType *Ty, llvm::DIFile F);
1257f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const RValueReferenceType *Ty, llvm::DIFile Unit);
1267f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const MemberPointerType *Ty, llvm::DIFile F);
1277f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateType(const AtomicType *Ty, llvm::DIFile F);
1287f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateEnumType(const EnumDecl *ED);
129e86fcc46f560b8e0e13e13a7a1854658b231b2eaAdrian Prantl  llvm::DIType CreateSelfType(const QualType &QualTy, llvm::DIType Ty);
1307f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType getTypeOrNull(const QualType);
1317f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType getCompletedTypeOrNull(const QualType);
1329a84529ed075d8047bb93f278a9da5e417fd71f3David Blaikie  llvm::DICompositeType getOrCreateMethodType(const CXXMethodDecl *Method,
1339a84529ed075d8047bb93f278a9da5e417fd71f3David Blaikie                                              llvm::DIFile F);
1349a84529ed075d8047bb93f278a9da5e417fd71f3David Blaikie  llvm::DICompositeType getOrCreateInstanceMethodType(
1359c78f9bddc42dbdeb05a7183b4770d33b0bda7d3David Blaikie      QualType ThisPtr, const FunctionProtoType *Func, llvm::DIFile Unit);
1369a84529ed075d8047bb93f278a9da5e417fd71f3David Blaikie  llvm::DICompositeType getOrCreateFunctionType(const Decl *D, QualType FnType,
1379a84529ed075d8047bb93f278a9da5e417fd71f3David Blaikie                                                llvm::DIFile F);
1387f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType getOrCreateVTablePtrType(llvm::DIFile F);
1397f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DINameSpace getOrCreateNameSpace(const NamespaceDecl *N);
1407f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreatePointeeType(QualType PointeeTy, llvm::DIFile F);
1417f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreatePointerLikeType(unsigned Tag,
1427f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                     const Type *Ty, QualType PointeeTy,
1437f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                     llvm::DIFile F);
144b13621d08e20ac7aa550e05896de8a57ee99c1e8Guy Benyei
145ebbd7e07aa0f22722da6ed8dd3a55beed9699171Adrian Prantl  llvm::Value *getCachedInterfaceTypeOrNull(const QualType Ty);
146b13621d08e20ac7aa550e05896de8a57ee99c1e8Guy Benyei  llvm::DIType getOrCreateStructPtrType(StringRef Name, llvm::DIType &Cache);
147b13621d08e20ac7aa550e05896de8a57ee99c1e8Guy Benyei
1487f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DISubprogram CreateCXXMemberFunction(const CXXMethodDecl *Method,
1497f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                             llvm::DIFile F,
1507f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                             llvm::DIType RecordTy);
1517c811dc4874124ea083a2f812d227cf53027290bEric Christopher
1527f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void CollectCXXMemberFunctions(const CXXRecordDecl *Decl,
1537f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                 llvm::DIFile F,
1547f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                 SmallVectorImpl<llvm::Value *> &E,
1557f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                 llvm::DIType T);
1567f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
1577f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void CollectCXXFriends(const CXXRecordDecl *Decl,
1587f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                       llvm::DIFile F,
1597f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                       SmallVectorImpl<llvm::Value *> &EltTys,
1607f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                       llvm::DIType RecordTy);
1617f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
1627f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void CollectCXXBases(const CXXRecordDecl *Decl,
1637f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                       llvm::DIFile F,
1647f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                       SmallVectorImpl<llvm::Value *> &EltTys,
1657f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                       llvm::DIType RecordTy);
1667c811dc4874124ea083a2f812d227cf53027290bEric Christopher
1677f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIArray
1687f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  CollectTemplateParams(const TemplateParameterList *TPList,
1697f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                        const TemplateArgumentList &TAList,
1707f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                        llvm::DIFile Unit);
1717f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIArray
1727f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  CollectFunctionTemplateParams(const FunctionDecl *FD, llvm::DIFile Unit);
1737c811dc4874124ea083a2f812d227cf53027290bEric Christopher  llvm::DIArray
1747f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  CollectCXXTemplateParams(const ClassTemplateSpecializationDecl *TS,
1757f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                           llvm::DIFile F);
1767f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
1777f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType createFieldType(StringRef name, QualType type,
1787f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                               uint64_t sizeInBitsOverride, SourceLocation loc,
1797f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                               AccessSpecifier AS, uint64_t offsetInBits,
1807f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                               llvm::DIFile tunit,
1817f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                               llvm::DIDescriptor scope);
1820395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher
1830395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher  // Helpers for collecting fields of a record.
1840395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher  void CollectRecordLambdaFields(const CXXRecordDecl *CXXDecl,
1850395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher                                 SmallVectorImpl<llvm::Value *> &E,
1860395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher                                 llvm::DIType RecordTy);
1870395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher  void CollectRecordStaticField(const VarDecl *Var,
1880395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher                                SmallVectorImpl<llvm::Value *> &E,
1890395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher                                llvm::DIType RecordTy);
1900395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher  void CollectRecordNormalField(const FieldDecl *Field, uint64_t OffsetInBits,
1910395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher                                llvm::DIFile F,
1920395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher                                SmallVectorImpl<llvm::Value *> &E,
1930395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher                                llvm::DIType RecordTy);
1947f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void CollectRecordFields(const RecordDecl *Decl, llvm::DIFile F,
1957f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                           SmallVectorImpl<llvm::Value *> &E,
1967f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                           llvm::DIType RecordTy);
1977f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
1987f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void CollectVTableInfo(const CXXRecordDecl *Decl,
1997f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                         llvm::DIFile F,
2007f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                         SmallVectorImpl<llvm::Value *> &EltTys);
2017f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2027f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  // CreateLexicalBlock - Create a new lexical block node and push it on
2037f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  // the stack.
2047f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void CreateLexicalBlock(SourceLocation Loc);
2057c811dc4874124ea083a2f812d227cf53027290bEric Christopher
2067f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyeipublic:
2077f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  CGDebugInfo(CodeGenModule &CGM);
2087f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  ~CGDebugInfo();
2097f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2107f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void finalize();
2117f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2127f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// setLocation - Update the current source location. If \arg loc is
2137f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// invalid it is ignored.
2147f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void setLocation(SourceLocation Loc);
2157f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
21659f0a5a5481a6dcfafd092dd944e6cfb7d146d4cAdrian Prantl  /// getLocation - Return the current source location.
21759f0a5a5481a6dcfafd092dd944e6cfb7d146d4cAdrian Prantl  SourceLocation getLocation() const { return CurLoc; }
21859f0a5a5481a6dcfafd092dd944e6cfb7d146d4cAdrian Prantl
2197f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitLocation - Emit metadata to indicate a change in line/column
2207f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// information in the source file.
22100df5eaa9f4f7cc0809fd47c95311b532fbe63c6Adrian Prantl  /// \param ForceColumnInfo  Assume DebugColumnInfo option is true.
22200df5eaa9f4f7cc0809fd47c95311b532fbe63c6Adrian Prantl  void EmitLocation(CGBuilderTy &Builder, SourceLocation Loc,
22300df5eaa9f4f7cc0809fd47c95311b532fbe63c6Adrian Prantl                    bool ForceColumnInfo = false);
2247f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2257f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitFunctionStart - Emit a call to llvm.dbg.function.start to indicate
2267f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// start of a new function.
2277f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitFunctionStart(GlobalDecl GD, QualType FnType,
2287f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                         llvm::Function *Fn, CGBuilderTy &Builder);
2297f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2307f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitFunctionEnd - Constructs the debug code for exiting a function.
2317f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitFunctionEnd(CGBuilderTy &Builder);
2327f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2337f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitLexicalBlockStart - Emit metadata to indicate the beginning of a
2347f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// new lexical block and push the block onto the stack.
2357f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitLexicalBlockStart(CGBuilderTy &Builder, SourceLocation Loc);
2367f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2377f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitLexicalBlockEnd - Emit metadata to indicate the end of a new lexical
2387f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// block and pop the current block.
2397f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitLexicalBlockEnd(CGBuilderTy &Builder, SourceLocation Loc);
2407f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2417f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitDeclareOfAutoVariable - Emit call to llvm.dbg.declare for an automatic
2427f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// variable declaration.
2437f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitDeclareOfAutoVariable(const VarDecl *Decl, llvm::Value *AI,
2447f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                 CGBuilderTy &Builder);
2457f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2467f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitDeclareOfBlockDeclRefVariable - Emit call to llvm.dbg.declare for an
2477f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// imported variable declaration in a block.
2487f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitDeclareOfBlockDeclRefVariable(const VarDecl *variable,
2497f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                         llvm::Value *storage,
2507f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                         CGBuilderTy &Builder,
2517f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                         const CGBlockInfo &blockInfo);
2527f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2537f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitDeclareOfArgVariable - Emit call to llvm.dbg.declare for an argument
2547f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// variable declaration.
2557f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitDeclareOfArgVariable(const VarDecl *Decl, llvm::Value *AI,
2567f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                unsigned ArgNo, CGBuilderTy &Builder);
2577f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2587f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitDeclareOfBlockLiteralArgVariable - Emit call to
2597f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// llvm.dbg.declare for the block-literal argument to a block
2607f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// invocation function.
2617f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitDeclareOfBlockLiteralArgVariable(const CGBlockInfo &block,
262836e7c9357b312fd1ee5c90898ce2c81bb384997Adrian Prantl                                            llvm::Value *Arg,
263836e7c9357b312fd1ee5c90898ce2c81bb384997Adrian Prantl                                            llvm::Value *LocalAddr,
2647f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                            CGBuilderTy &Builder);
2657f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2667f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitGlobalVariable - Emit information about a global variable.
2677f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitGlobalVariable(llvm::GlobalVariable *GV, const VarDecl *Decl);
2687f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2697f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitGlobalVariable - Emit information about an objective-c interface.
2707f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitGlobalVariable(llvm::GlobalVariable *GV, ObjCInterfaceDecl *Decl);
2717f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2727f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitGlobalVariable - Emit global variable's debug info.
2737f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitGlobalVariable(const ValueDecl *VD, llvm::Constant *Init);
2747f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
275957dac5b6d826bc0c10011c8b5c3f1b8007fda41David Blaikie  /// \brief - Emit C++ using directive.
276957dac5b6d826bc0c10011c8b5c3f1b8007fda41David Blaikie  void EmitUsingDirective(const UsingDirectiveDecl &UD);
277957dac5b6d826bc0c10011c8b5c3f1b8007fda41David Blaikie
2789faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie  /// \brief - Emit C++ using declaration.
2799faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie  void EmitUsingDecl(const UsingDecl &UD);
2809faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie
281fc46ebc2b1345723a894ae352cfb206c1d930295David Blaikie  /// \brief - Emit C++ namespace alias.
282fc46ebc2b1345723a894ae352cfb206c1d930295David Blaikie  llvm::DIImportedEntity EmitNamespaceAlias(const NamespaceAliasDecl &NA);
283fc46ebc2b1345723a894ae352cfb206c1d930295David Blaikie
2847c811dc4874124ea083a2f812d227cf53027290bEric Christopher  /// getOrCreateRecordType - Emit record type's standalone debug info.
2857f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType getOrCreateRecordType(QualType Ty, SourceLocation L);
2867f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2877f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getOrCreateInterfaceType - Emit an objective c interface type standalone
2887f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// debug info.
2897f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType getOrCreateInterfaceType(QualType Ty,
29013c976710415041fca5aba25cc02d3813c74b990Eric Christopher                                        SourceLocation Loc);
2917f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2927f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyeiprivate:
2937f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// EmitDeclare - Emit call to llvm.dbg.declare for a variable declaration.
2947f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void EmitDeclare(const VarDecl *decl, unsigned Tag, llvm::Value *AI,
2957f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                   unsigned ArgNo, CGBuilderTy &Builder);
2967f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
2977c811dc4874124ea083a2f812d227cf53027290bEric Christopher  // EmitTypeForVarWithBlocksAttr - Build up structure info for the byref.
2987f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  // See BuildByRefType.
2997f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType EmitTypeForVarWithBlocksAttr(const VarDecl *VD,
3007f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                            uint64_t *OffSet);
3017f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3027f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getContextDescriptor - Get context info for the decl.
303bb00079d2ca77815efa0ab50cb10f302d1ae69e4David Blaikie  llvm::DIScope getContextDescriptor(const Decl *Decl);
3047f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3059faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie  llvm::DIScope getCurrentContextDescriptor(const Decl *Decl);
3069faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie
3077f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// createRecordFwdDecl - Create a forward decl for a RecordType in a given
3087f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// context.
3097f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType createRecordFwdDecl(const RecordDecl *, llvm::DIDescriptor);
3107c811dc4874124ea083a2f812d227cf53027290bEric Christopher
3117f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// createContextChain - Create a set of decls for the context chain.
3127f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIDescriptor createContextChain(const Decl *Decl);
3137f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3147f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getCurrentDirname - Return current directory name.
3157f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  StringRef getCurrentDirname();
3167f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3177f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// CreateCompileUnit - Create new compile unit.
3187f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  void CreateCompileUnit();
3197f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3207c811dc4874124ea083a2f812d227cf53027290bEric Christopher  /// getOrCreateFile - Get the file debug info descriptor for the input
3217f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// location.
3227f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIFile getOrCreateFile(SourceLocation Loc);
3237f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3247f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getOrCreateMainFile - Get the file info for main compile unit.
3257f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIFile getOrCreateMainFile();
3267f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3277f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getOrCreateType - Get the type from the cache or create a new type if
3287f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// necessary.
3297f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType getOrCreateType(QualType Ty, llvm::DIFile F);
3307f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3317f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getOrCreateLimitedType - Get the type from the cache or create a new
3327f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// partial type if necessary.
3337f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType getOrCreateLimitedType(QualType Ty, llvm::DIFile F);
3347f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3357f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// CreateTypeNode - Create type metadata for a source language type.
3367f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateTypeNode(QualType Ty, llvm::DIFile F);
3377f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3384919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl  /// getObjCInterfaceDecl - return the underlying ObjCInterfaceDecl
3394919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl  /// if Ty is an ObjCInterface or a pointer to one.
3404919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl  ObjCInterfaceDecl* getObjCInterfaceDecl(QualType Ty);
3414919de6a53a007487c6d6b173921b5e7152a2004Adrian Prantl
3427f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// CreateLimitedTypeNode - Create type metadata for a source language
3437f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// type, but only partial types for records.
3447f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateLimitedTypeNode(QualType Ty, llvm::DIFile F);
3457f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3467f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// CreateMemberType - Create new member and increase Offset by FType's size.
3477f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DIType CreateMemberType(llvm::DIFile Unit, QualType FType,
3487f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei                                StringRef Name, uint64_t *Offset);
3497f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3509faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie  /// \brief Retrieve the DIDescriptor, if any, for the canonical form of this
3519faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie  /// declaration.
3529faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie  llvm::DIDescriptor getDeclarationOrDefinition(const Decl *D);
3539faebd23fd69ac1591520e811dfa5b25f73012f3David Blaikie
3547f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getFunctionDeclaration - Return debug info descriptor to describe method
3557f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// declaration for the given method definition.
3567f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  llvm::DISubprogram getFunctionDeclaration(const Decl *D);
3577f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3580395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher  /// getStaticDataMemberDeclaration - Return debug info descriptor to
3590395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher  /// describe in-class static data member declaration for the given
3600395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher  /// out-of-class definition.
3610395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher  llvm::DIDerivedType getStaticDataMemberDeclaration(const Decl *D);
3620395de36004a718e265cc256b1bbee3bd3a791dcEric Christopher
3637f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getFunctionName - Get function name for the given FunctionDecl. If the
3647f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// name is constructred on demand (e.g. C++ destructor) then the name
3657f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// is stored on the side.
3667f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  StringRef getFunctionName(const FunctionDecl *FD);
3677f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3687f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getObjCMethodName - Returns the unmangled name of an Objective-C method.
3697c811dc4874124ea083a2f812d227cf53027290bEric Christopher  /// This is the display name for the debugging info.
3707f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  StringRef getObjCMethodName(const ObjCMethodDecl *FD);
3717f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3727f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getSelectorName - Return selector name. This is used for debugging
3737f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// info.
3747f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  StringRef getSelectorName(Selector S);
3757f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3767f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getClassName - Get class name including template argument list.
3777f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  StringRef getClassName(const RecordDecl *RD);
3787f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3797f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getVTableName - Get vtable name for the given Class.
3807f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  StringRef getVTableName(const CXXRecordDecl *Decl);
3817f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3827f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// getLineNumber - Get line number for the location. If location is invalid
3837f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// then use current location.
3847f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  unsigned getLineNumber(SourceLocation Loc);
3857f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3867c811dc4874124ea083a2f812d227cf53027290bEric Christopher  /// getColumnNumber - Get column number for the location. If location is
3877f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei  /// invalid then use current location.
38800df5eaa9f4f7cc0809fd47c95311b532fbe63c6Adrian Prantl  /// \param Force  Assume DebugColumnInfo option is true.
38900df5eaa9f4f7cc0809fd47c95311b532fbe63c6Adrian Prantl  unsigned getColumnNumber(SourceLocation Loc, bool Force=false);
3907f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei};
3917f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei} // namespace CodeGen
3927f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei} // namespace clang
3937f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3947f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei
3957f92f2d8d9b7a07900c030183bc13a9ff60057ccGuy Benyei#endif
396