diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MILexer.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MILexer.h | 1 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIParser.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 5 |
4 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.cpp b/llvm/lib/CodeGen/MIRParser/MILexer.cpp index f4c9786d421..4ebe7cd4371 100644 --- a/llvm/lib/CodeGen/MIRParser/MILexer.cpp +++ b/llvm/lib/CodeGen/MIRParser/MILexer.cpp @@ -445,6 +445,7 @@ static Cursor maybeLexNumericalLiteral(Cursor C, MIToken &Token) { static MIToken::TokenKind getMetadataKeywordKind(StringRef Identifier) { return StringSwitch<MIToken::TokenKind>(Identifier) .Case("!tbaa", MIToken::md_tbaa) + .Case("!alias.scope", MIToken::md_alias_scope) .Default(MIToken::Error); } diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.h b/llvm/lib/CodeGen/MIRParser/MILexer.h index fc92cc14e89..33748209e93 100644 --- a/llvm/lib/CodeGen/MIRParser/MILexer.h +++ b/llvm/lib/CodeGen/MIRParser/MILexer.h @@ -87,6 +87,7 @@ struct MIToken { // Named metadata keywords md_tbaa, + md_alias_scope, // Identifier tokens Identifier, diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index e076a2d5b5e..271f7f08227 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -1538,12 +1538,16 @@ bool MIParser::parseMachineMemoryOperand(MachineMemOperand *&Dest) { if (parseMDNode(AAInfo.TBAA)) return true; break; - // TODO: Parse AA Scope metadata. + case MIToken::md_alias_scope: + lex(); + if (parseMDNode(AAInfo.Scope)) + return true; + break; // TODO: Parse AA NoAlias metadata. // TODO: Parse the ranges metadata. // TODO: Report an error on duplicate metadata nodes. default: - return error("expected 'align' or '!tbaa'"); + return error("expected 'align' or '!tbaa' or '!alias.scope'"); } } if (expectAndConsume(MIToken::rparen)) diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index b7292f3e151..6be8205f65e 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -782,7 +782,10 @@ void MIPrinter::print(const MachineMemOperand &Op) { OS << ", !tbaa "; AAInfo.TBAA->printAsOperand(OS, MST); } - // TODO: Print AA Scope metadata. + if (AAInfo.Scope) { + OS << ", !alias.scope "; + AAInfo.Scope->printAsOperand(OS, MST); + } // TODO: Print AA NoAlias metadata. // TODO: Print the ranges metadata. OS << ')'; |