Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: tools/clang/blink_gc_plugin/RecordInfo.cpp

Issue 261973002: Blink GC plugin: require that GC derived classes do not override their new(size_t) operator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: only check new(size_t) Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/clang/blink_gc_plugin/RecordInfo.h ('k') | tools/clang/blink_gc_plugin/tests/class_overrides_new.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/RecordInfo.cpp
diff --git a/tools/clang/blink_gc_plugin/RecordInfo.cpp b/tools/clang/blink_gc_plugin/RecordInfo.cpp
index 1d26fa797f3eda7f6249240e3f7b3bcafc79a859..7378077e5da6af34b2036f32d8ae6b3908e0669c 100644
--- a/tools/clang/blink_gc_plugin/RecordInfo.cpp
+++ b/tools/clang/blink_gc_plugin/RecordInfo.cpp
@@ -230,6 +230,16 @@ bool RecordInfo::IsOnlyPlacementNewable() {
return is_only_placement_newable_;
}
+CXXMethodDecl* RecordInfo::DeclaresNewOperator() {
+ for (CXXRecordDecl::method_iterator it = record_->method_begin();
+ it != record_->method_end();
+ ++it) {
+ if (it->getNameAsString() == kNewOperatorName && it->getNumParams() == 1)
+ return *it;
+ }
+ return 0;
+}
+
// An object requires a tracing method if it has any fields that need tracing.
bool RecordInfo::RequiresTraceMethod() {
if (IsStackAllocated())
« no previous file with comments | « tools/clang/blink_gc_plugin/RecordInfo.h ('k') | tools/clang/blink_gc_plugin/tests/class_overrides_new.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698