diff options
| author | Nguyễn Gia Phong <cnx@loang.net> | 2025-10-15 18:24:14 +0900 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2025-10-15 18:26:47 +0900 |
| commit | 06dff5537cf4b304aaaa7ea55b5899138fc3b8f4 (patch) | |
| tree | 8870a263b6f241e402c12e2bd5fb66f1162d3621 /trace-call.cc | |
| parent | 5562397b73d4cde06e773f00485e16406853e1fd (diff) | |
| download | taosc-06dff5537cf4b304aaaa7ea55b5899138fc3b8f4.tar.gz | |
Refactor C++ stuff
Constantize all the things!
Diffstat (limited to 'trace-call.cc')
| -rw-r--r-- | trace-call.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/trace-call.cc b/trace-call.cc index d154b4f..9d22599 100644 --- a/trace-call.cc +++ b/trace-call.cc @@ -38,7 +38,7 @@ main (int argc, char** argv) std::cin >> std::hex >> return_address; if (std::cin.fail ()) break; - auto* block = find_block (cs, co, return_address); + auto* const block = find_block (cs, co, return_address); // Each function call creates an interprocedure edge, // hence its basic block ends with the call site. // The control flow then naturally goes to the next basic block @@ -50,11 +50,12 @@ main (int argc, char** argv) std::vector <Dyninst::ParseAPI::Function*> functions; block->getFuncs (functions); Dyninst::Address call_address = 0; - for (auto* fun : functions) - for (auto* call_edge : fun->callEdges ()) + for (auto* const fun : functions) + for (auto* const call_edge : fun->callEdges ()) { - auto* call_block = call_edge->src (); - auto* return_block = fun->getImmediatePostDominator (call_block); + auto* const call_block = call_edge->src (); + auto* const return_block + = fun->getImmediatePostDominator (call_block); if (return_block == nullptr || *return_block != *block) continue; if (call_address != 0) |
