aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-05-13 12:14:10 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-08 16:32:32 -0700
commit30a929e104a5874620a8b048e9e5fd935006fb5b (patch)
tree2077ab79294dec2805b71fa345feb21dbd75aa91
parent29a14a85978c7b09858f738db7c885907ef39797 (diff)
metadata parsing tweaks
Modified by ncbray to simultaniously support LLVM 3.2 and 3.3.
-rw-r--r--src/modules.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules.js b/src/modules.js
index f85e7d0e..edfbae5c 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -46,7 +46,9 @@ var Debugging = {
var form3ab = new RegExp(/^!(\d+) = metadata !{i32 \d+, (?:metadata !\d+|i32 \d+|null), metadata !(\d+).*$/);
var form3ac = new RegExp(/^!(\d+) = metadata !{i32 \d+, (?:metadata !\d+|null), metadata !"[^"]*", metadata !(\d+)[^\[]*.*$/);
var form3ad = new RegExp(/^!(\d+) = metadata !{i32 \d+, (?:i32 \d+|null), (?:i32 \d+|null), metadata !"[^"]*", metadata !"[^"]*", metadata !"[^"]*", metadata !(\d+),.*$/);
- var form3b = new RegExp(/^!(\d+) = metadata !{i32 \d+, metadata !"([^"]+)", metadata !"([^"]*)", (metadata !\d+|null)}.*$/);
+ var form3ae = new RegExp(/^!(\d+) = metadata !{i32 \d+, metadata !(\d+).*$/);
+ // LLVM 3.3 drops the first and last parameters.
+ var form3b = new RegExp(/^!(\d+) = metadata !{(?:i32 \d+, )?metadata !"([^"]+)", metadata !"([^"]*)"(?:, (metadata !\d+|null))?}.*$/);
var form3c = new RegExp(/^!(\d+) = metadata !{\w+\d* !?(\d+)[^\d].*$/);
var form4 = new RegExp(/^!llvm.dbg.[\w\.]+ = .*$/);
var form5 = new RegExp(/^!(\d+) = metadata !{.*$/);
@@ -75,7 +77,7 @@ var Debugging = {
lines[i] = ';'; // return an empty line, to keep line numbers of subsequent lines the same
continue;
}
- calc = form3a.exec(line) || form3ab.exec(line) || form3ac.exec(line) || form3ad.exec(line);
+ calc = form3a.exec(line) || form3ab.exec(line) || form3ac.exec(line) || form3ad.exec(line) || form3ae.exec(line);
if (calc) {
metadataToParentMetadata[calc[1]] = calc[2];
lines[i] = ';';