summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-09-30 21:20:14 +0000
committerVedant Kumar <vsk@apple.com>2019-09-30 21:20:14 +0000
commitc03c2e886ee0743722f2bf1e6d3a2e85eb9c30b5 (patch)
tree0ecf53be8f6f1608eb6c3271704e6e5a489e6540
parentd072cd059d28acf5bb4bda95c551a370c9cff1dc (diff)
downloadbcm5719-llvm-c03c2e886ee0743722f2bf1e6d3a2e85eb9c30b5.tar.gz
bcm5719-llvm-c03c2e886ee0743722f2bf1e6d3a2e85eb9c30b5.zip
[StackFrameList][DFS] Turn a few raw pointers into references, NFC
llvm-svn: 373267
-rw-r--r--lldb/source/Symbol/Function.cpp1
-rw-r--r--lldb/source/Target/StackFrameList.cpp16
2 files changed, 9 insertions, 8 deletions
diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp
index 10a6032179f..be5ea258de5 100644
--- a/lldb/source/Symbol/Function.cpp
+++ b/lldb/source/Symbol/Function.cpp
@@ -173,6 +173,7 @@ void CallEdge::ParseSymbolFileAndResolve(ModuleList &images) {
Function *CallEdge::GetCallee(ModuleList &images) {
ParseSymbolFileAndResolve(images);
+ assert(resolved && "Did not resolve lazy callee");
return lazy_callee.def;
}
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp
index fbced5fd132..6d0c46259c2 100644
--- a/lldb/source/Target/StackFrameList.cpp
+++ b/lldb/source/Target/StackFrameList.cpp
@@ -286,15 +286,15 @@ static void FindInterveningFrames(Function &begin, Function &end,
DFS(Function *end, ModuleList &images) : end(end), images(images) {}
- void search(Function *first_callee, std::vector<Function *> &path) {
+ void search(Function &first_callee, std::vector<Function *> &path) {
dfs(first_callee);
if (!ambiguous)
path = std::move(solution_path);
}
- void dfs(Function *callee) {
+ void dfs(Function &callee) {
// Found a path to the target function.
- if (callee == end) {
+ if (&callee == end) {
if (solution_path.empty())
solution_path = active_path;
else
@@ -306,19 +306,19 @@ static void FindInterveningFrames(Function &begin, Function &end,
// there's more than one way to reach a target. This errs on the side of
// caution: it conservatively stops searching when some solutions are
// still possible to save time in the average case.
- if (!visited_nodes.insert(callee).second) {
+ if (!visited_nodes.insert(&callee).second) {
ambiguous = true;
return;
}
// Search the calls made from this callee.
- active_path.push_back(callee);
- for (CallEdge &edge : callee->GetTailCallingEdges()) {
+ active_path.push_back(&callee);
+ for (CallEdge &edge : callee.GetTailCallingEdges()) {
Function *next_callee = edge.GetCallee(images);
if (!next_callee)
continue;
- dfs(next_callee);
+ dfs(*next_callee);
if (ambiguous)
return;
}
@@ -326,7 +326,7 @@ static void FindInterveningFrames(Function &begin, Function &end,
}
};
- DFS(&end, images).search(first_callee, path);
+ DFS(&end, images).search(*first_callee, path);
}
/// Given that \p next_frame will be appended to the frame list, synthesize
OpenPOWER on IntegriCloud