Daniel Dunbar | 3845f86 | 2008-10-31 03:54:29 +0000 | [diff] [blame] | 1 | //===--- CGDebugInfo.h - DebugInfo for LLVM CodeGen -------------*- C++ -*-===// |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 10 | // This is the source level debug info generator for llvm translation. |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef CLANG_CODEGEN_CGDEBUGINFO_H |
| 15 | #define CLANG_CODEGEN_CGDEBUGINFO_H |
| 16 | |
Sanjiv Gupta | 1c6a38b | 2008-05-25 05:15:42 +0000 | [diff] [blame] | 17 | #include "clang/AST/Type.h" |
Mike Stump | b1a6e68 | 2009-09-30 02:43:10 +0000 | [diff] [blame] | 18 | #include "clang/AST/Expr.h" |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 19 | #include "clang/Basic/SourceLocation.h" |
Chris Lattner | 9c85ba3 | 2008-11-10 06:08:34 +0000 | [diff] [blame] | 20 | #include "llvm/ADT/DenseMap.h" |
| 21 | #include "llvm/Analysis/DebugInfo.h" |
Daniel Dunbar | 23e81ba | 2009-09-19 19:27:24 +0000 | [diff] [blame] | 22 | #include "llvm/Support/ValueHandle.h" |
Devang Patel | 9c6c3a0 | 2010-01-14 00:36:21 +0000 | [diff] [blame] | 23 | #include "llvm/Support/Allocator.h" |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 24 | |
Daniel Dunbar | 45d196b | 2008-11-01 01:53:16 +0000 | [diff] [blame] | 25 | #include "CGBuilder.h" |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 26 | |
Daniel Dunbar | 23e81ba | 2009-09-19 19:27:24 +0000 | [diff] [blame] | 27 | namespace llvm { |
| 28 | class MDNode; |
| 29 | } |
| 30 | |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 31 | namespace clang { |
Sanjiv Gupta | cc9b163 | 2008-05-30 10:30:31 +0000 | [diff] [blame] | 32 | class VarDecl; |
Devang Patel | 9ca36b6 | 2009-02-26 21:10:26 +0000 | [diff] [blame] | 33 | class ObjCInterfaceDecl; |
Daniel Dunbar | 45d196b | 2008-11-01 01:53:16 +0000 | [diff] [blame] | 34 | |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 35 | namespace CodeGen { |
| 36 | class CodeGenModule; |
Mike Stump | b1a6e68 | 2009-09-30 02:43:10 +0000 | [diff] [blame] | 37 | class CodeGenFunction; |
Devang Patel | 9c6c3a0 | 2010-01-14 00:36:21 +0000 | [diff] [blame] | 38 | class GlobalDecl; |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 39 | |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 40 | /// CGDebugInfo - This class gathers all debug information during compilation |
| 41 | /// and is responsible for emitting to llvm globals or pass directly to |
Sanjiv Gupta | 1c6a38b | 2008-05-25 05:15:42 +0000 | [diff] [blame] | 42 | /// the backend. |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 43 | class CGDebugInfo { |
Anders Carlsson | 20f12a2 | 2009-12-06 18:00:51 +0000 | [diff] [blame] | 44 | CodeGenModule &CGM; |
Chris Lattner | 9c85ba3 | 2008-11-10 06:08:34 +0000 | [diff] [blame] | 45 | llvm::DIFactory DebugFactory; |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 46 | llvm::DICompileUnit TheCU; |
Chris Lattner | 9c85ba3 | 2008-11-10 06:08:34 +0000 | [diff] [blame] | 47 | SourceLocation CurLoc, PrevLoc; |
Devang Patel | 4ce3f20 | 2010-01-28 18:11:52 +0000 | [diff] [blame] | 48 | llvm::DIType VTablePtrType; |
Devang Patel | 7573f8b | 2010-03-09 21:32:27 +0000 | [diff] [blame] | 49 | /// FwdDeclCount - This counter is used to ensure unique names for forward |
| 50 | /// record decls. |
| 51 | unsigned FwdDeclCount; |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 52 | |
Sanjiv Gupta | 1c6a38b | 2008-05-25 05:15:42 +0000 | [diff] [blame] | 53 | /// TypeCache - Cache of previously constructed Types. |
Ted Kremenek | 590838b | 2010-03-29 18:29:57 +0000 | [diff] [blame] | 54 | llvm::DenseMap<void *, llvm::WeakVH> TypeCache; |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 55 | |
Mike Stump | 9bc093c | 2009-05-14 02:03:51 +0000 | [diff] [blame] | 56 | bool BlockLiteralGenericSet; |
| 57 | llvm::DIType BlockLiteralGeneric; |
| 58 | |
Devang Patel | 8fae060 | 2009-11-13 19:10:24 +0000 | [diff] [blame] | 59 | std::vector<llvm::TrackingVH<llvm::MDNode> > RegionStack; |
Devang Patel | 3dd96a1 | 2010-01-29 18:11:03 +0000 | [diff] [blame] | 60 | llvm::DenseMap<const Decl *, llvm::WeakVH> RegionMap; |
Eli Friedman | 3f2af10 | 2008-05-22 01:40:10 +0000 | [diff] [blame] | 61 | |
Devang Patel | 89f05f8 | 2010-01-28 18:21:00 +0000 | [diff] [blame] | 62 | /// DebugInfoNames - This is a storage for names that are |
Devang Patel | 9c6c3a0 | 2010-01-14 00:36:21 +0000 | [diff] [blame] | 63 | /// constructed on demand. For example, C++ destructors, C++ operators etc.. |
Devang Patel | 89f05f8 | 2010-01-28 18:21:00 +0000 | [diff] [blame] | 64 | llvm::BumpPtrAllocator DebugInfoNames; |
Devang Patel | 9c6c3a0 | 2010-01-14 00:36:21 +0000 | [diff] [blame] | 65 | |
Ted Kremenek | 9c25039 | 2010-03-30 00:27:51 +0000 | [diff] [blame] | 66 | llvm::DenseMap<const char *, llvm::WeakVH> DIFileCache; |
Devang Patel | 4125fd2 | 2010-01-19 01:54:44 +0000 | [diff] [blame] | 67 | llvm::DenseMap<const FunctionDecl *, llvm::WeakVH> SPCache; |
Devang Patel | abb485f | 2010-02-01 19:16:32 +0000 | [diff] [blame] | 68 | llvm::DenseMap<const NamespaceDecl *, llvm::WeakVH> NameSpaceCache; |
Devang Patel | 4125fd2 | 2010-01-19 01:54:44 +0000 | [diff] [blame] | 69 | |
Sanjiv Gupta | 1c6a38b | 2008-05-25 05:15:42 +0000 | [diff] [blame] | 70 | /// Helper functions for getOrCreateType. |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 71 | llvm::DIType CreateType(const BuiltinType *Ty, llvm::DIFile F); |
| 72 | llvm::DIType CreateType(const ComplexType *Ty, llvm::DIFile F); |
| 73 | llvm::DIType CreateQualifiedType(QualType Ty, llvm::DIFile F); |
| 74 | llvm::DIType CreateType(const TypedefType *Ty, llvm::DIFile F); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 75 | llvm::DIType CreateType(const ObjCObjectPointerType *Ty, |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 76 | llvm::DIFile F); |
| 77 | llvm::DIType CreateType(const PointerType *Ty, llvm::DIFile F); |
| 78 | llvm::DIType CreateType(const BlockPointerType *Ty, llvm::DIFile F); |
| 79 | llvm::DIType CreateType(const FunctionType *Ty, llvm::DIFile F); |
| 80 | llvm::DIType CreateType(const TagType *Ty, llvm::DIFile F); |
| 81 | llvm::DIType CreateType(const RecordType *Ty, llvm::DIFile F); |
| 82 | llvm::DIType CreateType(const ObjCInterfaceType *Ty, llvm::DIFile F); |
John McCall | c12c5bb | 2010-05-15 11:32:37 +0000 | [diff] [blame] | 83 | llvm::DIType CreateType(const ObjCObjectType *Ty, llvm::DIFile F); |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 84 | llvm::DIType CreateType(const EnumType *Ty, llvm::DIFile F); |
| 85 | llvm::DIType CreateType(const VectorType *Ty, llvm::DIFile F); |
| 86 | llvm::DIType CreateType(const ArrayType *Ty, llvm::DIFile F); |
| 87 | llvm::DIType CreateType(const LValueReferenceType *Ty, llvm::DIFile F); |
| 88 | llvm::DIType CreateType(const MemberPointerType *Ty, llvm::DIFile F); |
Devang Patel | a6da192 | 2010-01-28 00:28:01 +0000 | [diff] [blame] | 89 | llvm::DIType getOrCreateMethodType(const CXXMethodDecl *Method, |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 90 | llvm::DIFile F); |
| 91 | llvm::DIType getOrCreateVTablePtrType(llvm::DIFile F); |
Devang Patel | abb485f | 2010-02-01 19:16:32 +0000 | [diff] [blame] | 92 | llvm::DINameSpace getOrCreateNameSpace(const NamespaceDecl *N, |
| 93 | llvm::DIDescriptor Unit); |
| 94 | |
Anders Carlsson | a031b35 | 2009-11-06 19:19:55 +0000 | [diff] [blame] | 95 | llvm::DIType CreatePointerLikeType(unsigned Tag, |
| 96 | const Type *Ty, QualType PointeeTy, |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 97 | llvm::DIFile F); |
Anders Carlsson | d6f9a0d | 2010-01-26 04:49:33 +0000 | [diff] [blame] | 98 | |
Anders Carlsson | 4433f1c | 2010-01-26 05:19:50 +0000 | [diff] [blame] | 99 | llvm::DISubprogram CreateCXXMemberFunction(const CXXMethodDecl *Method, |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 100 | llvm::DIFile F, |
Anders Carlsson | d6f9a0d | 2010-01-26 04:49:33 +0000 | [diff] [blame] | 101 | llvm::DICompositeType &RecordTy); |
| 102 | |
Devang Patel | 4125fd2 | 2010-01-19 01:54:44 +0000 | [diff] [blame] | 103 | void CollectCXXMemberFunctions(const CXXRecordDecl *Decl, |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 104 | llvm::DIFile F, |
Devang Patel | 4125fd2 | 2010-01-19 01:54:44 +0000 | [diff] [blame] | 105 | llvm::SmallVectorImpl<llvm::DIDescriptor> &E, |
| 106 | llvm::DICompositeType &T); |
Devang Patel | a245c5b | 2010-01-25 23:32:18 +0000 | [diff] [blame] | 107 | void CollectCXXBases(const CXXRecordDecl *Decl, |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 108 | llvm::DIFile F, |
Devang Patel | a245c5b | 2010-01-25 23:32:18 +0000 | [diff] [blame] | 109 | llvm::SmallVectorImpl<llvm::DIDescriptor> &EltTys, |
| 110 | llvm::DICompositeType &RecordTy); |
| 111 | |
| 112 | |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 113 | void CollectRecordFields(const RecordDecl *Decl, llvm::DIFile F, |
Devang Patel | 428deb5 | 2010-01-19 00:00:59 +0000 | [diff] [blame] | 114 | llvm::SmallVectorImpl<llvm::DIDescriptor> &E); |
Devang Patel | 4ce3f20 | 2010-01-28 18:11:52 +0000 | [diff] [blame] | 115 | |
Anders Carlsson | 046c294 | 2010-04-17 20:15:18 +0000 | [diff] [blame] | 116 | void CollectVTableInfo(const CXXRecordDecl *Decl, |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 117 | llvm::DIFile F, |
Devang Patel | 4ce3f20 | 2010-01-28 18:11:52 +0000 | [diff] [blame] | 118 | llvm::SmallVectorImpl<llvm::DIDescriptor> &EltTys); |
| 119 | |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 120 | public: |
Anders Carlsson | 20f12a2 | 2009-12-06 18:00:51 +0000 | [diff] [blame] | 121 | CGDebugInfo(CodeGenModule &CGM); |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 122 | ~CGDebugInfo(); |
| 123 | |
Daniel Dunbar | 66031a5 | 2008-10-17 16:15:48 +0000 | [diff] [blame] | 124 | /// setLocation - Update the current source location. If \arg loc is |
| 125 | /// invalid it is ignored. |
Chris Lattner | 9c85ba3 | 2008-11-10 06:08:34 +0000 | [diff] [blame] | 126 | void setLocation(SourceLocation Loc); |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 127 | |
| 128 | /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of |
| 129 | /// source line. |
Devang Patel | 4d939e6 | 2010-07-20 22:20:10 +0000 | [diff] [blame] | 130 | void EmitStopPoint(CGBuilderTy &Builder); |
Sanjiv Gupta | 1c6a38b | 2008-05-25 05:15:42 +0000 | [diff] [blame] | 131 | |
| 132 | /// EmitFunctionStart - Emit a call to llvm.dbg.function.start to indicate |
Daniel Dunbar | 2284ac9 | 2008-10-18 18:22:23 +0000 | [diff] [blame] | 133 | /// start of a new function. |
Devang Patel | 9c6c3a0 | 2010-01-14 00:36:21 +0000 | [diff] [blame] | 134 | void EmitFunctionStart(GlobalDecl GD, QualType FnType, |
Daniel Dunbar | 45d196b | 2008-11-01 01:53:16 +0000 | [diff] [blame] | 135 | llvm::Function *Fn, CGBuilderTy &Builder); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 136 | |
Sanjiv Gupta | 1c6a38b | 2008-05-25 05:15:42 +0000 | [diff] [blame] | 137 | /// EmitRegionStart - Emit a call to llvm.dbg.region.start to indicate start |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 138 | /// of a new block. |
Devang Patel | 4d939e6 | 2010-07-20 22:20:10 +0000 | [diff] [blame] | 139 | void EmitRegionStart(CGBuilderTy &Builder); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 140 | |
| 141 | /// EmitRegionEnd - Emit call to llvm.dbg.region.end to indicate end of a |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 142 | /// block. |
Devang Patel | 4d939e6 | 2010-07-20 22:20:10 +0000 | [diff] [blame] | 143 | void EmitRegionEnd(CGBuilderTy &Builder); |
Sanjiv Gupta | cc9b163 | 2008-05-30 10:30:31 +0000 | [diff] [blame] | 144 | |
Chris Lattner | 9c85ba3 | 2008-11-10 06:08:34 +0000 | [diff] [blame] | 145 | /// EmitDeclareOfAutoVariable - Emit call to llvm.dbg.declare for an automatic |
| 146 | /// variable declaration. |
| 147 | void EmitDeclareOfAutoVariable(const VarDecl *Decl, llvm::Value *AI, |
| 148 | CGBuilderTy &Builder); |
Sanjiv Gupta | 686226b | 2008-06-05 08:59:10 +0000 | [diff] [blame] | 149 | |
Mike Stump | b1a6e68 | 2009-09-30 02:43:10 +0000 | [diff] [blame] | 150 | /// EmitDeclareOfBlockDeclRefVariable - Emit call to llvm.dbg.declare for an |
| 151 | /// imported variable declaration in a block. |
| 152 | void EmitDeclareOfBlockDeclRefVariable(const BlockDeclRefExpr *BDRE, |
| 153 | llvm::Value *AI, |
| 154 | CGBuilderTy &Builder, |
| 155 | CodeGenFunction *CGF); |
| 156 | |
Chris Lattner | 9c85ba3 | 2008-11-10 06:08:34 +0000 | [diff] [blame] | 157 | /// EmitDeclareOfArgVariable - Emit call to llvm.dbg.declare for an argument |
| 158 | /// variable declaration. |
| 159 | void EmitDeclareOfArgVariable(const VarDecl *Decl, llvm::Value *AI, |
| 160 | CGBuilderTy &Builder); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 161 | |
Sanjiv Gupta | 686226b | 2008-06-05 08:59:10 +0000 | [diff] [blame] | 162 | /// EmitGlobalVariable - Emit information about a global variable. |
Chris Lattner | 9c85ba3 | 2008-11-10 06:08:34 +0000 | [diff] [blame] | 163 | void EmitGlobalVariable(llvm::GlobalVariable *GV, const VarDecl *Decl); |
Devang Patel | 9ca36b6 | 2009-02-26 21:10:26 +0000 | [diff] [blame] | 164 | |
| 165 | /// EmitGlobalVariable - Emit information about an objective-c interface. |
| 166 | void EmitGlobalVariable(llvm::GlobalVariable *GV, ObjCInterfaceDecl *Decl); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 167 | |
Chris Lattner | 86cd8af | 2008-11-03 09:11:11 +0000 | [diff] [blame] | 168 | private: |
Chris Lattner | 9c85ba3 | 2008-11-10 06:08:34 +0000 | [diff] [blame] | 169 | /// EmitDeclare - Emit call to llvm.dbg.declare for a variable declaration. |
| 170 | void EmitDeclare(const VarDecl *decl, unsigned Tag, llvm::Value *AI, |
| 171 | CGBuilderTy &Builder); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 172 | |
Mike Stump | b1a6e68 | 2009-09-30 02:43:10 +0000 | [diff] [blame] | 173 | /// EmitDeclare - Emit call to llvm.dbg.declare for a variable declaration. |
| 174 | void EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag, llvm::Value *AI, |
| 175 | CGBuilderTy &Builder, CodeGenFunction *CGF); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 176 | |
Devang Patel | 809b9bb | 2010-02-10 18:49:08 +0000 | [diff] [blame] | 177 | // EmitTypeForVarWithBlocksAttr - Build up structure info for the byref. |
| 178 | // See BuildByRefType. |
| 179 | llvm::DIType EmitTypeForVarWithBlocksAttr(const ValueDecl *VD, |
| 180 | uint64_t *OffSet); |
| 181 | |
Devang Patel | 3358305 | 2010-01-28 23:15:27 +0000 | [diff] [blame] | 182 | /// getContextDescriptor - Get context info for the decl. |
Devang Patel | 3dd96a1 | 2010-01-29 18:11:03 +0000 | [diff] [blame] | 183 | llvm::DIDescriptor getContextDescriptor(const Decl *Decl, |
Devang Patel | 3358305 | 2010-01-28 23:15:27 +0000 | [diff] [blame] | 184 | llvm::DIDescriptor &CU); |
Devang Patel | 979ec2e | 2009-10-06 00:35:31 +0000 | [diff] [blame] | 185 | |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 186 | /// CreateCompileUnit - Create new compile unit. |
| 187 | void CreateCompileUnit(); |
| 188 | |
| 189 | /// getOrCreateFile - Get the file debug info descriptor for the input |
| 190 | /// location. |
| 191 | llvm::DIFile getOrCreateFile(SourceLocation Loc); |
Sanjiv Gupta | 1c6a38b | 2008-05-25 05:15:42 +0000 | [diff] [blame] | 192 | |
| 193 | /// getOrCreateType - Get the type from the cache or create a new type if |
| 194 | /// necessary. |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 195 | llvm::DIType getOrCreateType(QualType Ty, llvm::DIFile F); |
Daniel Dunbar | 03faac3 | 2009-09-19 19:27:14 +0000 | [diff] [blame] | 196 | |
| 197 | /// CreateTypeNode - Create type metadata for a source language type. |
Devang Patel | 1780055 | 2010-03-09 00:44:50 +0000 | [diff] [blame] | 198 | llvm::DIType CreateTypeNode(QualType Ty, llvm::DIFile F); |
Devang Patel | 9c6c3a0 | 2010-01-14 00:36:21 +0000 | [diff] [blame] | 199 | |
Benjamin Kramer | d3651cc | 2010-04-24 20:26:20 +0000 | [diff] [blame] | 200 | /// CreateMemberType - Create new member and increase Offset by FType's size. |
Benjamin Kramer | 48c70f6 | 2010-04-24 20:19:58 +0000 | [diff] [blame] | 201 | llvm::DIType CreateMemberType(llvm::DIFile Unit, QualType FType, |
| 202 | llvm::StringRef Name, uint64_t *Offset); |
| 203 | |
Devang Patel | 9c6c3a0 | 2010-01-14 00:36:21 +0000 | [diff] [blame] | 204 | /// getFunctionName - Get function name for the given FunctionDecl. If the |
| 205 | /// name is constructred on demand (e.g. C++ destructor) then the name |
| 206 | /// is stored on the side. |
| 207 | llvm::StringRef getFunctionName(const FunctionDecl *FD); |
Devang Patel | 4ce3f20 | 2010-01-28 18:11:52 +0000 | [diff] [blame] | 208 | |
Devang Patel | 700a1cb | 2010-07-20 20:24:18 +0000 | [diff] [blame] | 209 | /// getClassName - Get class name including template argument list. |
| 210 | llvm::StringRef getClassName(RecordDecl *RD); |
| 211 | |
Anders Carlsson | 046c294 | 2010-04-17 20:15:18 +0000 | [diff] [blame] | 212 | /// getVTableName - Get vtable name for the given Class. |
| 213 | llvm::StringRef getVTableName(const CXXRecordDecl *Decl); |
Devang Patel | 4ce3f20 | 2010-01-28 18:11:52 +0000 | [diff] [blame] | 214 | |
Devang Patel | 8ab870d | 2010-05-12 23:46:38 +0000 | [diff] [blame] | 215 | /// getLineNumber - Get line number for the location. If location is invalid |
| 216 | /// then use current location. |
| 217 | unsigned getLineNumber(SourceLocation Loc); |
| 218 | |
| 219 | /// getColumnNumber - Get column number for the location. If location is |
| 220 | /// invalid then use current location. |
| 221 | unsigned getColumnNumber(SourceLocation Loc); |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 222 | }; |
| 223 | } // namespace CodeGen |
| 224 | } // namespace clang |
| 225 | |
Devang Patel | bbd9fa4 | 2009-10-06 18:36:08 +0000 | [diff] [blame] | 226 | |
Sanjiv Gupta | e8b9f5b | 2008-05-08 08:54:20 +0000 | [diff] [blame] | 227 | #endif |