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
ab06df31
Commit
ab06df31
authored
Oct 29, 2014
by
Karl Schimpf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove IceConverter when LLVM IR is not allowed.
BUG= R=stichnot@chromium.org Review URL:
https://codereview.chromium.org/689433002
parent
6af6336d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
8 deletions
+27
-8
Makefile.standalone
Makefile.standalone
+10
-2
crosstest.py
pydir/crosstest.py
+1
-0
run-llvm2ice.py
pydir/run-llvm2ice.py
+4
-2
llvm2ice.cpp
src/llvm2ice.cpp
+12
-4
No files found.
Makefile.standalone
View file @
ab06df31
...
...
@@ -86,12 +86,11 @@ CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \
-I
$(LIBCXX_INSTALL_PATH)
/include/c++/v1
LDFLAGS
:=
$(HOST_FLAGS)
-L
$(LIBCXX_INSTALL_PATH)
/lib
SRCS
=
\
SRCS
=
\
assembler.cpp
\
assembler_ia32.cpp
\
IceCfg.cpp
\
IceCfgNode.cpp
\
IceConverter.cpp
\
IceGlobalContext.cpp
\
IceGlobalInits.cpp
\
IceInst.cpp
\
...
...
@@ -111,6 +110,10 @@ SRCS= \
llvm2ice.cpp
\
PNaClTranslator.cpp
ifndef
MINIMAL
SRCS
+=
IceConverter.cpp
endif
OBJS
=
$
(
patsubst %.cpp,
$(OBJDIR)
/%.o,
$(SRCS)
)
# Keep all the first target so it's the default.
...
...
@@ -146,8 +149,13 @@ check-lit: llvm2ice make_symlink
LLVM_BIN_PATH
=
$(LLVM_BIN_PATH)
\
$(LLVM_SRC_PATH)
/utils/lit/lit.py
-sv
tests_lit
ifdef
MINIMAL
check
:
check-lit
@
echo
"Crosstests ignored, minimal build"
else
check
:
check-lit
(
cd
crosstest
;
./runtests.sh
)
endif
# TODO: Fix the use of wildcards.
# Assumes clang-format is within $PATH.
...
...
pydir/crosstest.py
View file @
ab06df31
...
...
@@ -105,6 +105,7 @@ if __name__ == '__main__':
'--target='
+
args
.
target
,
'--prefix='
+
args
.
prefix
,
'-allow-uninitialized-globals'
,
'-build-on-read=0'
,
'-o='
+
asm_sz
,
bitcode
])
shellcmd
([
'llvm-mc'
,
...
...
pydir/run-llvm2ice.py
View file @
ab06df31
...
...
@@ -74,8 +74,10 @@ def main():
cmd
+=
[
'--bitcode-format=pnacl'
]
if
not
args
.
no_local_syms
:
cmd
+=
[
'--allow-local-symbol-tables'
]
if
not
(
args
.
llvm
or
args
.
llvm_source
):
cmd
+=
[
'--build-on-read'
]
if
args
.
llvm
or
args
.
llvm_source
:
cmd
+=
[
'--build-on-read=0'
]
else
:
cmd
+=
[
'--build-on-read=1'
]
if
args
.
args
:
cmd
+=
args
.
args
if
args
.
llvm_source
:
...
...
src/llvm2ice.cpp
View file @
ab06df31
...
...
@@ -148,10 +148,14 @@ static cl::opt<std::string>
"unnamed functions"
),
cl
::
init
(
"Function"
));
// Note: While this flag isn't used in the minimal build, we keep this
// flag so that tests can set this command-line flag without concern
// to the type of build. We double check that this flag at runtime
// to make sure the consistency is maintained.
static
cl
::
opt
<
bool
>
BuildOnRead
(
"build-on-read"
,
cl
::
desc
(
"Build ICE instructions when reading bitcode"
),
cl
::
init
(
fals
e
));
BuildOnRead
(
"build-on-read"
,
cl
::
desc
(
"Build ICE instructions when reading bitcode"
),
cl
::
init
(
tru
e
));
static
cl
::
opt
<
bool
>
UseIntegratedAssembler
(
"integrated-as"
,
...
...
@@ -271,7 +275,7 @@ int main(int argc, char **argv) {
Ice
::
PNaClTranslator
Translator
(
&
Ctx
,
Flags
);
Translator
.
translate
(
IRFilename
);
ErrorStatus
=
Translator
.
getErrorStatus
();
}
else
{
}
else
if
(
ALLOW_LLVM_IR
)
{
// Parse the input LLVM IR file into a module.
SMDiagnostic
Err
;
Ice
::
TimerMarker
T1
(
Ice
::
TimerStack
::
TT_parse
,
&
Ctx
);
...
...
@@ -286,6 +290,10 @@ int main(int argc, char **argv) {
Ice
::
Converter
Converter
(
Mod
,
&
Ctx
,
Flags
);
Converter
.
convertToIce
();
ErrorStatus
=
Converter
.
getErrorStatus
();
}
else
{
*
Ls
<<
"Error: Build doesn't allow LLVM IR, "
<<
"--build-on-read=0 not allowed
\n
"
;
return
GetReturnValue
(
1
);
}
if
(
TimeEachFunction
)
{
const
bool
DumpCumulative
=
false
;
...
...
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