diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-30 22:09:17 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-30 22:09:17 -0700 |
commit | 2e4bc80c40d31dfe975ae11067d423a0bce33bb5 (patch) | |
tree | 365004290335554ff3b06fba2467e0a0c392b57e /src | |
parent | 819c105c234a89e2d0936c1d7218612db43dd56c (diff) |
handle vector zeroinitializers
Diffstat (limited to 'src')
-rw-r--r-- | src/parseTools.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 75ba6fd2..ec907a41 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -157,6 +157,10 @@ function isStructType(type) { return type[0] == '%'; } +function isVectorType(type) { + return type[type.length-1] === '>'; +} + function isStructuralType(type) { return /^{ ?[^}]* ?}$/.test(type); // { i32, i8 } etc. - anonymous struct types } @@ -1986,6 +1990,8 @@ function finalizeLLVMParameter(param, noIndexizeFunctions) { } else if (param.ident == 'zeroinitializer') { if (isStructType(param.type)) { return makeLLVMStruct(zeros(Types.types[param.type].fields.length)); + } else if (isVectorType(param.type)) { + return ensureVector(0, getVectorBaseType(param.type)); } else { return '0'; } |