summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-18 21:16:33 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-18 21:16:33 +0000
commitcd8fb60fce21b985b87c0e9b7aaefc43e94f316b (patch)
treed4a8c0314a18d62015d799566bf50e657c5e39e6 /llvm/lib
parent2e3b8c29c9b6d1b2d02d94983d258995318410af (diff)
downloadbcm5719-llvm-cd8fb60fce21b985b87c0e9b7aaefc43e94f316b.tar.gz
bcm5719-llvm-cd8fb60fce21b985b87c0e9b7aaefc43e94f316b.zip
IR: Swap order of name and value in MDEnum
Put the name before the value in assembly for `MDEnum`. While working on the testcase upgrade script for the new hierarchy, I noticed that it "looks nicer" to have the name first, since it lines the names up in the (somewhat typical) case that they have a common prefix. llvm-svn: 229747
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp4
-rw-r--r--llvm/lib/IR/AsmWriter.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 47125ca954c..76365ea2233 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -3289,8 +3289,8 @@ bool LLParser::ParseMDSubrange(MDNode *&Result, bool IsDistinct) {
/// ::= !MDEnumerator(value: 30, name: "SomeKind")
bool LLParser::ParseMDEnumerator(MDNode *&Result, bool IsDistinct) {
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
- REQUIRED(value, MDSignedField, ); \
- REQUIRED(name, MDStringField, );
+ REQUIRED(name, MDStringField, ); \
+ REQUIRED(value, MDSignedField, );
PARSE_MD_FIELDS();
#undef VISIT_MD_FIELDS
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 27f619b5eed..662771b3278 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -1361,8 +1361,8 @@ static void writeMDEnumerator(raw_ostream &Out, const MDEnumerator *N,
TypePrinting *, SlotTracker *, const Module *) {
Out << "!MDEnumerator(";
FieldSeparator FS;
- Out << FS << "value: " << N->getValue();
Out << FS << "name: \"" << N->getName() << "\"";
+ Out << FS << "value: " << N->getValue();
Out << ")";
}
OpenPOWER on IntegriCloud