Skip to content

Commit d352253

Browse files
authored
Merge pull request #9187 from github/criemen/lua-tracing-configs
Update Lua tracing configs.
2 parents 5d625d6 + 3836d15 commit d352253

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

csharp/tools/tracing-config.lua

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,43 @@ function RegisterExtractorPack(id)
33
'Semmle.Extraction.CSharp.Driver'
44
if OperatingSystem == 'windows' then extractor = extractor .. '.exe' end
55
local windowsMatchers = {
6-
CreatePatternMatcher({'^dotnet%.exe$'}, MatchCompilerName, extractor,
7-
{prepend = {'--dotnetexec', '--cil'}}),
6+
CreatePatternMatcher({'^dotnet%.exe$'}, MatchCompilerName, extractor, {
7+
prepend = {'--dotnetexec', '--cil'},
8+
order = ORDER_BEFORE
9+
}),
810
CreatePatternMatcher({'^csc.*%.exe$'}, MatchCompilerName, extractor, {
9-
prepend = {'--compiler', '"${compiler}"', '--cil'}
11+
prepend = {'--compiler', '"${compiler}"', '--cil'},
12+
order = ORDER_BEFORE
13+
1014
}),
1115
CreatePatternMatcher({'^fakes.*%.exe$', 'moles.*%.exe'},
1216
MatchCompilerName, nil, {trace = false})
1317
}
1418
local posixMatchers = {
1519
CreatePatternMatcher({'^mcs%.exe$', '^csc%.exe$'}, MatchCompilerName,
1620
extractor, {
17-
prepend = {'--compiler', '"${compiler}"', '--cil'}
21+
prepend = {'--compiler', '"${compiler}"', '--cil'},
22+
order = ORDER_BEFORE
23+
1824
}),
1925
CreatePatternMatcher({'^mono', '^dotnet$'}, MatchCompilerName,
20-
extractor, {prepend = {'--dotnetexec', '--cil'}}),
21-
function(compilerName, compilerPath, compilerArguments, _languageId)
26+
extractor, {
27+
prepend = {'--dotnetexec', '--cil'},
28+
order = ORDER_BEFORE
29+
}), function(compilerName, compilerPath, compilerArguments, _languageId)
2230
if MatchCompilerName('^msbuild$', compilerName, compilerPath,
2331
compilerArguments) or
2432
MatchCompilerName('^xbuild$', compilerName, compilerPath,
2533
compilerArguments) then
2634
return {
27-
replace = true,
28-
invocations = {
29-
BuildExtractorInvocation(id, compilerPath, compilerPath,
30-
compilerArguments, nil, {
31-
'/p:UseSharedCompilation=false'
32-
})
33-
}
35+
order = ORDER_REPLACE,
36+
invocation = BuildExtractorInvocation(id, compilerPath,
37+
compilerPath,
38+
compilerArguments,
39+
nil, {
40+
'/p:UseSharedCompilation=false'
41+
})
42+
3443
}
3544
end
3645
end

swift/tools/tracing-config.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,24 @@ function RegisterExtractorPack(id)
1313
table.remove(compilerArguments.argv, 1)
1414

1515
-- Skip "info" queries in case there is nothing to extract
16-
if compilerArguments.argv[1] == '-print-target-info' then return nil end
17-
if compilerArguments.argv[1] == '-emit-supported-features' then return nil end
16+
if compilerArguments.argv[1] == '-print-target-info' then
17+
return nil
18+
end
19+
if compilerArguments.argv[1] == '-emit-supported-features' then
20+
return nil
21+
end
1822

1923
-- Skip actions in which we cannot extract anything
2024
if compilerArguments.argv[1] == '-merge-modules' then return nil end
2125

2226
return {
2327
trace = true,
2428
replace = false,
25-
invocations = {{path = swiftExtractor, arguments = compilerArguments}}
29+
order = ORDER_AFTER,
30+
invocation = {path = swiftExtractor, arguments = compilerArguments}
2631
}
2732
end
28-
return { SwiftMatcher }
33+
return {SwiftMatcher}
2934
end
3035

3136
-- Return a list of minimum supported versions of the configuration file format

0 commit comments

Comments
 (0)