[val] Fixup id name output (#2158)

This CL changes the id/name output from the validator to always use a
consistent id[%name] style. This removes the need for getIdOrName. The
name lookup is changed to use the NameMapper so the output is consistent
with what the disassembler will produce.

Fixes #2137
This commit is contained in:
dan sinclair
2018-12-03 17:01:30 -05:00
committed by GitHub
parent ca62aba384
commit 8826140105
20 changed files with 489 additions and 398 deletions
+2 -1
View File
@@ -58,7 +58,8 @@ TEST(CppInterface, SuccessfulRoundTrip) {
EXPECT_EQ(0u, position.line);
EXPECT_EQ(0u, position.column);
EXPECT_EQ(1u, position.index);
EXPECT_STREQ("ID 1 has not been defined\n %2 = OpSizeOf %1 %3\n", message);
EXPECT_STREQ("ID 1[%1] has not been defined\n %2 = OpSizeOf %1 %3\n",
message);
});
EXPECT_FALSE(t.Validate(binary));