Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Liew
klee-cl
Commits
b20d70d6
Commit
b20d70d6
authored
Oct 24, 2013
by
Daniel Liew
Browse files
Added support for printing ref<Expr> to llvm::raw_ostream
parent
3d2b9eab
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/klee/Expr.h
View file @
b20d70d6
...
@@ -17,10 +17,12 @@
...
@@ -17,10 +17,12 @@
#include
"llvm/ADT/APFloat.h"
#include
"llvm/ADT/APFloat.h"
#include
"llvm/ADT/DenseSet.h"
#include
"llvm/ADT/DenseSet.h"
#include
"llvm/ADT/SmallVector.h"
#include
"llvm/ADT/SmallVector.h"
#include
"llvm/Support/raw_ostream.h"
#include
<set>
#include
<set>
#include
<vector>
#include
<vector>
#include
<iosfwd>
// FIXME: Remove this!!!
#include
<iosfwd>
// FIXME: Remove this!!!
#include
<sstream>
// For llvm::raw_ostream hack
namespace
llvm
{
namespace
llvm
{
class
Type
;
class
Type
;
...
@@ -355,6 +357,24 @@ inline std::ostream &operator<<(std::ostream &os, const Expr::Kind kind) {
...
@@ -355,6 +357,24 @@ inline std::ostream &operator<<(std::ostream &os, const Expr::Kind kind) {
return
os
;
return
os
;
}
}
inline
llvm
::
raw_ostream
&
operator
<<
(
llvm
::
raw_ostream
&
ros
,
const
Expr
&
e
){
// This is a hack. I do not want to template Expr to support
// llvm::raw_ostream so this will have to do!
std
::
ostringstream
ss
;
ss
<<
e
;
ros
<<
ss
.
str
();
return
ros
;
}
inline
llvm
::
raw_ostream
&
operator
<<
(
llvm
::
raw_ostream
&
ros
,
const
Expr
::
Kind
kind
){
// This is a hack. I do not want to template Expr to support
// llvm::raw_ostream so this will have to do!
std
::
ostringstream
ss
;
ss
<<
kind
;
ros
<<
ss
.
str
();
return
ros
;
}
// Terminal Exprs
// Terminal Exprs
class
ConstantExpr
:
public
Expr
{
class
ConstantExpr
:
public
Expr
{
...
...
include/klee/util/Ref.h
View file @
b20d70d6
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#define KLEE_REF_H
#define KLEE_REF_H
#include
"llvm/Support/Casting.h"
#include
"llvm/Support/Casting.h"
#include
"llvm/Support/raw_ostream.h"
using
llvm
::
isa
;
using
llvm
::
isa
;
using
llvm
::
cast
;
using
llvm
::
cast
;
using
llvm
::
cast_or_null
;
using
llvm
::
cast_or_null
;
...
@@ -113,6 +114,12 @@ inline std::ostream &operator<<(std::ostream &os, const ref<T> &e) {
...
@@ -113,6 +114,12 @@ inline std::ostream &operator<<(std::ostream &os, const ref<T> &e) {
return
os
;
return
os
;
}
}
template
<
class
T
>
inline
llvm
::
raw_ostream
&
operator
<<
(
llvm
::
raw_ostream
&
os
,
const
ref
<
T
>
&
e
)
{
os
<<
*
e
;
return
os
;
}
}
// end namespace klee
}
// end namespace klee
namespace
llvm
{
namespace
llvm
{
...
...
Write
Preview
Supports
Markdown
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