bcanalyzer: Rewrite all the METADATA_ codes

Add all the new `Metadata` codes since LLVM 3.6, and at the same time
follow the precedent set in other blocks by removing the `METADATA_`
prefix from the string output.

llvm-svn: 241016
This commit is contained in:
Duncan P. N. Exon Smith 2015-06-29 22:50:35 +00:00
parent f335bd73c1
commit eba562775f

View File

@ -264,19 +264,41 @@ static const char *GetCodeName(unsigned CodeID, unsigned BlockID,
case bitc::METADATA_ATTACHMENT_ID:
switch(CodeID) {
default:return nullptr;
case bitc::METADATA_ATTACHMENT: return "METADATA_ATTACHMENT";
STRINGIFY_CODE(METADATA, ATTACHMENT)
}
case bitc::METADATA_BLOCK_ID:
switch(CodeID) {
default:return nullptr;
case bitc::METADATA_STRING: return "METADATA_STRING";
case bitc::METADATA_NAME: return "METADATA_NAME";
case bitc::METADATA_KIND: return "METADATA_KIND";
case bitc::METADATA_NODE: return "METADATA_NODE";
case bitc::METADATA_VALUE: return "METADATA_VALUE";
case bitc::METADATA_OLD_NODE: return "METADATA_OLD_NODE";
case bitc::METADATA_OLD_FN_NODE: return "METADATA_OLD_FN_NODE";
case bitc::METADATA_NAMED_NODE: return "METADATA_NAMED_NODE";
STRINGIFY_CODE(METADATA, STRING)
STRINGIFY_CODE(METADATA, NAME)
STRINGIFY_CODE(METADATA, KIND)
STRINGIFY_CODE(METADATA, NODE)
STRINGIFY_CODE(METADATA, VALUE)
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)
STRINGIFY_CODE(METADATA, BASIC_TYPE)
STRINGIFY_CODE(METADATA, FILE)
STRINGIFY_CODE(METADATA, DERIVED_TYPE)
STRINGIFY_CODE(METADATA, COMPOSITE_TYPE)
STRINGIFY_CODE(METADATA, SUBROUTINE_TYPE)
STRINGIFY_CODE(METADATA, COMPILE_UNIT)
STRINGIFY_CODE(METADATA, SUBPROGRAM)
STRINGIFY_CODE(METADATA, LEXICAL_BLOCK)
STRINGIFY_CODE(METADATA, LEXICAL_BLOCK_FILE)
STRINGIFY_CODE(METADATA, NAMESPACE)
STRINGIFY_CODE(METADATA, TEMPLATE_TYPE)
STRINGIFY_CODE(METADATA, TEMPLATE_VALUE)
STRINGIFY_CODE(METADATA, GLOBAL_VAR)
STRINGIFY_CODE(METADATA, LOCAL_VAR)
STRINGIFY_CODE(METADATA, EXPRESSION)
STRINGIFY_CODE(METADATA, OBJC_PROPERTY)
STRINGIFY_CODE(METADATA, IMPORTED_ENTITY)
}
case bitc::USELIST_BLOCK_ID:
switch(CodeID) {