aboutsummaryrefslogtreecommitdiff
path: root/src/intertyper.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-17 14:52:05 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-17 14:52:05 -0800
commit074e5f54d468730b3719fac72710322170a20535 (patch)
tree62c1f335e1ac360c32ad57e54677bb5c9a39b2d2 /src/intertyper.js
parent76ddb8091266741ae046d1b6fdeef4f782617d5b (diff)
handle atomic operations appearing in libc++
Diffstat (limited to 'src/intertyper.js')
-rw-r--r--src/intertyper.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index 7bc23653..6b46cdbb 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -366,6 +366,8 @@ function intertyper(data, sidePass, baseLineNums) {
return '/dev/null';
if (tokensLength >= 3 && token0Text == 'invoke')
return 'Invoke';
+ if (tokensLength >= 3 && token0Text == 'atomicrmw' || token0Text == 'cmpxchg')
+ return 'Atomic';
} else {
// Already intertyped
if (item.parentSlot)
@@ -739,6 +741,21 @@ function intertyper(data, sidePass, baseLineNums) {
return result.ret;
}
});
+ substrate.addActor('Atomic', {
+ processItem: function(item) {
+ item.intertype = 'atomic';
+ if (item.tokens[0].text == 'atomicrmw') {
+ item.op = item.tokens[1].text;
+ item.tokens.splice(1, 1);
+ } else {
+ assert(item.tokens[0].text == 'cmpxchg')
+ item.op = 'cmpxchg';
+ }
+ var last = getTokenIndexByText(item.tokens, ';');
+ item.params = splitTokenList(item.tokens.slice(1, last)).map(parseLLVMSegment);
+ this.forwardItem(item, 'Reintegrator');
+ }
+ });
// 'landingpad' - just a stub implementation
substrate.addActor('Landingpad', {
processItem: function(item) {