| OLD | NEW |
| 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 // This file defines the names used by GC infrastructure. | 5 // This file defines the names used by GC infrastructure. |
| 6 | 6 |
| 7 // TODO: Restructure the name determination to use fully qualified names (ala, | 7 // TODO: Restructure the name determination to use fully qualified names (ala, |
| 8 // blink::Foo) so that the plugin can be enabled for all of chromium. Doing so | 8 // blink::Foo) so that the plugin can be enabled for all of chromium. Doing so |
| 9 // would allow us to catch errors with structures outside of blink that might | 9 // would allow us to catch errors with structures outside of blink that might |
| 10 // have unsafe pointers to GC allocated blink structures. | 10 // have unsafe pointers to GC allocated blink structures. |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 formal_type.getTypePtr())) { | 188 formal_type.getTypePtr())) { |
| 189 if (IsVisitorPtrType(subst_type->getReplacementType())) { | 189 if (IsVisitorPtrType(subst_type->getReplacementType())) { |
| 190 // VisitorDispatcher template parameter substituted to Visitor*. | 190 // VisitorDispatcher template parameter substituted to Visitor*. |
| 191 return true; | 191 return true; |
| 192 } | 192 } |
| 193 } else if (const clang::TemplateTypeParmType* parm_type = | 193 } else if (const clang::TemplateTypeParmType* parm_type = |
| 194 clang::dyn_cast<clang::TemplateTypeParmType>( | 194 clang::dyn_cast<clang::TemplateTypeParmType>( |
| 195 formal_type.getTypePtr())) { | 195 formal_type.getTypePtr())) { |
| 196 if (parm_type->getDecl()->getName() == kVisitorDispatcherName) { | 196 if (parm_type->getDecl()->getName() == kVisitorDispatcherName) { |
| 197 // Unresolved, but its parameter name is VisitorDispatcher. | 197 // Unresolved, but its parameter name is VisitorDispatcher. |
| 198 return true; | 198 return false; |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 | 201 |
| 202 return IsVisitorPtrType(formal_type); | 202 return IsVisitorPtrType(formal_type); |
| 203 } | 203 } |
| 204 | 204 |
| 205 static bool IsTraceMethod(clang::FunctionDecl* method, | 205 static bool IsTraceMethod(clang::FunctionDecl* method, |
| 206 bool* is_trace_after_dispatch) { | 206 bool* is_trace_after_dispatch) { |
| 207 if (method->getNumParams() != 1) | 207 if (method->getNumParams() != 1) |
| 208 return false; | 208 return false; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 233 } | 233 } |
| 234 | 234 |
| 235 static bool EndsWith(const std::string& str, const std::string& suffix) { | 235 static bool EndsWith(const std::string& str, const std::string& suffix) { |
| 236 if (suffix.size() > str.size()) | 236 if (suffix.size() > str.size()) |
| 237 return false; | 237 return false; |
| 238 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; | 238 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; |
| 239 } | 239 } |
| 240 }; | 240 }; |
| 241 | 241 |
| 242 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 242 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| OLD | NEW |