stringpooling api. (#682)
* stringpooling api. * add options to msc.lua
This commit is contained in:
parent
aae8917042
commit
ac2919e74c
@ -969,6 +969,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
api.register {
|
||||
name = "stringpooling",
|
||||
scope = "config",
|
||||
kind = "boolean"
|
||||
}
|
||||
|
||||
api.register {
|
||||
name = "symbols",
|
||||
scope = "config",
|
||||
|
@ -1979,7 +1979,13 @@
|
||||
end
|
||||
|
||||
function m.stringPooling(cfg)
|
||||
if config.isOptimizedBuild(cfg) then
|
||||
if cfg.stringpooling ~= nil then
|
||||
if cfg.stringpooling then
|
||||
m.element("StringPooling", nil, "true")
|
||||
else
|
||||
m.element("StringPooling", nil, "false")
|
||||
end
|
||||
elseif config.isOptimizedBuild(cfg) then
|
||||
m.element("StringPooling", nil, "true")
|
||||
end
|
||||
end
|
||||
|
@ -493,6 +493,9 @@
|
||||
-- replacement, if any, to the result
|
||||
|
||||
local values = cfg[field.name]
|
||||
if type(values) == "boolean" then
|
||||
values = iif(values, "On", "Off")
|
||||
end
|
||||
if type(values) ~= "table" then
|
||||
values = { values }
|
||||
end
|
||||
|
@ -75,6 +75,10 @@
|
||||
Extra = "/W4",
|
||||
Off = "/W0",
|
||||
},
|
||||
stringpooling = {
|
||||
On = "/GF",
|
||||
Off = "/GF-",
|
||||
},
|
||||
symbols = {
|
||||
On = "/Z7"
|
||||
}
|
||||
|
@ -786,3 +786,47 @@
|
||||
<Optimization>Disabled</Optimization>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Check handling of the stringpooling api
|
||||
--
|
||||
function suite.onStringPoolingOff()
|
||||
stringpooling 'Off'
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<StringPooling>false</StringPooling>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.onStringPoolingOn()
|
||||
stringpooling 'On'
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<StringPooling>true</StringPooling>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.onStringPoolingNotSpecified()
|
||||
optimize "On"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Full</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<StringPooling>true</StringPooling>
|
||||
]]
|
||||
end
|
||||
|
@ -77,6 +77,23 @@
|
||||
test.contains("/GL", msc.getldflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cflags_onStringPoolingOn()
|
||||
stringpooling "On"
|
||||
prepare()
|
||||
test.contains("/GF", msc.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cflags_onStringPoolingOff()
|
||||
stringpooling "Off"
|
||||
prepare()
|
||||
test.contains("/GF-", msc.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cflags_onStringPoolingNotSpecified()
|
||||
prepare()
|
||||
test.excludes("/GF", msc.getcflags(cfg))
|
||||
test.excludes("/GF-", msc.getcflags(cfg))
|
||||
end
|
||||
|
||||
--
|
||||
-- Check the translation of symbols.
|
||||
|
Loading…
Reference in New Issue
Block a user