diff options
author | alon@honor <none@none> | 2010-11-02 20:59:52 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-11-02 20:59:52 -0700 |
commit | 5a0ba08854750045fd801e536ff49aacc7d2394e (patch) | |
tree | 2a2121e81e0cae9c5dafc16086ded7d62bb9f014 /src/analyzer.js | |
parent | c07e83131ea1f5138d645f39d0ba724fe370ccc1 (diff) |
support for struct/aggregate values in load&store; all tests pass
Diffstat (limited to 'src/analyzer.js')
-rw-r--r-- | src/analyzer.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index 4af7cbc5..4582f0b1 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -257,13 +257,15 @@ function analyzer(data) { // Decision time + var pointedType = removePointing(variable.type); if (variable.origin == 'getelementptr') { // Use our implementation that emulates pointers etc. variable.impl = VAR_EMULATED; } else if (OPTIMIZE && variable.pointingLevels === 0 && !variable.hasAddrTaken) { // A simple int value, can be implemented as a native variable variable.impl = VAR_NATIVE; - } else if (OPTIMIZE && variable.origin === 'alloca' && !variable.hasAddrTaken && !variable.hasValueTaken) { + } else if (OPTIMIZE && variable.origin === 'alloca' && !variable.hasAddrTaken && !variable.hasValueTaken && + (Runtime.isNumberType(pointedType) || Runtime.isPointerType(pointedType))) { // A pointer to a value which is only accessible through this pointer. Basically // a local value on the stack, which nothing fancy is done on. So we can // optimize away the pointing altogether, and just have a native variable |