summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-02-18 07:10:22 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-02-18 07:10:22 +0000
commit595eb44a2cc8ad6bf78ce0ddac44fe4c48cbd0f1 (patch)
treee96389eebf67de37d703d4ecb7d16ca209bc7b53 /llvm/lib
parent68426c79db899c8c9712379e186f28c372f880f2 (diff)
downloadbcm5719-llvm-595eb44a2cc8ad6bf78ce0ddac44fe4c48cbd0f1.tar.gz
bcm5719-llvm-595eb44a2cc8ad6bf78ce0ddac44fe4c48cbd0f1.zip
DIBuilder: Add function and method definitions to the list of all subprograms
Previously we seemed to be assuming that all functions were definitions and all methods were declarations. This may be consistent with how Clang uses DIBuilder but doesn't have to be true of all clients (such as DragonEgg). llvm-svn: 175423
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index af055c9f2fa..2fe13c44c63 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -924,7 +924,8 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context,
MDNode *Node = MDNode::get(VMContext, Elts);
// Create a named metadata so that we do not lose this mdnode.
- AllSubprograms.push_back(Node);
+ if (isDefinition)
+ AllSubprograms.push_back(Node);
return DISubprogram(Node);
}
@@ -968,6 +969,8 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context,
ConstantInt::get(Type::getInt32Ty(VMContext), LineNo)
};
MDNode *Node = MDNode::get(VMContext, Elts);
+ if (isDefinition)
+ AllSubprograms.push_back(Node);
return DISubprogram(Node);
}
OpenPOWER on IntegriCloud