mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-13 12:57:47 +00:00
llvm-mc/AsmParser: Add hack to ignore Int_* and *_Int instructions for now, to
make it easier to see interesting ambiguities. - Also, check that user doesn't try to redefine the super class. This is a wart in the current design, in that assembler match classes aren't explicitly declared somewhere (so there isn't a unique place to declare the super class). This should probably be fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78532 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a62b02a7ef
commit
72fa87f0cf
@ -225,6 +225,12 @@ static bool IsAssemblerInstruction(const StringRef &Name,
|
|||||||
if (Name == "PHI")
|
if (Name == "PHI")
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Ignore "Int_*" and "*_Int" instructions, which are internal aliases.
|
||||||
|
//
|
||||||
|
// FIXME: This is a total hack.
|
||||||
|
if (StringRef(Name).startswith("Int_") || StringRef(Name).endswith("_Int"))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Ignore instructions with no .s string.
|
// Ignore instructions with no .s string.
|
||||||
//
|
//
|
||||||
// FIXME: What are these?
|
// FIXME: What are these?
|
||||||
@ -571,6 +577,7 @@ AsmMatcherInfo::getOperandClass(const StringRef &Token,
|
|||||||
Entry = new ClassInfo();
|
Entry = new ClassInfo();
|
||||||
if (ClassName == "Reg") {
|
if (ClassName == "Reg") {
|
||||||
Entry->Kind = ClassInfo::Register;
|
Entry->Kind = ClassInfo::Register;
|
||||||
|
Entry->SuperClassKind = SuperClass;
|
||||||
} else {
|
} else {
|
||||||
Entry->Kind = getUserClassKind(ClassName);
|
Entry->Kind = getUserClassKind(ClassName);
|
||||||
Entry->SuperClassKind = SuperClass;
|
Entry->SuperClassKind = SuperClass;
|
||||||
@ -581,6 +588,10 @@ AsmMatcherInfo::getOperandClass(const StringRef &Token,
|
|||||||
Entry->PredicateMethod = "is" + ClassName;
|
Entry->PredicateMethod = "is" + ClassName;
|
||||||
Entry->RenderMethod = "add" + ClassName + "Operands";
|
Entry->RenderMethod = "add" + ClassName + "Operands";
|
||||||
Classes.push_back(Entry);
|
Classes.push_back(Entry);
|
||||||
|
} else {
|
||||||
|
// Verify the super class matches.
|
||||||
|
assert(SuperClass == Entry->SuperClassKind &&
|
||||||
|
"Cannot redefine super class kind!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Entry;
|
return Entry;
|
||||||
|
Loading…
Reference in New Issue
Block a user