mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Add support for metadata representing .ident directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192764 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -216,6 +216,7 @@ namespace {
|
||||
visitNamedMDNode(*I);
|
||||
|
||||
visitModuleFlags(M);
|
||||
visitModuleIdents(M);
|
||||
|
||||
// Verify Debug Info.
|
||||
verifyDebugInfo(M);
|
||||
@@ -260,6 +261,7 @@ namespace {
|
||||
void visitGlobalAlias(GlobalAlias &GA);
|
||||
void visitNamedMDNode(NamedMDNode &NMD);
|
||||
void visitMDNode(MDNode &MD, Function *F);
|
||||
void visitModuleIdents(Module &M);
|
||||
void visitModuleFlags(Module &M);
|
||||
void visitModuleFlag(MDNode *Op, DenseMap<MDString*, MDNode*> &SeenIDs,
|
||||
SmallVectorImpl<MDNode*> &Requirements);
|
||||
@@ -613,6 +615,24 @@ void Verifier::visitMDNode(MDNode &MD, Function *F) {
|
||||
}
|
||||
}
|
||||
|
||||
void Verifier::visitModuleIdents(Module &M) {
|
||||
const NamedMDNode *Idents = M.getNamedMetadata("llvm.ident");
|
||||
if (!Idents)
|
||||
return;
|
||||
|
||||
// llvm.ident takes a list of metadata entry. Each entry has only one string.
|
||||
// Scan each llvm.ident entry and make sure that this requirement is met.
|
||||
for (unsigned i = 0, e = Idents->getNumOperands(); i != e; ++i) {
|
||||
const MDNode *N = Idents->getOperand(i);
|
||||
Assert1(N->getNumOperands() == 1,
|
||||
"incorrect number of operands in llvm.ident metadata", N);
|
||||
Assert1(isa<MDString>(N->getOperand(0)),
|
||||
("invalid value for llvm.ident metadata entry operand"
|
||||
"(the operand should be a string)"),
|
||||
N->getOperand(0));
|
||||
}
|
||||
}
|
||||
|
||||
void Verifier::visitModuleFlags(Module &M) {
|
||||
const NamedMDNode *Flags = M.getModuleFlagsMetadata();
|
||||
if (!Flags) return;
|
||||
|
||||
Reference in New Issue
Block a user