Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DIVINE
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
paradise
mirror
DIVINE
Commits
c1092587
There was an error fetching the commit references. Please try again later.
Commit
c1092587
authored
5 years ago
by
Zuzana Baranová
Browse files
Options
Downloads
Patches
Plain Diff
CC: Move construction of PairedFiles into Native.
parent
eb78ef2e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
divine/cc/native.cpp
+32
-0
32 additions, 0 deletions
divine/cc/native.cpp
divine/cc/native.hpp
+1
-0
1 addition, 0 deletions
divine/cc/native.hpp
tools/divcc.cpp
+1
-30
1 addition, 30 deletions
tools/divcc.cpp
with
34 additions
and
30 deletions
divine/cc/native.cpp
+
32
−
0
View file @
c1092587
...
...
@@ -102,6 +102,38 @@ namespace divine::cc
return
cc
::
link_bitcode
<
cc
::
Driver
,
false
>
(
_files
,
_clang
,
_po
.
libSearchPath
);
}
void
Native
::
construct_paired_files
()
{
using
namespace
brick
::
fs
;
for
(
auto
srcFile
:
_po
.
files
)
{
if
(
srcFile
.
is
<
cc
::
File
>
()
)
{
std
::
string
ifn
=
srcFile
.
get
<
cc
::
File
>
().
name
;
std
::
string
ofn
=
dropExtension
(
ifn
);
ofn
=
splitFileName
(
ofn
).
second
;
if
(
_po
.
outputFile
!=
""
&&
_po
.
toObjectOnly
)
ofn
=
_po
.
outputFile
;
else
{
if
(
!
_po
.
toObjectOnly
)
ofn
+=
".divcc.temp"
;
ofn
+=
".o"
;
}
if
(
cc
::
is_object_type
(
ifn
)
)
ofn
=
ifn
;
_files
.
emplace_back
(
ifn
,
ofn
);
}
else
{
assert
(
srcFile
.
is
<
cc
::
Lib
>
()
);
_files
.
emplace_back
(
"lib"
,
srcFile
.
get
<
cc
::
Lib
>
().
name
);
}
}
}
Native
::~
Native
()
{
if
(
!
_po
.
toObjectOnly
)
...
...
This diff is collapsed.
Click to expand it.
divine/cc/native.hpp
+
1
−
0
View file @
c1092587
...
...
@@ -38,6 +38,7 @@ namespace divine::cc
void
init_ld_args
();
void
link
();
virtual
std
::
unique_ptr
<
llvm
::
Module
>
link_bitcode
();
void
construct_paired_files
();
cc
::
ParsedOpts
_po
;
PairedFiles
_files
;
...
...
This diff is collapsed.
Click to expand it.
tools/divcc.cpp
+
1
−
30
View file @
c1092587
...
...
@@ -50,10 +50,6 @@ int main( int argc, char **argv )
rt
::
NativeDiosCC
nativeCC
(
{
argv
+
1
,
argv
+
argc
}
);
cc
::
CC1
&
clang
=
nativeCC
.
_clang
;
auto
&
po
=
nativeCC
.
_po
;
auto
&
pairedFiles
=
nativeCC
.
_files
;
using
namespace
brick
::
fs
;
// count files, i.e. not libraries
auto
num_files
=
std
::
count_if
(
po
.
files
.
begin
(),
po
.
files
.
end
(),
...
...
@@ -89,32 +85,7 @@ int main( int argc, char **argv )
return
0
;
}
for
(
auto
srcFile
:
po
.
files
)
{
if
(
srcFile
.
is
<
cc
::
File
>
()
)
{
std
::
string
ifn
=
srcFile
.
get
<
cc
::
File
>
().
name
;
std
::
string
ofn
=
dropExtension
(
ifn
);
ofn
=
splitFileName
(
ofn
).
second
;
if
(
po
.
outputFile
!=
""
&&
po
.
toObjectOnly
)
ofn
=
po
.
outputFile
;
else
{
if
(
!
po
.
toObjectOnly
)
ofn
+=
".divcc.temp"
;
ofn
+=
".o"
;
}
if
(
cc
::
is_object_type
(
ifn
)
)
ofn
=
ifn
;
pairedFiles
.
emplace_back
(
ifn
,
ofn
);
}
else
{
assert
(
srcFile
.
is
<
cc
::
Lib
>
()
);
pairedFiles
.
emplace_back
(
"lib"
,
srcFile
.
get
<
cc
::
Lib
>
().
name
);
}
}
nativeCC
.
construct_paired_files
();
if
(
po
.
toObjectOnly
)
return
nativeCC
.
compile_files
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment