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

Side by Side Diff: tools/clang/blink_gc_plugin/RecordInfo.cpp

Issue 1167123002: Check Member<T> validity for stack allocated objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "Config.h" 5 #include "Config.h"
6 #include "RecordInfo.h" 6 #include "RecordInfo.h"
7 7
8 using namespace clang; 8 using namespace clang;
9 using std::string; 9 using std::string;
10 10
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 is_eagerly_finalized_ = kTrue; 179 is_eagerly_finalized_ = kTrue;
180 break; 180 break;
181 } 181 }
182 } 182 }
183 } 183 }
184 } 184 }
185 } 185 }
186 return is_eagerly_finalized_; 186 return is_eagerly_finalized_;
187 } 187 }
188 188
189 bool RecordInfo::HasDefinition() {
190 return record_->hasDefinition();
191 }
192
189 RecordInfo* RecordCache::Lookup(CXXRecordDecl* record) { 193 RecordInfo* RecordCache::Lookup(CXXRecordDecl* record) {
190 // Ignore classes annotated with the GC_PLUGIN_IGNORE macro. 194 // Ignore classes annotated with the GC_PLUGIN_IGNORE macro.
191 if (!record || Config::IsIgnoreAnnotated(record)) 195 if (!record || Config::IsIgnoreAnnotated(record))
192 return 0; 196 return 0;
193 Cache::iterator it = cache_.find(record); 197 Cache::iterator it = cache_.find(record);
194 if (it != cache_.end()) 198 if (it != cache_.end())
195 return &it->second; 199 return &it->second;
196 return &cache_.insert(std::make_pair(record, RecordInfo(record, this))) 200 return &cache_.insert(std::make_pair(record, RecordInfo(record, this)))
197 .first->second; 201 .first->second;
198 } 202 }
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 edge->members().push_back(member); 664 edge->members().push_back(member);
661 } 665 }
662 // TODO: Handle the case where we fail to create an edge (eg, if the 666 // TODO: Handle the case where we fail to create an edge (eg, if the
663 // argument is a primitive type or just not fully known yet). 667 // argument is a primitive type or just not fully known yet).
664 } 668 }
665 return edge; 669 return edge;
666 } 670 }
667 671
668 return new Value(info); 672 return new Value(info);
669 } 673 }
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/RecordInfo.h ('k') | tools/clang/blink_gc_plugin/tests/member_in_offheap_class.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698