summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-23 23:20:36 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-23 23:20:36 +0000
commit2a898e0df693c0b677b9d1e88f31cf23360c62eb (patch)
treea6b21ab9eab4fd808cfb8683b0f2f67aac210e5a /llvm/lib
parent8a068e6c430755ef3d8e92dcf4264af50529ce3e (diff)
downloadbcm5719-llvm-2a898e0df693c0b677b9d1e88f31cf23360c62eb.tar.gz
bcm5719-llvm-2a898e0df693c0b677b9d1e88f31cf23360c62eb.zip
[LCG] Make the insertion and query paths into the LCG which cannot fail
return references to better model this property. No functionality changed. llvm-svn: 207047
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/LazyCallGraph.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp
index d31793803ac..128448e4c93 100644
--- a/llvm/lib/Analysis/LazyCallGraph.cpp
+++ b/llvm/lib/Analysis/LazyCallGraph.cpp
@@ -362,8 +362,8 @@ void LazyCallGraph::removeEdge(Node &CallerN, Function &Callee) {
CallerC->removeInternalEdge(*this, CallerN, *CalleeN);
}
-LazyCallGraph::Node *LazyCallGraph::insertInto(Function &F, Node *&MappedN) {
- return new (MappedN = BPA.Allocate()) Node(*this, F);
+LazyCallGraph::Node &LazyCallGraph::insertInto(Function &F, Node *&MappedN) {
+ return *new (MappedN = BPA.Allocate()) Node(*this, F);
}
void LazyCallGraph::updateGraphPtrs() {
@@ -435,8 +435,8 @@ LazyCallGraph::SCC *LazyCallGraph::getNextSCCInPostOrder() {
// Reset the DFS numbering.
NextDFSNumber = 1;
- Node *N = get(*SCCEntryNodes.pop_back_val());
- DFSStack.push_back(std::make_pair(N, N->begin()));
+ Node &N = get(*SCCEntryNodes.pop_back_val());
+ DFSStack.push_back(std::make_pair(&N, N.begin()));
}
auto SI = DFSStack.rbegin();
OpenPOWER on IntegriCloud