Lines Matching full:local
31 local DIR = arg[0]:match("^(.+)/[^/]+$")
33 local FLAGS = {
53 local ARGS = {}
56 local flag = arg[i]:match "^%-%-([%w_-]+)$"
58 local no, real_flag = flag:match "^(no)([%w_-]+)$"
72 local ARCHS = ARGS[1] and { ARGS[1] } or { 'ia32', 'arm', 'x64', 'arm64' }
74 local io = require "io"
75 local os = require "os"
85 local CLANG_BIN = os.getenv "CLANG_BIN"
86 local CLANG_PLUGINS = os.getenv "CLANG_PLUGINS"
96 local function MakeClangCommandLine(
120 local function IterTable(t)
128 local function SplitResults(lines, func)
131 local current = {}
132 local filename = ""
134 local new_file = line:match "^______________ (.*)$"
135 local code = line:match "^______________ finish (%d+) ______________$"
155 local cmd_line = MakeClangCommandLine(cfg.plugin,
164 local action = cmd_line .. " " .. filename .. " 2>&1"
166 local pipe = io.popen(action)
168 local success = pipe:close()
173 local action = "python tools/gcmole/parallel.py \""
176 local pipe = io.popen(action)
177 local success = SplitResults(pipe:lines(), func)
178 local closed = pipe:close()
187 local function ParseGYPFile()
188 local result = {}
189 local gyp_files = {
195 local filename = gyp_files[i][1]
196 local pattern = gyp_files[i][2]
197 local prefix = gyp_files[i][3]
198 local gyp_file = assert(io.open(filename), "failed to open GYP file")
199 local gyp = gyp_file:read('*a')
213 local function ParseGNFile()
214 local result = {}
215 local gn_files = {
221 local filename = gn_files[i][1]
222 local pattern = gn_files[i][2]
223 local prefix = gn_files[i][3]
224 local gn_file = assert(io.open(filename), "failed to open GN file")
225 local gn = gn_file:read('*a')
239 local function EvaluateCondition(cond, props)
242 local p, v = cond:match "(%w+):(%w+)"
250 local function BuildFileList(sources, props)
251 local list = {}
261 local gyp_sources = ParseGYPFile()
262 local gn_sources = ParseGNFile()
265 local function CompareSources(sources1, sources2, what)
267 local files2 = sources2[condition]
289 local function FilesForArch(arch)
296 local mtConfig = {}
300 local function config (t) return setmetatable(t, mtConfig) end
303 local e = {}
309 local ARCHITECTURES = {
327 local gc, gc_caused, funcs
329 local WHITELIST = {
354 local function AddCause(name, cause)
355 local t = gc_caused[name]
363 local function resolve(name)
364 local f = funcs[name]
387 local function parse (filename, lines)
388 local scope
395 local name = funcname:sub(2)
401 local function propagate ()
404 local function mark(from, callers)
419 local function GenerateGCSuspects(arch, files, cfg)
430 local out = assert(io.open("gcsuspects", "w"))
434 local out = assert(io.open("gccauses", "w"))
450 local function CheckCorrectnessForArch(arch)
451 local files = FilesForArch(arch)
452 local cfg = ARCHITECTURES[arch]
458 local processed_files = 0
459 local errors_found = false
460 local function SearchForErrors(filename, lines)
474 local plugin_args
487 local function SafeCheckCorrectnessForArch(arch)
488 local status, errors = pcall(CheckCorrectnessForArch, arch)
496 local errors = false