Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftshader
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
swiftshader
Commits
6af6336d
Commit
6af6336d
authored
Oct 29, 2014
by
Karl Schimpf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove building llvm2ice.build_atts from Subzero build.
BUG=None R=stichnot@chromium.org Review URL:
https://codereview.chromium.org/689753002
parent
aff9fa2c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
40 deletions
+39
-40
Makefile.standalone
Makefile.standalone
+8
-5
if.py
pydir/if.py
+15
-25
lit.cfg
tests_lit/lit.cfg
+16
-10
No files found.
Makefile.standalone
View file @
6af6336d
...
...
@@ -116,10 +116,14 @@ OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS))
# Keep all the first target so it's the default.
all
:
$(OBJDIR)/llvm2ice make_symlink
make_symlink
:
$(OBJDIR)/llvm2ice $(OBJDIR)/llvm2ice.build_atts
rm
-rf
llvm2ice llvm2ice.build_atts
# Creates symbolic link so that testing is easier. Also runs
# llvm2ice to verify that the defines flags have valid values,
# as well as describe the corresponding build attributes.
make_symlink
:
$(OBJDIR)/llvm2ice
rm
-rf
llvm2ice
ln
-s
$(OBJDIR)
/llvm2ice
ln
-s
$(OBJDIR)
/llvm2ice.build_atts
@
echo
"Build Attributes:"
@
$(OBJDIR)
/llvm2ice
--build-atts
.PHONY
:
all make_symlink
...
...
@@ -128,7 +132,6 @@ make_symlink: $(OBJDIR)/llvm2ice $(OBJDIR)/llvm2ice.build_atts
$(OBJDIR)/llvm2ice
:
$(OBJS)
$(CXX)
$(LDFLAGS)
-o
$@
$^
$(LLVM_LDFLAGS)
-ldl
\
-Wl
,-rpath
=
$
(
abspath
$(LIBCXX_INSTALL_PATH)
/lib
)
$@
--build-atts
>
$@
.build_atts
# TODO: Be more precise than "*.h" here and elsewhere.
$(OBJS)
:
$(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def
...
...
@@ -166,7 +169,7 @@ format-diff:
$(CLANG_FORMAT_DIFF)
-p1
-style
=
LLVM
-i
clean
:
rm
-rf
llvm2ice
llvm2ice.build_atts
*
.o
$(OBJDIR)
rm
-rf
llvm2ice
*
.o
$(OBJDIR)
clean-all
:
clean
rm
-rf
build/
pydir/if
atts
.py
→
pydir/if.py
View file @
6af6336d
...
...
@@ -6,36 +6,26 @@ import sys
from
utils
import
shellcmd
def
GetFileAttributes
(
Filename
):
"""Returns the set of names contained in file named Filename.
"""
if
not
os
.
path
.
isfile
(
Filename
):
raise
RuntimeError
(
"Can't open:
%
s"
%
Filename
)
with
open
(
Filename
,
'r'
)
as
f
:
return
f
.
read
()
.
split
()
def
HasFileAttributes
(
Filename
,
Attributes
):
"""Returns true if the set of names in Attributes also appear
in the set of names contained in file named Filename.
"""
return
set
(
Attributes
)
<=
set
(
GetFileAttributes
(
Filename
))
def
main
():
"""Run the specified command only if
attributes are defined
.
"""Run the specified command only if
conditions are met
.
Check if the fset of attributes (i.e. names), contained in FILE,
contains the attributes defined by --att=ATTRIBUTE arguments. If
so, runs in a shell
the command defined by the remaining
arguments.
Two conditions are checked. First, the CONDITION must be true.
Secondly, all NEED names must be in the set of HAVE names.
If both conditions are met,
the command defined by the remaining
arguments
is run in a shell
.
"""
argparser
=
argparse
.
ArgumentParser
(
description
=
' '
+
main
.
__doc__
,
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
)
argparser
.
add_argument
(
'file'
,
metavar
=
'FILE'
,
help
=
'File defining attributes to check against.'
)
argparser
.
add_argument
(
'--att'
,
required
=
False
,
default
=
[],
action
=
'append'
,
metavar
=
'ATTRIBUTE'
,
help
=
'Attribute to check. May be repeated.'
)
argparser
.
add_argument
(
'--cond'
,
choices
=
{
'true'
,
'false'
}
,
required
=
False
,
default
=
'true'
,
metavar
=
'CONDITION'
,
help
=
'Condition to test.'
)
argparser
.
add_argument
(
'--need'
,
required
=
False
,
default
=
[],
action
=
'append'
,
metavar
=
'NEED'
,
help
=
'Needed name. May be repeated.'
)
argparser
.
add_argument
(
'--have'
,
required
=
False
,
default
=
[],
action
=
'append'
,
metavar
=
'HAVE'
,
help
=
'Name you have. May be repeated.'
)
argparser
.
add_argument
(
'--echo-cmd'
,
required
=
False
,
action
=
'store_true'
,
help
=
'Trace the command before running.'
)
...
...
@@ -48,7 +38,7 @@ def main():
if
not
args
.
command
:
raise
RuntimeError
(
"No command argument(s) specified for ifatts"
)
if
HasFileAttributes
(
args
.
file
,
args
.
att
):
if
args
.
cond
==
'true'
and
set
(
args
.
need
)
<=
set
(
args
.
have
):
stdout_result
=
shellcmd
(
args
.
command
,
echo
=
args
.
echo_cmd
)
if
not
args
.
echo_cmd
:
sys
.
stdout
.
write
(
stdout_result
)
...
...
tests_lit/lit.cfg
View file @
6af6336d
...
...
@@ -39,7 +39,7 @@ import sys
import lit.formats
sys.path.insert(0, 'pydir')
from utils import FindBaseNaCl
from utils import FindBaseNaCl
, shellcmd
from ifatts import GetFileAttributes
# name: The name of this test suite.
...
...
@@ -69,18 +69,23 @@ llvmbinpath = os.path.abspath(os.environ.get('LLVM_BIN_PATH'))
# Define the location of the llvm2ice tool.
llvm2icetool = os.path.join(bin_root, 'llvm2ice')
llvm2icetoolatts = os.path.join(bin_root, 'llvm2ice.build_atts')
llvm2iceatts = shellcmd(' '.join([llvm2icetool, '--build-atts']),
echo=False).split()
# Add build attributes of llvm2ice tool to the set of available features.
config.available_features.update(
GetFileAttributes(llvm2icetoolatts)
)
config.available_features.update(
llvm2iceatts
)
# Base command for testing build attributes
if_atts_base = [os.path.join(pydir, 'ifatts.py'), llvm2icetoolatts]
if_atts_cmd = if_atts_base + ['--command']
ifl2i_atts_cmd = if_atts_base + ['--att=allow_llvm_ir', '--command']
iflc2i_atts_cmd = if_atts_base + ['--att=allow_llvm_ir',
'--att=allow_llvm_ir_as_input',
'--command']
def if_cond_flag(Value):
return '--cond=true' if Value else '--cond=false'
# shell conditional commands.
if_atts = [os.path.join(pydir, 'if.py')]
if_atts_cmd = if_atts + ['--have=' + att
for att in llvm2iceatts] + ['--command']
ifl2i_atts_cmd = if_atts + [if_cond_flag('allow_llvm_ir' in llvm2iceatts),
'--command']
iflc2i_atts_cmd = if_atts + [if_cond_flag('allow_llvm_ir_as_input'
in llvm2iceatts), '--command']
# Base command for running llvm2ice
llvm2ice_cmd = [os.path.join(pydir, 'run-llvm2ice.py'),
...
...
@@ -129,3 +134,4 @@ def dbg(s):
dbg('bin_root = %s' % bin_root)
dbg('llvmbinpath = %s' % llvmbinpath)
dbg("Build attributes = %s" % llvm2iceatts)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment