17INCLUDE_DIRECTIVE_RE = re.compile(
r'^#include "(.*)"')
19RUNTIME_LAYER_HEADERS = [
20 'runtime/vm/isolate.h',
21 'runtime/vm/object.h',
22 'runtime/vm/raw_object.h',
23 'runtime/vm/thread.h',
26SHOULD_NOT_DEPEND_ON_RUNTIME = [
27 'runtime/vm/allocation.h',
28 'runtime/vm/growable_array.h',
42 self.
file_layers = {file:
'runtime' for file
in RUNTIME_LAYER_HEADERS}
52 """Check that given files do not depend on runtime layer."""
55 if not os.path.exists(os.path.join(self.
root, file)):
56 errors.append(
'File %s does not exist.' % (file))
59 'LAYERING ERROR: %s includes object.h or raw_object.h' %
76 """Propagate layering information through include graph.
78 If A is in layer L
and A
is included into B then B
is in layer L.
91 'Layer mismatch: %s (%s) is included into %s (%s)' %
98 """Add all *.cc and *.h files from dir recursively into worklist."""
99 for file
in os.listdir(dir):
100 path = os.path.join(dir, file)
101 if os.path.isdir(path):
103 elif path.endswith(
'.cc')
or path.endswith(
'.h'):
107 """Extract the list of includes from the given file."""
109 with open(os.path.join(self.
root, file), encoding=
'utf-8')
as file:
111 if line.startswith(
'namespace dart {'):
114 m = INCLUDE_DIRECTIVE_RE.match(line)
116 header = os.path.join(
'runtime', m.group(1))
117 if os.path.isfile(os.path.join(self.
root, header)):
123 """Run layering check at the given root folder."""
127if __name__ ==
'__main__':
static std::function< void(void)> pop(std::deque< std::function< void(void)> > *list)
def AddAllSourcesToWorklist(self, dir)
def CheckNotInRuntime(self, files)
def PropagateLayers(self)
def ExtractIncludes(self, file)
def BuildIncludesGraph(self)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
const myers::Point & get(const myers::Segment &)
def print(*args, **kwargs)
static SkString join(const CommandLineFlags::StringArray &)