diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-01-11 15:19:14 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-01-11 15:19:14 -0800 |
commit | a54e90879958c3f89a74c15160cf10b2276a54ab (patch) | |
tree | 5dea3baeafe5580bc50ce2705dc6128080b370a5 | |
parent | 91a244f733b7db2c7779b215b5d0748ae43bae1b (diff) | |
download | binaryen-a54e90879958c3f89a74c15160cf10b2276a54ab.tar.gz binaryen-a54e90879958c3f89a74c15160cf10b2276a54ab.tar.bz2 binaryen-a54e90879958c3f89a74c15160cf10b2276a54ab.zip |
ignore @FUNCTION
-rw-r--r-- | src/s2wasm.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index a0ecfd710..b99a71159 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -200,7 +200,7 @@ private: return false; } else { // a global constant, we need to fix it up later - Name name = getStrToSep(); + Name name = cleanFunction(getStrToSep()); int offset = 0; if (*s == '+') { s++; @@ -316,6 +316,16 @@ private: abort_on("getType"); } + // The LLVM backend emits function names as name@FUNCTION. We can drop the @ and after it. + Name cleanFunction(Name name) { + if (!strchr(name.str, '@')) return name; + char *temp = strdup(name.str); + *strchr(temp, '@') = 0; + Name ret = cashew::IString(temp, false); + free(temp); + return ret; + } + // processors void scan() { @@ -577,7 +587,7 @@ private: curr = specific; } else { assign = getAssign(); - Name target = getCommaSeparated(); + Name target = cleanFunction(getCommaSeparated()); if (implementedFunctions.count(target) > 0) { auto specific = allocator.alloc<Call>(); specific->target = target; |