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
4f4d9d5b
There was an error fetching the commit references. Please try again later.
Commit
4f4d9d5b
authored
5 years ago
by
Petr Rockai
Browse files
Options
Downloads
Patches
Plain Diff
tools: Simplify debug path munging in runtime-cc.
parent
4d6cad1b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/runtime-cc.cpp
+8
-16
8 additions, 16 deletions
tools/runtime-cc.cpp
with
8 additions
and
16 deletions
tools/runtime-cc.cpp
+
8
−
16
View file @
4f4d9d5b
...
@@ -15,7 +15,7 @@ DIVINE_UNRELAX_WARNINGS
...
@@ -15,7 +15,7 @@ DIVINE_UNRELAX_WARNINGS
using
namespace
divine
;
using
namespace
divine
;
using
namespace
brick
;
using
namespace
brick
;
#define VERSION "
3
"
/* bump this to force rebuilds despite .fp matches */
#define VERSION "
4
"
/* bump this to force rebuilds despite .fp matches */
/* usage: runtime-cc srcdir bindir source.c output.bc [flags] */
/* usage: runtime-cc srcdir bindir source.c output.bc [flags] */
int
main
(
int
argc
,
const
char
**
argv
)
int
main
(
int
argc
,
const
char
**
argv
)
...
@@ -33,7 +33,8 @@ int main( int argc, const char **argv )
...
@@ -33,7 +33,8 @@ int main( int argc, const char **argv )
std
::
string
fpFilename
=
std
::
string
(
argv
[
4
]
)
+
".fp"
;
std
::
string
fpFilename
=
std
::
string
(
argv
[
4
]
)
+
".fp"
;
std
::
string
oldFp
=
fs
::
readFileOr
(
fpFilename
,
{}
);
std
::
string
oldFp
=
fs
::
readFileOr
(
fpFilename
,
{}
);
std
::
string
newFp
=
VERSION
":"
+
sha2
::
to_hex
(
sha2_512
(
prec
)
);
std
::
string
newFp
=
VERSION
":"
+
sha2
::
to_hex
(
sha2_512
(
prec
)
);
if
(
oldFp
==
newFp
&&
fs
::
exists
(
argv
[
4
]
)
)
{
if
(
oldFp
==
newFp
&&
fs
::
exists
(
argv
[
4
]
)
)
{
fs
::
touch
(
argv
[
4
]
);
fs
::
touch
(
argv
[
4
]
);
return
0
;
return
0
;
}
}
...
@@ -41,22 +42,13 @@ int main( int argc, const char **argv )
...
@@ -41,22 +42,13 @@ int main( int argc, const char **argv )
lart
::
divine
::
rewriteDebugPaths
(
*
mod
,
[
=
](
auto
p
)
lart
::
divine
::
rewriteDebugPaths
(
*
mod
,
[
=
](
auto
p
)
{
{
std
::
string
relpath
;
auto
n
=
p
;
if
(
string
::
startsWith
(
p
,
srcDir
)
)
if
(
string
::
startsWith
(
p
,
srcDir
)
)
relpath
=
p
.
substr
(
srcDir
.
size
()
);
n
=
p
.
substr
(
srcDir
.
size
()
);
else
if
(
string
::
startsWith
(
p
,
binDir
)
)
else
if
(
string
::
startsWith
(
p
,
binDir
)
)
relpath
=
p
.
substr
(
binDir
.
size
()
);
n
=
p
.
substr
(
binDir
.
size
()
);
if
(
string
::
startsWith
(
relpath
,
"/dios"
)
)
TRACE
(
"rewrite"
,
p
,
"to"
,
n
);
relpath
=
relpath
.
substr
(
5
);
return
n
;
if
(
!
relpath
.
empty
()
)
{
while
(
fs
::
isPathSeparator
(
relpath
[
0
]
)
)
relpath
.
erase
(
relpath
.
begin
()
);
auto
result
=
fs
::
joinPath
(
rt
::
directory
(
relpath
),
relpath
);
TRACE
(
"rewrite"
,
p
,
"to"
,
result
);
return
result
;
}
return
p
;
}
);
}
);
brick
::
llvm
::
writeModule
(
mod
.
get
(),
argv
[
4
]
);
brick
::
llvm
::
writeModule
(
mod
.
get
(),
argv
[
4
]
);
...
...
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