Add llvm-bcanalyzer support for new metadata node types.

Also sort the existing list by value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290901 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl 2017-01-03 19:17:49 +00:00
parent efca1a3767
commit 639592de22
2 changed files with 13 additions and 6 deletions

View File

@ -1,5 +1,8 @@
; RUN: llvm-dis -o - %s.bc | FileCheck %s
; RUN: llvm-dis -o - %s.bc | llvm-as - | llvm-bcanalyzer -dump - | FileCheck %s --check-prefix=BC
; BC: GLOBAL_VAR_EXPR
; BC: GLOBAL_DECL_ATTACHMENT
; CHECK: @g = common global i32 0, align 4, !dbg ![[G:[0-9]+]]
; CHECK: @h = common global i32 0, align 4, !dbg ![[H:[0-9]+]]
; CHECK: ![[G]] = {{.*}}!DIGlobalVariableExpression(var: ![[GVAR:[0-9]+]], expr: ![[GEXPR:[0-9]+]])

View File

@ -322,16 +322,15 @@ static const char *GetCodeName(unsigned CodeID, unsigned BlockID,
switch(CodeID) {
default:return nullptr;
STRINGIFY_CODE(METADATA, STRING_OLD)
STRINGIFY_CODE(METADATA, STRINGS)
STRINGIFY_CODE(METADATA, NAME)
STRINGIFY_CODE(METADATA, KIND) // Older bitcode has it in a MODULE_BLOCK
STRINGIFY_CODE(METADATA, NODE)
STRINGIFY_CODE(METADATA, VALUE)
STRINGIFY_CODE(METADATA, NODE)
STRINGIFY_CODE(METADATA, NAME)
STRINGIFY_CODE(METADATA, DISTINCT_NODE)
STRINGIFY_CODE(METADATA, KIND) // Older bitcode has it in a MODULE_BLOCK
STRINGIFY_CODE(METADATA, LOCATION)
STRINGIFY_CODE(METADATA, OLD_NODE)
STRINGIFY_CODE(METADATA, OLD_FN_NODE)
STRINGIFY_CODE(METADATA, NAMED_NODE)
STRINGIFY_CODE(METADATA, DISTINCT_NODE)
STRINGIFY_CODE(METADATA, LOCATION)
STRINGIFY_CODE(METADATA, GENERIC_DEBUG)
STRINGIFY_CODE(METADATA, SUBRANGE)
STRINGIFY_CODE(METADATA, ENUMERATOR)
@ -353,6 +352,11 @@ static const char *GetCodeName(unsigned CodeID, unsigned BlockID,
STRINGIFY_CODE(METADATA, OBJC_PROPERTY)
STRINGIFY_CODE(METADATA, IMPORTED_ENTITY)
STRINGIFY_CODE(METADATA, MODULE)
STRINGIFY_CODE(METADATA, MACRO)
STRINGIFY_CODE(METADATA, MACRO_FILE)
STRINGIFY_CODE(METADATA, STRINGS)
STRINGIFY_CODE(METADATA, GLOBAL_DECL_ATTACHMENT)
STRINGIFY_CODE(METADATA, GLOBAL_VAR_EXPR)
STRINGIFY_CODE(METADATA, INDEX_OFFSET)
STRINGIFY_CODE(METADATA, INDEX)
}