Also only emit in targets that specificially request it. This is required so we don't get an unused static function error.
llvm-svn: 316640
}
}
-std::string AArch64MnemonicSpellCheck(StringRef S, uint64_t FBS);
+static std::string AArch64MnemonicSpellCheck(StringRef S, uint64_t FBS);
bool AArch64AsmParser::showMatchError(SMLoc Loc, unsigned ErrCode,
OperandVector &Operands) {
#define GET_REGISTER_MATCHER
#define GET_SUBTARGET_FEATURE_NAME
#define GET_MATCHER_IMPLEMENTATION
+#define GET_MNEMONIC_SPELL_CHECKER
#include "AArch64GenAsmMatcher.inc"
// Define this matcher function after the auto-generated include so we
return PlainMatchResult;
}
-std::string ARMMnemonicSpellCheck(StringRef S, uint64_t FBS);
+static std::string ARMMnemonicSpellCheck(StringRef S, uint64_t FBS);
static const char *getSubtargetFeatureName(uint64_t Val);
bool ARMAsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
#define GET_REGISTER_MATCHER
#define GET_SUBTARGET_FEATURE_NAME
#define GET_MATCHER_IMPLEMENTATION
+#define GET_MNEMONIC_SPELL_CHECKER
#include "ARMGenAsmMatcher.inc"
// Some diagnostics need to vary with subtarget features, so they are handled
#define GET_REGISTER_MATCHER
#define GET_SUBTARGET_FEATURE_NAME
#define GET_MATCHER_IMPLEMENTATION
+#define GET_MNEMONIC_SPELL_CHECKER
#include "SystemZGenAsmMatcher.inc"
// Used for the .insn directives; contains information needed to parse the
return false;
}
-std::string SystemZMnemonicSpellCheck(StringRef S, uint64_t FBS);
+static std::string SystemZMnemonicSpellCheck(StringRef S, uint64_t FBS);
bool SystemZAsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
OperandVector &Operands,
static void emitMnemonicSpellChecker(raw_ostream &OS, CodeGenTarget &Target,
unsigned VariantCount) {
- OS << "std::string " << Target.getName() << "MnemonicSpellCheck(StringRef S, uint64_t FBS) {\n";
+ OS << "static std::string " << Target.getName()
+ << "MnemonicSpellCheck(StringRef S, uint64_t FBS) {\n";
if (!VariantCount)
OS << " return \"\";";
else {
OS << "};\n\n";
}
- emitMnemonicSpellChecker(OS, Target, VariantCount);
-
OS << "#include \"llvm/Support/Debug.h\"\n";
OS << "#include \"llvm/Support/Format.h\"\n\n";
MaxMnemonicIndex, HasMnemonicFirst);
OS << "#endif // GET_MATCHER_IMPLEMENTATION\n\n";
+
+ OS << "\n#ifdef GET_MNEMONIC_SPELL_CHECKER\n";
+ OS << "#undef GET_MNEMONIC_SPELL_CHECKER\n\n";
+
+ emitMnemonicSpellChecker(OS, Target, VariantCount);
+
+ OS << "#endif // GET_MNEMONIC_SPELL_CHECKER\n\n";
}
namespace llvm {