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
c561b59e
There was an error fetching the commit references. Please try again later.
Commit
c561b59e
authored
5 years ago
by
Zuzana Baranová
Browse files
Options
Downloads
Patches
Plain Diff
CC: Move is_{,object_}type() from divcc into cc/filetype.
parent
cc8fc2ba
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/filetype.cpp
+10
-0
10 additions, 0 deletions
divine/cc/filetype.cpp
divine/cc/filetype.hpp
+2
-1
2 additions, 1 deletion
divine/cc/filetype.hpp
tools/divcc.cpp
+5
-15
5 additions, 15 deletions
tools/divcc.cpp
with
17 additions
and
16 deletions
divine/cc/filetype.cpp
+
10
−
0
View file @
c561b59e
...
...
@@ -73,5 +73,15 @@ std::vector< std::string > argsOfType( FileType t ) {
return
out
;
}
bool
is_type
(
std
::
string
file
,
FileType
type
)
{
return
cc
::
typeFromFile
(
file
)
==
type
;
}
bool
is_object_type
(
std
::
string
file
)
{
return
is_type
(
file
,
FileType
::
Obj
)
||
is_type
(
file
,
FileType
::
Archive
);
}
}
// cc
}
// divine
This diff is collapsed.
Click to expand it.
divine/cc/filetype.hpp
+
2
−
1
View file @
c561b59e
...
...
@@ -38,7 +38,8 @@ using FileEntry = brick::types::Union< File, Lib >;
FileType
typeFromFile
(
std
::
string
name
);
FileType
typeFromXOpt
(
std
::
string
selector
);
std
::
vector
<
std
::
string
>
argsOfType
(
FileType
t
);
bool
is_type
(
std
::
string
file
,
FileType
type
);
bool
is_object_type
(
std
::
string
file
);
template
<
typename
A
,
typename
B
=
std
::
initializer_list
<
std
::
decay_t
<
decltype
(
*
std
::
declval
<
A
&
>().
begin
()
)
>
>
>
...
...
This diff is collapsed.
Click to expand it.
tools/divcc.cpp
+
5
−
15
View file @
c561b59e
...
...
@@ -68,16 +68,6 @@ void addSection( std::string filepath, std::string sectionName, const std::strin
+
", objcopy exited with "
+
to_string
(
r
)
);
}
bool
is_type
(
std
::
string
file
,
FileType
type
)
{
return
cc
::
typeFromFile
(
file
)
==
type
;
}
bool
is_object_type
(
std
::
string
file
)
{
return
is_type
(
file
,
FileType
::
Obj
)
||
is_type
(
file
,
FileType
::
Archive
);
}
bool
whitelisted
(
llvm
::
Function
&
f
)
{
using
brick
::
string
::
startsWith
;
...
...
@@ -162,7 +152,7 @@ int compile( cc::ParsedOpts& po, cc::CC1& clang, PairedFiles& objFiles )
{
if
(
file
.
first
==
"lib"
)
continue
;
if
(
is_object_type
(
file
.
first
)
)
if
(
cc
::
is_object_type
(
file
.
first
)
)
continue
;
auto
mod
=
clang
.
compile
(
file
.
first
,
po
.
opts
);
cc
::
emit_obj_file
(
*
mod
,
file
.
second
);
...
...
@@ -192,7 +182,7 @@ std::vector< std::string > ld_args( cc::ParsedOpts& po, PairedFiles& objFiles )
continue
;
}
if
(
is_object_type
(
file
.
first
)
)
if
(
cc
::
is_object_type
(
file
.
first
)
)
args
.
push_back
(
file
.
first
);
else
args
.
push_back
(
file
.
second
);
...
...
@@ -260,7 +250,7 @@ int compile_and_link( cc::ParsedOpts& po, cc::CC1& clang, PairedFiles& objFiles,
for
(
auto
file
:
objFiles
)
{
if
(
is_object_type
(
file
.
first
)
)
if
(
cc
::
is_object_type
(
file
.
first
)
)
continue
;
std
::
string
ofn
=
file
.
second
;
unlink
(
ofn
.
c_str
()
);
...
...
@@ -325,7 +315,7 @@ int main( int argc, char **argv )
for
(
auto
srcFile
:
po
.
files
)
{
std
::
string
ifn
=
srcFile
.
get
<
cc
::
File
>
().
name
;
if
(
is_object_type
(
ifn
)
)
if
(
cc
::
is_object_type
(
ifn
)
)
continue
;
std
::
cout
<<
clang
.
preprocess
(
ifn
,
po
.
opts
);
}
...
...
@@ -348,7 +338,7 @@ int main( int argc, char **argv )
ofn
+=
".o"
;
}
if
(
is_object_type
(
ifn
)
)
if
(
cc
::
is_object_type
(
ifn
)
)
ofn
=
ifn
;
objFiles
.
emplace_back
(
ifn
,
ofn
);
}
...
...
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