| 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 #ifndef TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 7 #ifndef TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| 8 #define TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 8 #define TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| 9 | 9 |
| 10 #include "clang/AST/AST.h" | 10 #include "clang/AST/AST.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 return name == "GarbageCollectedFinalized" || | 104 return name == "GarbageCollectedFinalized" || |
| 105 name == "RefCountedGarbageCollected"; | 105 name == "RefCountedGarbageCollected"; |
| 106 } | 106 } |
| 107 | 107 |
| 108 static bool IsGCBase(const std::string& name) { | 108 static bool IsGCBase(const std::string& name) { |
| 109 return name == "GarbageCollected" || | 109 return name == "GarbageCollected" || |
| 110 IsGCFinalizedBase(name) || | 110 IsGCFinalizedBase(name) || |
| 111 IsGCMixinBase(name); | 111 IsGCMixinBase(name); |
| 112 } | 112 } |
| 113 | 113 |
| 114 static bool IsTreeSharedBase(const std::string& name) { | |
| 115 return name == "TreeShared"; | |
| 116 } | |
| 117 | |
| 118 static bool IsAnnotated(clang::Decl* decl, const std::string& anno) { | 114 static bool IsAnnotated(clang::Decl* decl, const std::string& anno) { |
| 119 clang::AnnotateAttr* attr = decl->getAttr<clang::AnnotateAttr>(); | 115 clang::AnnotateAttr* attr = decl->getAttr<clang::AnnotateAttr>(); |
| 120 return attr && (attr->getAnnotation() == anno); | 116 return attr && (attr->getAnnotation() == anno); |
| 121 } | 117 } |
| 122 | 118 |
| 123 static bool IsStackAnnotated(clang::Decl* decl) { | 119 static bool IsStackAnnotated(clang::Decl* decl) { |
| 124 return IsAnnotated(decl, "blink_stack_allocated"); | 120 return IsAnnotated(decl, "blink_stack_allocated"); |
| 125 } | 121 } |
| 126 | 122 |
| 127 static bool IsIgnoreAnnotated(clang::Decl* decl) { | 123 static bool IsIgnoreAnnotated(clang::Decl* decl) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 164 } |
| 169 | 165 |
| 170 static bool EndsWith(const std::string& str, const std::string& suffix) { | 166 static bool EndsWith(const std::string& str, const std::string& suffix) { |
| 171 if (suffix.size() > str.size()) | 167 if (suffix.size() > str.size()) |
| 172 return false; | 168 return false; |
| 173 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; | 169 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; |
| 174 } | 170 } |
| 175 }; | 171 }; |
| 176 | 172 |
| 177 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 173 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| OLD | NEW |