summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 1c799452754..8edc6a0f10c 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -969,13 +969,15 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context,
StringRef Name,
StringRef LinkageName,
DIFile File, unsigned LineNo,
- DIType Ty,
+ DICompositeType Ty,
bool isLocalToUnit, bool isDefinition,
unsigned ScopeLine,
unsigned Flags, bool isOptimized,
Function *Fn,
MDNode *TParams,
MDNode *Decl) {
+ assert(Ty.getTag() == dwarf::DW_TAG_subroutine_type &&
+ "function types should be subroutines");
Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) };
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_subprogram),
@@ -1014,7 +1016,7 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context,
StringRef Name,
StringRef LinkageName,
DIFile F,
- unsigned LineNo, DIType Ty,
+ unsigned LineNo, DICompositeType Ty,
bool isLocalToUnit,
bool isDefinition,
unsigned VK, unsigned VIndex,
@@ -1023,6 +1025,8 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context,
bool isOptimized,
Function *Fn,
MDNode *TParam) {
+ assert(Ty.getTag() == dwarf::DW_TAG_subroutine_type &&
+ "function types should be subroutines");
Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) };
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_subprogram),
OpenPOWER on IntegriCloud