Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

619 lines
30 KiB

  1. //===--- llvm/DIBuilder.h - Debug Information Builder -----------*- C++ -*-===//
  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. //
  10. // This file defines a DIBuilder that is useful for creating debugging
  11. // information entries in LLVM IR form.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_DIBUILDER_H
  15. #define LLVM_DIBUILDER_H
  16. #include "llvm/ADT/ArrayRef.h"
  17. #include "llvm/ADT/StringRef.h"
  18. #include "llvm/Support/DataTypes.h"
  19. namespace llvm {
  20. class BasicBlock;
  21. class Instruction;
  22. class Function;
  23. class Module;
  24. class Value;
  25. class LLVMContext;
  26. class MDNode;
  27. class StringRef;
  28. class DIBasicType;
  29. class DICompositeType;
  30. class DIDerivedType;
  31. class DIDescriptor;
  32. class DIFile;
  33. class DIEnumerator;
  34. class DIType;
  35. class DIArray;
  36. class DIGlobalVariable;
  37. class DIImportedModule;
  38. class DINameSpace;
  39. class DIVariable;
  40. class DISubrange;
  41. class DILexicalBlockFile;
  42. class DILexicalBlock;
  43. class DIScope;
  44. class DISubprogram;
  45. class DITemplateTypeParameter;
  46. class DITemplateValueParameter;
  47. class DIObjCProperty;
  48. class DIBuilder {
  49. private:
  50. Module &M;
  51. LLVMContext & VMContext;
  52. MDNode *TheCU;
  53. MDNode *TempEnumTypes;
  54. MDNode *TempRetainTypes;
  55. MDNode *TempSubprograms;
  56. MDNode *TempGVs;
  57. MDNode *TempImportedModules;
  58. Function *DeclareFn; // llvm.dbg.declare
  59. Function *ValueFn; // llvm.dbg.value
  60. SmallVector<Value *, 4> AllEnumTypes;
  61. SmallVector<Value *, 4> AllRetainTypes;
  62. SmallVector<Value *, 4> AllSubprograms;
  63. SmallVector<Value *, 4> AllGVs;
  64. SmallVector<Value *, 4> AllImportedModules;
  65. DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION;
  66. void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION;
  67. public:
  68. explicit DIBuilder(Module &M);
  69. const MDNode *getCU() { return TheCU; }
  70. enum ComplexAddrKind { OpPlus=1, OpDeref };
  71. /// finalize - Construct any deferred debug info descriptors.
  72. void finalize();
  73. /// createCompileUnit - A CompileUnit provides an anchor for all debugging
  74. /// information generated during this instance of compilation.
  75. /// @param Lang Source programming language, eg. dwarf::DW_LANG_C99
  76. /// @param File File name
  77. /// @param Dir Directory
  78. /// @param Producer String identify producer of debugging information.
  79. /// Usuall this is a compiler version string.
  80. /// @param isOptimized A boolean flag which indicates whether optimization
  81. /// is ON or not.
  82. /// @param Flags This string lists command line options. This string is
  83. /// directly embedded in debug info output which may be used
  84. /// by a tool analyzing generated debugging information.
  85. /// @param RV This indicates runtime version for languages like
  86. /// Objective-C.
  87. /// @param SplitName The name of the file that we'll split debug info out
  88. /// into.
  89. void createCompileUnit(unsigned Lang, StringRef File, StringRef Dir,
  90. StringRef Producer, bool isOptimized,
  91. StringRef Flags, unsigned RV,
  92. StringRef SplitName = StringRef());
  93. /// createFile - Create a file descriptor to hold debugging information
  94. /// for a file.
  95. DIFile createFile(StringRef Filename, StringRef Directory);
  96. /// createEnumerator - Create a single enumerator value.
  97. DIEnumerator createEnumerator(StringRef Name, uint64_t Val);
  98. /// createNullPtrType - Create C++0x nullptr type.
  99. DIType createNullPtrType(StringRef Name);
  100. /// createBasicType - Create debugging information entry for a basic
  101. /// type.
  102. /// @param Name Type name.
  103. /// @param SizeInBits Size of the type.
  104. /// @param AlignInBits Type alignment.
  105. /// @param Encoding DWARF encoding code, e.g. dwarf::DW_ATE_float.
  106. DIBasicType createBasicType(StringRef Name, uint64_t SizeInBits,
  107. uint64_t AlignInBits, unsigned Encoding);
  108. /// createQualifiedType - Create debugging information entry for a qualified
  109. /// type, e.g. 'const int'.
  110. /// @param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
  111. /// @param FromTy Base Type.
  112. DIDerivedType createQualifiedType(unsigned Tag, DIType FromTy);
  113. /// createPointerType - Create debugging information entry for a pointer.
  114. /// @param PointeeTy Type pointed by this pointer.
  115. /// @param SizeInBits Size.
  116. /// @param AlignInBits Alignment. (optional)
  117. /// @param Name Pointer type name. (optional)
  118. DIDerivedType
  119. createPointerType(DIType PointeeTy, uint64_t SizeInBits,
  120. uint64_t AlignInBits = 0, StringRef Name = StringRef());
  121. /// \brief Create debugging information entry for a pointer to member.
  122. /// @param PointeeTy Type pointed to by this pointer.
  123. /// @param Class Type for which this pointer points to members of.
  124. DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class);
  125. /// createReferenceType - Create debugging information entry for a c++
  126. /// style reference or rvalue reference type.
  127. DIDerivedType createReferenceType(unsigned Tag, DIType RTy);
  128. /// createTypedef - Create debugging information entry for a typedef.
  129. /// @param Ty Original type.
  130. /// @param Name Typedef name.
  131. /// @param File File where this type is defined.
  132. /// @param LineNo Line number.
  133. /// @param Context The surrounding context for the typedef.
  134. DIDerivedType createTypedef(DIType Ty, StringRef Name, DIFile File,
  135. unsigned LineNo, DIDescriptor Context);
  136. /// createFriend - Create debugging information entry for a 'friend'.
  137. DIType createFriend(DIType Ty, DIType FriendTy);
  138. /// createInheritance - Create debugging information entry to establish
  139. /// inheritance relationship between two types.
  140. /// @param Ty Original type.
  141. /// @param BaseTy Base type. Ty is inherits from base.
  142. /// @param BaseOffset Base offset.
  143. /// @param Flags Flags to describe inheritance attribute,
  144. /// e.g. private
  145. DIDerivedType createInheritance(DIType Ty, DIType BaseTy,
  146. uint64_t BaseOffset, unsigned Flags);
  147. /// createMemberType - Create debugging information entry for a member.
  148. /// @param Scope Member scope.
  149. /// @param Name Member name.
  150. /// @param File File where this member is defined.
  151. /// @param LineNo Line number.
  152. /// @param SizeInBits Member size.
  153. /// @param AlignInBits Member alignment.
  154. /// @param OffsetInBits Member offset.
  155. /// @param Flags Flags to encode member attribute, e.g. private
  156. /// @param Ty Parent type.
  157. DIDerivedType
  158. createMemberType(DIDescriptor Scope, StringRef Name, DIFile File,
  159. unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits,
  160. uint64_t OffsetInBits, unsigned Flags, DIType Ty);
  161. /// createStaticMemberType - Create debugging information entry for a
  162. /// C++ static data member.
  163. /// @param Scope Member scope.
  164. /// @param Name Member name.
  165. /// @param File File where this member is declared.
  166. /// @param LineNo Line number.
  167. /// @param Ty Type of the static member.
  168. /// @param Flags Flags to encode member attribute, e.g. private.
  169. /// @param Val Const initializer of the member.
  170. DIType createStaticMemberType(DIDescriptor Scope, StringRef Name,
  171. DIFile File, unsigned LineNo, DIType Ty,
  172. unsigned Flags, llvm::Value *Val);
  173. /// createObjCIVar - Create debugging information entry for Objective-C
  174. /// instance variable.
  175. /// @param Name Member name.
  176. /// @param File File where this member is defined.
  177. /// @param LineNo Line number.
  178. /// @param SizeInBits Member size.
  179. /// @param AlignInBits Member alignment.
  180. /// @param OffsetInBits Member offset.
  181. /// @param Flags Flags to encode member attribute, e.g. private
  182. /// @param Ty Parent type.
  183. /// @param PropertyName Name of the Objective C property associated with
  184. /// this ivar.
  185. /// @param PropertyGetterName Name of the Objective C property getter
  186. /// selector.
  187. /// @param PropertySetterName Name of the Objective C property setter
  188. /// selector.
  189. /// @param PropertyAttributes Objective C property attributes.
  190. DIType createObjCIVar(StringRef Name, DIFile File,
  191. unsigned LineNo, uint64_t SizeInBits,
  192. uint64_t AlignInBits, uint64_t OffsetInBits,
  193. unsigned Flags, DIType Ty,
  194. StringRef PropertyName = StringRef(),
  195. StringRef PropertyGetterName = StringRef(),
  196. StringRef PropertySetterName = StringRef(),
  197. unsigned PropertyAttributes = 0);
  198. /// createObjCIVar - Create debugging information entry for Objective-C
  199. /// instance variable.
  200. /// @param Name Member name.
  201. /// @param File File where this member is defined.
  202. /// @param LineNo Line number.
  203. /// @param SizeInBits Member size.
  204. /// @param AlignInBits Member alignment.
  205. /// @param OffsetInBits Member offset.
  206. /// @param Flags Flags to encode member attribute, e.g. private
  207. /// @param Ty Parent type.
  208. /// @param PropertyNode Property associated with this ivar.
  209. DIType createObjCIVar(StringRef Name, DIFile File,
  210. unsigned LineNo, uint64_t SizeInBits,
  211. uint64_t AlignInBits, uint64_t OffsetInBits,
  212. unsigned Flags, DIType Ty,
  213. MDNode *PropertyNode);
  214. /// createObjCProperty - Create debugging information entry for Objective-C
  215. /// property.
  216. /// @param Name Property name.
  217. /// @param File File where this property is defined.
  218. /// @param LineNumber Line number.
  219. /// @param GetterName Name of the Objective C property getter selector.
  220. /// @param SetterName Name of the Objective C property setter selector.
  221. /// @param PropertyAttributes Objective C property attributes.
  222. /// @param Ty Type.
  223. DIObjCProperty createObjCProperty(StringRef Name,
  224. DIFile File, unsigned LineNumber,
  225. StringRef GetterName,
  226. StringRef SetterName,
  227. unsigned PropertyAttributes,
  228. DIType Ty);
  229. /// createClassType - Create debugging information entry for a class.
  230. /// @param Scope Scope in which this class is defined.
  231. /// @param Name class name.
  232. /// @param File File where this member is defined.
  233. /// @param LineNumber Line number.
  234. /// @param SizeInBits Member size.
  235. /// @param AlignInBits Member alignment.
  236. /// @param OffsetInBits Member offset.
  237. /// @param Flags Flags to encode member attribute, e.g. private
  238. /// @param Elements class members.
  239. /// @param VTableHolder Debug info of the base class that contains vtable
  240. /// for this type. This is used in
  241. /// DW_AT_containing_type. See DWARF documentation
  242. /// for more info.
  243. /// @param TemplateParms Template type parameters.
  244. DICompositeType createClassType(DIDescriptor Scope, StringRef Name,
  245. DIFile File, unsigned LineNumber,
  246. uint64_t SizeInBits, uint64_t AlignInBits,
  247. uint64_t OffsetInBits, unsigned Flags,
  248. DIType DerivedFrom, DIArray Elements,
  249. MDNode *VTableHolder = 0,
  250. MDNode *TemplateParms = 0);
  251. /// createStructType - Create debugging information entry for a struct.
  252. /// @param Scope Scope in which this struct is defined.
  253. /// @param Name Struct name.
  254. /// @param File File where this member is defined.
  255. /// @param LineNumber Line number.
  256. /// @param SizeInBits Member size.
  257. /// @param AlignInBits Member alignment.
  258. /// @param Flags Flags to encode member attribute, e.g. private
  259. /// @param Elements Struct elements.
  260. /// @param RunTimeLang Optional parameter, Objective-C runtime version.
  261. DICompositeType createStructType(DIDescriptor Scope, StringRef Name,
  262. DIFile File, unsigned LineNumber,
  263. uint64_t SizeInBits, uint64_t AlignInBits,
  264. unsigned Flags, DIType DerivedFrom,
  265. DIArray Elements, unsigned RunTimeLang = 0,
  266. MDNode *VTableHolder = 0);
  267. /// createUnionType - Create debugging information entry for an union.
  268. /// @param Scope Scope in which this union is defined.
  269. /// @param Name Union name.
  270. /// @param File File where this member is defined.
  271. /// @param LineNumber Line number.
  272. /// @param SizeInBits Member size.
  273. /// @param AlignInBits Member alignment.
  274. /// @param Flags Flags to encode member attribute, e.g. private
  275. /// @param Elements Union elements.
  276. /// @param RunTimeLang Optional parameter, Objective-C runtime version.
  277. DICompositeType createUnionType(
  278. DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
  279. uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags,
  280. DIArray Elements, unsigned RunTimeLang = 0);
  281. /// createTemplateTypeParameter - Create debugging information for template
  282. /// type parameter.
  283. /// @param Scope Scope in which this type is defined.
  284. /// @param Name Type parameter name.
  285. /// @param Ty Parameter type.
  286. /// @param File File where this type parameter is defined.
  287. /// @param LineNo Line number.
  288. /// @param ColumnNo Column Number.
  289. DITemplateTypeParameter
  290. createTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
  291. MDNode *File = 0, unsigned LineNo = 0,
  292. unsigned ColumnNo = 0);
  293. /// createTemplateValueParameter - Create debugging information for template
  294. /// value parameter.
  295. /// @param Scope Scope in which this type is defined.
  296. /// @param Name Value parameter name.
  297. /// @param Ty Parameter type.
  298. /// @param Value Constant parameter value.
  299. /// @param File File where this type parameter is defined.
  300. /// @param LineNo Line number.
  301. /// @param ColumnNo Column Number.
  302. DITemplateValueParameter
  303. createTemplateValueParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
  304. uint64_t Value,
  305. MDNode *File = 0, unsigned LineNo = 0,
  306. unsigned ColumnNo = 0);
  307. /// createArrayType - Create debugging information entry for an array.
  308. /// @param Size Array size.
  309. /// @param AlignInBits Alignment.
  310. /// @param Ty Element type.
  311. /// @param Subscripts Subscripts.
  312. DICompositeType createArrayType(uint64_t Size, uint64_t AlignInBits,
  313. DIType Ty, DIArray Subscripts);
  314. /// createVectorType - Create debugging information entry for a vector type.
  315. /// @param Size Array size.
  316. /// @param AlignInBits Alignment.
  317. /// @param Ty Element type.
  318. /// @param Subscripts Subscripts.
  319. DIType createVectorType(uint64_t Size, uint64_t AlignInBits,
  320. DIType Ty, DIArray Subscripts);
  321. /// createEnumerationType - Create debugging information entry for an
  322. /// enumeration.
  323. /// @param Scope Scope in which this enumeration is defined.
  324. /// @param Name Union name.
  325. /// @param File File where this member is defined.
  326. /// @param LineNumber Line number.
  327. /// @param SizeInBits Member size.
  328. /// @param AlignInBits Member alignment.
  329. /// @param Elements Enumeration elements.
  330. /// @param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
  331. DICompositeType createEnumerationType(DIDescriptor Scope, StringRef Name,
  332. DIFile File, unsigned LineNumber,
  333. uint64_t SizeInBits,
  334. uint64_t AlignInBits,
  335. DIArray Elements,
  336. DIType UnderlyingType);
  337. /// createSubroutineType - Create subroutine type.
  338. /// @param File File in which this subroutine is defined.
  339. /// @param ParameterTypes An array of subroutine parameter types. This
  340. /// includes return type at 0th index.
  341. DICompositeType createSubroutineType(DIFile File, DIArray ParameterTypes);
  342. /// createArtificialType - Create a new DIType with "artificial" flag set.
  343. DIType createArtificialType(DIType Ty);
  344. /// createObjectPointerType - Create a new DIType with the "object pointer"
  345. /// flag set.
  346. DIType createObjectPointerType(DIType Ty);
  347. /// createForwardDecl - Create a temporary forward-declared type.
  348. DIType createForwardDecl(unsigned Tag, StringRef Name, DIDescriptor Scope,
  349. DIFile F, unsigned Line, unsigned RuntimeLang = 0,
  350. uint64_t SizeInBits = 0, uint64_t AlignInBits = 0);
  351. /// retainType - Retain DIType in a module even if it is not referenced
  352. /// through debug info anchors.
  353. void retainType(DIType T);
  354. /// createUnspecifiedParameter - Create unspeicified type descriptor
  355. /// for a subroutine type.
  356. DIDescriptor createUnspecifiedParameter();
  357. /// getOrCreateArray - Get a DIArray, create one if required.
  358. DIArray getOrCreateArray(ArrayRef<Value *> Elements);
  359. /// getOrCreateSubrange - Create a descriptor for a value range. This
  360. /// implicitly uniques the values returned.
  361. DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count);
  362. /// createGlobalVariable - Create a new descriptor for the specified global.
  363. /// @param Name Name of the variable.
  364. /// @param File File where this variable is defined.
  365. /// @param LineNo Line number.
  366. /// @param Ty Variable Type.
  367. /// @param isLocalToUnit Boolean flag indicate whether this variable is
  368. /// externally visible or not.
  369. /// @param Val llvm::Value of the variable.
  370. DIGlobalVariable
  371. createGlobalVariable(StringRef Name, DIFile File, unsigned LineNo,
  372. DIType Ty, bool isLocalToUnit, llvm::Value *Val);
  373. /// \brief Create a new descriptor for the specified global.
  374. /// @param Name Name of the variable.
  375. /// @param LinkageName Mangled variable name.
  376. /// @param File File where this variable is defined.
  377. /// @param LineNo Line number.
  378. /// @param Ty Variable Type.
  379. /// @param isLocalToUnit Boolean flag indicate whether this variable is
  380. /// externally visible or not.
  381. /// @param Val llvm::Value of the variable.
  382. DIGlobalVariable
  383. createGlobalVariable(StringRef Name, StringRef LinkageName, DIFile File,
  384. unsigned LineNo, DIType Ty, bool isLocalToUnit,
  385. llvm::Value *Val);
  386. /// createStaticVariable - Create a new descriptor for the specified
  387. /// variable.
  388. /// @param Context Variable scope.
  389. /// @param Name Name of the variable.
  390. /// @param LinkageName Mangled name of the variable.
  391. /// @param File File where this variable is defined.
  392. /// @param LineNo Line number.
  393. /// @param Ty Variable Type.
  394. /// @param isLocalToUnit Boolean flag indicate whether this variable is
  395. /// externally visible or not.
  396. /// @param Val llvm::Value of the variable.
  397. /// @param Decl Reference to the corresponding declaration.
  398. DIGlobalVariable
  399. createStaticVariable(DIDescriptor Context, StringRef Name,
  400. StringRef LinkageName, DIFile File, unsigned LineNo,
  401. DIType Ty, bool isLocalToUnit, llvm::Value *Val,
  402. MDNode *Decl = NULL);
  403. /// createLocalVariable - Create a new descriptor for the specified
  404. /// local variable.
  405. /// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
  406. /// DW_TAG_arg_variable.
  407. /// @param Scope Variable scope.
  408. /// @param Name Variable name.
  409. /// @param File File where this variable is defined.
  410. /// @param LineNo Line number.
  411. /// @param Ty Variable Type
  412. /// @param AlwaysPreserve Boolean. Set to true if debug info for this
  413. /// variable should be preserved in optimized build.
  414. /// @param Flags Flags, e.g. artificial variable.
  415. /// @param ArgNo If this variable is an arugment then this argument's
  416. /// number. 1 indicates 1st argument.
  417. DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope,
  418. StringRef Name,
  419. DIFile File, unsigned LineNo,
  420. DIType Ty, bool AlwaysPreserve = false,
  421. unsigned Flags = 0,
  422. unsigned ArgNo = 0);
  423. /// createComplexVariable - Create a new descriptor for the specified
  424. /// variable which has a complex address expression for its address.
  425. /// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
  426. /// DW_TAG_arg_variable.
  427. /// @param Scope Variable scope.
  428. /// @param Name Variable name.
  429. /// @param F File where this variable is defined.
  430. /// @param LineNo Line number.
  431. /// @param Ty Variable Type
  432. /// @param Addr An array of complex address operations.
  433. /// @param ArgNo If this variable is an arugment then this argument's
  434. /// number. 1 indicates 1st argument.
  435. DIVariable createComplexVariable(unsigned Tag, DIDescriptor Scope,
  436. StringRef Name, DIFile F, unsigned LineNo,
  437. DIType Ty, ArrayRef<Value *> Addr,
  438. unsigned ArgNo = 0);
  439. /// createFunction - Create a new descriptor for the specified subprogram.
  440. /// See comments in DISubprogram for descriptions of these fields.
  441. /// @param Scope Function scope.
  442. /// @param Name Function name.
  443. /// @param LinkageName Mangled function name.
  444. /// @param File File where this variable is defined.
  445. /// @param LineNo Line number.
  446. /// @param Ty Function type.
  447. /// @param isLocalToUnit True if this function is not externally visible..
  448. /// @param isDefinition True if this is a function definition.
  449. /// @param ScopeLine Set to the beginning of the scope this starts
  450. /// @param Flags e.g. is this function prototyped or not.
  451. /// This flags are used to emit dwarf attributes.
  452. /// @param isOptimized True if optimization is ON.
  453. /// @param Fn llvm::Function pointer.
  454. /// @param TParam Function template parameters.
  455. DISubprogram createFunction(DIDescriptor Scope, StringRef Name,
  456. StringRef LinkageName,
  457. DIFile File, unsigned LineNo,
  458. DIType Ty, bool isLocalToUnit,
  459. bool isDefinition,
  460. unsigned ScopeLine,
  461. unsigned Flags = 0,
  462. bool isOptimized = false,
  463. Function *Fn = 0,
  464. MDNode *TParam = 0,
  465. MDNode *Decl = 0);
  466. /// createMethod - Create a new descriptor for the specified C++ method.
  467. /// See comments in DISubprogram for descriptions of these fields.
  468. /// @param Scope Function scope.
  469. /// @param Name Function name.
  470. /// @param LinkageName Mangled function name.
  471. /// @param File File where this variable is defined.
  472. /// @param LineNo Line number.
  473. /// @param Ty Function type.
  474. /// @param isLocalToUnit True if this function is not externally visible..
  475. /// @param isDefinition True if this is a function definition.
  476. /// @param Virtuality Attributes describing virtualness. e.g. pure
  477. /// virtual function.
  478. /// @param VTableIndex Index no of this method in virtual table.
  479. /// @param VTableHolder Type that holds vtable.
  480. /// @param Flags e.g. is this function prototyped or not.
  481. /// This flags are used to emit dwarf attributes.
  482. /// @param isOptimized True if optimization is ON.
  483. /// @param Fn llvm::Function pointer.
  484. /// @param TParam Function template parameters.
  485. DISubprogram createMethod(DIDescriptor Scope, StringRef Name,
  486. StringRef LinkageName,
  487. DIFile File, unsigned LineNo,
  488. DIType Ty, bool isLocalToUnit,
  489. bool isDefinition,
  490. unsigned Virtuality = 0, unsigned VTableIndex = 0,
  491. MDNode *VTableHolder = 0,
  492. unsigned Flags = 0,
  493. bool isOptimized = false,
  494. Function *Fn = 0,
  495. MDNode *TParam = 0);
  496. /// createNameSpace - This creates new descriptor for a namespace
  497. /// with the specified parent scope.
  498. /// @param Scope Namespace scope
  499. /// @param Name Name of this namespace
  500. /// @param File Source file
  501. /// @param LineNo Line number
  502. DINameSpace createNameSpace(DIDescriptor Scope, StringRef Name,
  503. DIFile File, unsigned LineNo);
  504. /// createLexicalBlockFile - This creates a descriptor for a lexical
  505. /// block with a new file attached. This merely extends the existing
  506. /// lexical block as it crosses a file.
  507. /// @param Scope Lexical block.
  508. /// @param File Source file.
  509. DILexicalBlockFile createLexicalBlockFile(DIDescriptor Scope,
  510. DIFile File);
  511. /// createLexicalBlock - This creates a descriptor for a lexical block
  512. /// with the specified parent context.
  513. /// @param Scope Parent lexical scope.
  514. /// @param File Source file
  515. /// @param Line Line number
  516. /// @param Col Column number
  517. DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File,
  518. unsigned Line, unsigned Col);
  519. /// \brief Create a descriptor for an imported module.
  520. /// @param Context The scope this module is imported into
  521. /// @param NS The namespace being imported here
  522. /// @param Line Line number
  523. DIImportedModule createImportedModule(DIScope Context, DINameSpace NS,
  524. unsigned Line);
  525. /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
  526. /// @param Storage llvm::Value of the variable
  527. /// @param VarInfo Variable's debug info descriptor.
  528. /// @param InsertAtEnd Location for the new intrinsic.
  529. Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
  530. BasicBlock *InsertAtEnd);
  531. /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
  532. /// @param Storage llvm::Value of the variable
  533. /// @param VarInfo Variable's debug info descriptor.
  534. /// @param InsertBefore Location for the new intrinsic.
  535. Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
  536. Instruction *InsertBefore);
  537. /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
  538. /// @param Val llvm::Value of the variable
  539. /// @param Offset Offset
  540. /// @param VarInfo Variable's debug info descriptor.
  541. /// @param InsertAtEnd Location for the new intrinsic.
  542. Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
  543. DIVariable VarInfo,
  544. BasicBlock *InsertAtEnd);
  545. /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
  546. /// @param Val llvm::Value of the variable
  547. /// @param Offset Offset
  548. /// @param VarInfo Variable's debug info descriptor.
  549. /// @param InsertBefore Location for the new intrinsic.
  550. Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
  551. DIVariable VarInfo,
  552. Instruction *InsertBefore);
  553. };
  554. } // end namespace llvm
  555. #endif