[compiler-rt] 6800222 - [NFC][sanitizer] Add const to ChainedOriginDepotNode methods
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 8 14:27:17 PDT 2021
Author: Vitaly Buka
Date: 2021-10-08T14:27:05-07:00
New Revision: 68002220682be23a161247c3a83baf15ae55fe25
URL: https://github.com/llvm/llvm-project/commit/68002220682be23a161247c3a83baf15ae55fe25
DIFF: https://github.com/llvm/llvm-project/commit/68002220682be23a161247c3a83baf15ae55fe25.diff
LOG: [NFC][sanitizer] Add const to ChainedOriginDepotNode methods
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_chained_origin_depot.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_chained_origin_depot.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_chained_origin_depot.cpp
index f7d619577818..bf52bba9ade1 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_chained_origin_depot.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_chained_origin_depot.cpp
@@ -46,16 +46,16 @@ struct ChainedOriginDepotNode {
args_type load() const;
struct Handle {
- ChainedOriginDepotNode *node_;
+ const ChainedOriginDepotNode *node_;
Handle() : node_(nullptr) {}
- explicit Handle(ChainedOriginDepotNode *node) : node_(node) {}
- bool valid() { return node_; }
- u32 id() { return node_->id; }
- int here_id() { return node_->here_id; }
- int prev_id() { return node_->prev_id; }
+ explicit Handle(const ChainedOriginDepotNode *node) : node_(node) {}
+ bool valid() const { return node_; }
+ u32 id() const { return node_->id; }
+ int here_id() const { return node_->here_id; }
+ int prev_id() const { return node_->prev_id; }
};
- Handle get_handle();
+ Handle get_handle() const;
typedef Handle handle_type;
};
@@ -129,7 +129,7 @@ ChainedOriginDepotNode::args_type ChainedOriginDepotNode::load() const {
return ret;
}
-ChainedOriginDepotNode::Handle ChainedOriginDepotNode::get_handle() {
+ChainedOriginDepotNode::Handle ChainedOriginDepotNode::get_handle() const {
return Handle(this);
}
More information about the llvm-commits
mailing list