Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dr. Michael Petter
LLVM-abstractinterpretation
Commits
bec634ca
Verified
Commit
bec634ca
authored
Mar 15, 2020
by
Tim Gymnich
Browse files
fixed debug output
parent
d2f76261
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/affine_relation.cpp
View file @
bec634ca
...
...
@@ -317,10 +317,20 @@ unordered_map<Value const*, int> AffineRelation::createVariableIndexMap(Function
// MARK: - debug output
unordered_map
<
int
,
Value
const
*>
reverseMap
(
unordered_map
<
Value
const
*
,
int
>
map
)
{
unordered_map
<
int
,
Value
const
*>
reversed
;
for
(
auto
[
key
,
value
]
:
map
)
{
reversed
[
value
]
=
key
;
}
return
reversed
;
}
void
AffineRelation
::
printIncoming
(
BasicBlock
const
&
bb
,
raw_ostream
&
out
,
int
indentation
)
const
{
auto
reversed
=
reverseMap
(
index
);
for
(
auto
m
:
basis
)
{
out
<<
llvm
::
left_justify
(
""
,
8
);
for
(
auto
[
val
,
idx
]
:
index
)
{
for
(
int
i
=
1
;
i
<=
getNumberOfVariables
();
i
++
)
{
auto
val
=
reversed
[
i
];
if
(
val
->
hasName
())
{
out
<<
llvm
::
left_justify
(
val
->
getName
(),
6
);
}
else
{
...
...
@@ -332,9 +342,11 @@ void AffineRelation::printIncoming(BasicBlock const& bb, raw_ostream& out, int i
}
void
AffineRelation
::
printOutgoing
(
BasicBlock
const
&
bb
,
raw_ostream
&
out
,
int
indentation
)
const
{
auto
reversed
=
reverseMap
(
index
);
for
(
auto
m
:
basis
)
{
out
<<
llvm
::
left_justify
(
""
,
8
);
for
(
auto
[
val
,
idx
]
:
index
)
{
for
(
int
i
=
1
;
i
<=
getNumberOfVariables
();
i
++
)
{
auto
val
=
reversed
[
i
];
if
(
val
->
hasName
())
{
out
<<
llvm
::
left_justify
(
val
->
getName
(),
6
);
}
else
{
...
...
@@ -346,9 +358,11 @@ void AffineRelation::printOutgoing(BasicBlock const& bb, raw_ostream& out, int i
}
void
AffineRelation
::
debug_output
(
Instruction
const
&
inst
,
Matrix
<
int
>
operands
)
{
auto
reversed
=
reverseMap
(
index
);
for
(
auto
m
:
basis
)
{
dbgs
(
3
)
<<
llvm
::
left_justify
(
""
,
8
);
for
(
auto
[
val
,
idx
]
:
index
)
{
for
(
int
i
=
1
;
i
<=
getNumberOfVariables
();
i
++
)
{
auto
val
=
reversed
[
i
];
if
(
val
->
hasName
())
{
dbgs
(
3
)
<<
llvm
::
left_justify
(
val
->
getName
(),
6
);
}
else
{
...
...
src/affine_relation.h
View file @
bec634ca
...
...
@@ -12,7 +12,7 @@ namespace pcpo {
class
AffineRelation
{
private:
/// Only valid when `createVariableIndexMap` has been generated.
int
getNumberOfVariables
()
{
return
index
.
size
();
};
int
getNumberOfVariables
()
const
{
return
index
.
size
();
};
std
::
unordered_map
<
llvm
::
Value
const
*
,
int
>
createVariableIndexMap
(
llvm
::
Function
const
&
func
);
public:
std
::
unordered_map
<
llvm
::
Value
const
*
,
int
>
index
;
...
...
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