diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-13 11:49:02 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-13 11:49:02 -0700 |
commit | fae19ff8567d874f7da6a614516ebd0f21de8e8c (patch) | |
tree | 85b43f06e61385940aec2761c581354c8f47dda2 | |
parent | 984e7b2aff83c41a8272058ab4716bfc222ff58e (diff) |
warn if triple is not what we expect
-rw-r--r-- | src/intertyper.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 3fc840c4..31e97bd0 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -365,8 +365,17 @@ function intertyper(data, sidePass, baseLineNums) { } if (tokensLength >= 3 && (token0Text == 'call' || token1Text == 'call')) return 'Call'; - if (token0Text == 'target') + if (token0Text == 'target') { + if (token1Text == 'triple') { + var triple = item.tokens[3].text; + triple = triple.substr(1, triple.length-2); + var expected = TARGET_LE32 ? 'le32-unknown-nacl' : 'i386-pc-linux-gnu'; + if (triple !== expected) { + warn('using an unexpected LLVM triple: ' + [triple, ' !== ', expected] + ' (are you using emcc for everything and not clang?)'); + } + } return '/dev/null'; + } if (token0Text == ';') return '/dev/null'; if (tokensLength >= 3 && token0Text == 'invoke') |