Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
90398bd2
Commit
90398bd2
authored
15 years ago
by
Daniel Dunbar
Browse files
Options
Downloads
Patches
Plain Diff
llvm-mc: Make MCValue take const MCSymbol*s.
llvm-svn: 80078
parent
18f3c9b9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llvm/include/llvm/MC/MCValue.h
+5
-4
5 additions, 4 deletions
llvm/include/llvm/MC/MCValue.h
llvm/tools/llvm-mc/AsmExpr.cpp
+4
-4
4 additions, 4 deletions
llvm/tools/llvm-mc/AsmExpr.cpp
with
9 additions
and
8 deletions
llvm/include/llvm/MC/MCValue.h
+
5
−
4
View file @
90398bd2
...
@@ -33,13 +33,13 @@ class raw_ostream;
...
@@ -33,13 +33,13 @@ class raw_ostream;
/// Note that this class must remain a simple POD value class, because we need
/// Note that this class must remain a simple POD value class, because we need
/// it to live in unions etc.
/// it to live in unions etc.
class
MCValue
{
class
MCValue
{
MCSymbol
*
SymA
,
*
SymB
;
const
MCSymbol
*
SymA
,
*
SymB
;
int64_t
Cst
;
int64_t
Cst
;
public:
public:
int64_t
getConstant
()
const
{
return
Cst
;
}
int64_t
getConstant
()
const
{
return
Cst
;
}
MCSymbol
*
getSymA
()
const
{
return
SymA
;
}
const
MCSymbol
*
getSymA
()
const
{
return
SymA
;
}
MCSymbol
*
getSymB
()
const
{
return
SymB
;
}
const
MCSymbol
*
getSymB
()
const
{
return
SymB
;
}
/// isAbsolute - Is this an absolute (as opposed to relocatable) value.
/// isAbsolute - Is this an absolute (as opposed to relocatable) value.
bool
isAbsolute
()
const
{
return
!
SymA
&&
!
SymB
;
}
bool
isAbsolute
()
const
{
return
!
SymA
&&
!
SymB
;
}
...
@@ -60,7 +60,8 @@ public:
...
@@ -60,7 +60,8 @@ public:
/// dump - Print the value to stderr.
/// dump - Print the value to stderr.
void
dump
()
const
;
void
dump
()
const
;
static
MCValue
get
(
MCSymbol
*
SymA
,
MCSymbol
*
SymB
=
0
,
int64_t
Val
=
0
)
{
static
MCValue
get
(
const
MCSymbol
*
SymA
,
const
MCSymbol
*
SymB
=
0
,
int64_t
Val
=
0
)
{
MCValue
R
;
MCValue
R
;
assert
((
!
SymB
||
SymA
)
&&
"Invalid relocatable MCValue!"
);
assert
((
!
SymB
||
SymA
)
&&
"Invalid relocatable MCValue!"
);
R
.
Cst
=
Val
;
R
.
Cst
=
Val
;
...
...
This diff is collapsed.
Click to expand it.
llvm/tools/llvm-mc/AsmExpr.cpp
+
4
−
4
View file @
90398bd2
...
@@ -26,16 +26,16 @@ bool AsmExpr::EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const {
...
@@ -26,16 +26,16 @@ bool AsmExpr::EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const {
return
true
;
return
true
;
}
}
static
bool
EvaluateSymbolicAdd
(
const
MCValue
&
LHS
,
MCSymbol
*
RHS_A
,
static
bool
EvaluateSymbolicAdd
(
const
MCValue
&
LHS
,
const
MCSymbol
*
RHS_A
,
MCSymbol
*
RHS_B
,
int64_t
RHS_Cst
,
const
MCSymbol
*
RHS_B
,
int64_t
RHS_Cst
,
MCValue
&
Res
)
{
MCValue
&
Res
)
{
// We can't add or subtract two symbols.
// We can't add or subtract two symbols.
if
((
LHS
.
getSymA
()
&&
RHS_A
)
||
if
((
LHS
.
getSymA
()
&&
RHS_A
)
||
(
LHS
.
getSymB
()
&&
RHS_B
))
(
LHS
.
getSymB
()
&&
RHS_B
))
return
false
;
return
false
;
MCSymbol
*
A
=
LHS
.
getSymA
()
?
LHS
.
getSymA
()
:
RHS_A
;
const
MCSymbol
*
A
=
LHS
.
getSymA
()
?
LHS
.
getSymA
()
:
RHS_A
;
MCSymbol
*
B
=
LHS
.
getSymB
()
?
LHS
.
getSymB
()
:
RHS_B
;
const
MCSymbol
*
B
=
LHS
.
getSymB
()
?
LHS
.
getSymB
()
:
RHS_B
;
if
(
B
)
{
if
(
B
)
{
// If we have a negated symbol, then we must have also have a non-negated
// If we have a negated symbol, then we must have also have a non-negated
// symbol in order to encode the expression. We can do this check later to
// symbol in order to encode the expression. We can do this check later to
...
...
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