Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
1de6ecb2
Commit
1de6ecb2
authored
12 years ago
by
Richard Linden
Browse files
Options
Downloads
Patches
Plain Diff
SH-3405 WIP convert existing stats to lltrace system
converted "int" to "S32"
parent
28179ab0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llcommon/llpredicate.cpp
+2
-2
2 additions, 2 deletions
indra/llcommon/llpredicate.cpp
indra/llcommon/llpredicate.h
+19
-15
19 additions, 15 deletions
indra/llcommon/llpredicate.h
with
21 additions
and
17 deletions
indra/llcommon/llpredicate.cpp
+
2
−
2
View file @
1de6ecb2
...
@@ -31,10 +31,10 @@ namespace LLPredicate
...
@@ -31,10 +31,10 @@ namespace LLPredicate
{
{
EmptyRule
make_rule
()
{
return
EmptyRule
();
}
EmptyRule
make_rule
()
{
return
EmptyRule
();
}
int
predicateFlagsFromValue
(
int
value
)
S32
predicateFlagsFromValue
(
S32
value
)
{
{
llassert
(
value
<
5
);
llassert
(
value
<
5
);
static
const
int
predicates
[
5
]
=
static
const
S32
predicates
[
5
]
=
{
{
0xAAAAaaaa
,
// 10101010101010101010101010101010
0xAAAAaaaa
,
// 10101010101010101010101010101010
0xCCCCcccc
,
// 11001100110011001100110011001100
0xCCCCcccc
,
// 11001100110011001100110011001100
...
...
This diff is collapsed.
Click to expand it.
indra/llcommon/llpredicate.h
+
19
−
15
View file @
1de6ecb2
...
@@ -33,7 +33,7 @@ namespace LLPredicate
...
@@ -33,7 +33,7 @@ namespace LLPredicate
{
{
template
<
typename
ENUM
>
class
Rule
;
template
<
typename
ENUM
>
class
Rule
;
int
predicateFlagsFromValue
(
int
value
);
S32
predicateFlagsFromValue
(
S32
value
);
template
<
typename
ENUM
>
template
<
typename
ENUM
>
struct
Value
struct
Value
...
@@ -41,31 +41,35 @@ namespace LLPredicate
...
@@ -41,31 +41,35 @@ namespace LLPredicate
friend
Rule
<
ENUM
>
;
friend
Rule
<
ENUM
>
;
public:
public:
Value
(
ENUM
e
)
Value
(
ENUM
e
)
:
mPredicateCombinationFlags
(
0x
1
)
:
mPredicateCombinationFlags
(
0x
FFFFffff
)
{
{
add
(
e
);
add
(
e
);
}
}
Value
()
Value
()
:
mPredicateCombinationFlags
(
0x
1
)
:
mPredicateCombinationFlags
(
0x
FFFFffff
)
{}
{}
void
add
(
ENUM
predicate
)
void
add
(
ENUM
predicate
)
{
{
llassert
(
predicate
<
5
);
llassert
(
predicate
<
5
);
if
(
!
has
(
predicate
))
S32
predicate_shift
=
0x1
<<
(
S32
)
predicate
;
{
S32
flag_mask
=
predicateFlagsFromValue
(
predicate
);
int
predicate_shift
=
0x1
<<
(
int
)
predicate
;
S32
flags_to_modify
=
mPredicateCombinationFlags
&
~
flag_mask
;
mPredicateCombinationFlags
<<=
predicate_shift
;
// clear flags containing predicate to be removed
}
mPredicateCombinationFlags
&=
~
flag_mask
;
// shift flags, in effect removing predicate
flags_to_modify
<<=
predicate_shift
;
// put modified flags back
mPredicateCombinationFlags
|=
flags_to_modify
;
}
}
void
remove
(
ENUM
predicate
)
void
remove
(
ENUM
predicate
)
{
{
llassert
(
predicate
<
5
);
llassert
(
predicate
<
5
);
int
predicate_shift
=
0x1
<<
(
int
)
predicate
;
S32
predicate_shift
=
0x1
<<
(
S32
)
predicate
;
int
flag_mask
=
predicateFlagsFromValue
(
predicate
);
S32
flag_mask
=
predicateFlagsFromValue
(
predicate
);
int
flags_to_modify
=
mPredicateCombinationFlags
&
flag_mask
;
S32
flags_to_modify
=
mPredicateCombinationFlags
&
flag_mask
;
// clear flags containing predicate to be removed
// clear flags containing predicate to be removed
mPredicateCombinationFlags
&=
~
flag_mask
;
mPredicateCombinationFlags
&=
~
flag_mask
;
// shift flags, in effect removing predicate
// shift flags, in effect removing predicate
...
@@ -77,7 +81,7 @@ namespace LLPredicate
...
@@ -77,7 +81,7 @@ namespace LLPredicate
void
unknown
(
ENUM
predicate
)
void
unknown
(
ENUM
predicate
)
{
{
add
(
predicate
);
add
(
predicate
);
int
flags_with_predicate
=
mPredicateCombinationFlags
;
S32
flags_with_predicate
=
mPredicateCombinationFlags
;
remove
(
predicate
);
remove
(
predicate
);
// unknown is result of adding and removing predicate at the same time!
// unknown is result of adding and removing predicate at the same time!
mPredicateCombinationFlags
|=
flags_with_predicate
;
mPredicateCombinationFlags
|=
flags_with_predicate
;
...
@@ -85,12 +89,12 @@ namespace LLPredicate
...
@@ -85,12 +89,12 @@ namespace LLPredicate
bool
has
(
ENUM
predicate
)
bool
has
(
ENUM
predicate
)
{
{
int
flag_mask
=
predicateFlagsFromValue
(
predicate
);
S32
flag_mask
=
predicateFlagsFromValue
(
predicate
);
return
(
mPredicateCombinationFlags
&
flag_mask
)
!=
0
;
return
(
mPredicateCombinationFlags
&
flag_mask
)
!=
0
;
}
}
private
:
private
:
int
mPredicateCombinationFlags
;
S32
mPredicateCombinationFlags
;
};
};
struct
EmptyRule
{};
struct
EmptyRule
{};
...
@@ -144,7 +148,7 @@ namespace LLPredicate
...
@@ -144,7 +148,7 @@ namespace LLPredicate
}
}
private
:
private
:
int
mPredicateRequirements
;
S32
mPredicateRequirements
;
};
};
template
<
typename
ENUM
>
template
<
typename
ENUM
>
...
...
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