aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-05-22 23:22:18 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-05-22 23:22:18 +0000
commit3d33184d9da02fb699827249e0631106252f72fa (patch)
tree6f7a6626fc0d65838ac1f9c474e2c4a3ece91c47 /lib/IR/DIBuilder.cpp
parent62c320a755ac27ac2b7f64e927892249e0f486e0 (diff)
downloadexternal_llvm-3d33184d9da02fb699827249e0631106252f72fa.zip
external_llvm-3d33184d9da02fb699827249e0631106252f72fa.tar.gz
external_llvm-3d33184d9da02fb699827249e0631106252f72fa.tar.bz2
Solidify the assumption that a DW_TAG_subprogram's type is a DW_TAG_subroutine_type
There were bits & pieces of code lying around that may've given the impression that debug info metadata supported the possibility that a subprogram's type could be specified by a non-subroutine type describing the return type of a void function. This support was incomplete & unnecessary. Asserts & API have been changed to make the desired usage more clear. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182532 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/DIBuilder.cpp')
-rw-r--r--lib/IR/DIBuilder.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index 1c79945..8edc6a0 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/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),