Commit fd20e49f authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[gcmole] Fix source files pattern in GYP parsing.

The pattern of how our source files are listed in GYP files changed,
which in turn broke the parsing pattern that GCMole uses to gather a
list of files to check. Only 'cctest' file were checked, 'src' files
were being ignored.

R=cbruni@chromium.org

Review-Url: https://codereview.chromium.org/2065933002
Cr-Commit-Position: refs/heads/master@{#36962}
parent 19067e5f
......@@ -1255,7 +1255,8 @@ void PatchPositionsInBytecodeArray(Handle<BytecodeArray> bytecode,
iterator.is_statement());
}
bytecode->set_source_position_table(*builder.ToSourcePositionTable());
Handle<ByteArray> source_position_table = builder.ToSourcePositionTable();
bytecode->set_source_position_table(*source_position_table);
}
} // namespace
......
......@@ -184,26 +184,26 @@ end
-- GYP file parsing
local function ParseGYPFile()
local gyp = ""
local gyp_files = { "src/v8.gyp", "test/cctest/cctest.gyp" }
for i = 1, #gyp_files do
local f = assert(io.open(gyp_files[i]), "failed to open GYP file")
local t = f:read('*a')
gyp = gyp .. t
f:close()
end
local result = {}
local gyp_files = {
{ "src/v8.gyp", "'([^']-%.cc)'", "src/" },
{ "test/cctest/cctest.gyp", "'(test-[^']-%.cc)'", "test/cctest/" }
}
for condition, sources in
gyp:gmatch "'sources': %[.-### gcmole%((.-)%) ###(.-)%]" do
if result[condition] == nil then result[condition] = {} end
for file in sources:gmatch "'%.%./%.%./src/([^']-%.cc)'" do
table.insert(result[condition], "src/" .. file)
end
for file in sources:gmatch "'(test-[^']-%.cc)'" do
table.insert(result[condition], "test/cctest/" .. file)
for i = 1, #gyp_files do
local filename = gyp_files[i][1]
local pattern = gyp_files[i][2]
local prefix = gyp_files[i][3]
local gyp_file = assert(io.open(filename), "failed to open GYP file")
local gyp = gyp_file:read('*a')
for condition, sources in
gyp:gmatch "'sources': %[.-### gcmole%((.-)%) ###(.-)%]" do
if result[condition] == nil then result[condition] = {} end
for file in sources:gmatch(pattern) do
table.insert(result[condition], prefix .. file)
end
end
gyp_file:close()
end
return result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment