mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 13:50:11 +00:00
Fix some incorrect generated LLVM code.
This commit is contained in:
parent
e1baf17a75
commit
147ee550e6
@ -111,7 +111,7 @@ for arch in $archs; do
|
||||
continue
|
||||
fi
|
||||
|
||||
diff "$out_CPP_LLVM" "$out_CPP_CS" > /dev/null
|
||||
diff -w -B "$out_CPP_LLVM" "$out_CPP_CS" > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "The following files mismatch: $out_CPP_LLVM <-> $out_CPP_CS"
|
||||
mismatch="true"
|
||||
|
@ -24,21 +24,21 @@ using namespace llvm;
|
||||
static bool isIdentChar(char C) { return isAlnum(C) || C == '_'; }
|
||||
|
||||
std::string AsmWriterOperand::getCode(bool PassSubtarget) const {
|
||||
bool LangCS = PrinterLLVM::getLanguage() == PRINTER_LANG_CAPSTONE_C;
|
||||
if (OperandType == isLiteralTextOperand) {
|
||||
std::string Res;
|
||||
if (Str.size() == 1) {
|
||||
Res = "SStream_concat1(O, '" + Str + "');";
|
||||
Res = LangCS ? "SStream_concat1(O, '" + Str + "');" : "O << '" + Str + "';";
|
||||
return Res;
|
||||
}
|
||||
|
||||
Res = "SStream_concat0(O, \"" + Str + "\");";
|
||||
Res = LangCS ? "SStream_concat0(O, \"" + Str + "\");" : "O << \"" + Str + "\";";
|
||||
return Res;
|
||||
}
|
||||
|
||||
if (OperandType == isLiteralStatementOperand)
|
||||
return Str;
|
||||
|
||||
bool LangCS = PrinterLLVM::getLanguage() == PRINTER_LANG_CAPSTONE_C;
|
||||
PassSubtarget = LangCS ? false : PassSubtarget;
|
||||
|
||||
std::string Result;
|
||||
|
@ -2106,11 +2106,11 @@ void PrinterLLVM::decoderEmitterEmitDecoderFunction(
|
||||
void PrinterLLVM::decoderEmitterEmitIncludes() const {
|
||||
OS << "#include \"llvm/MC/MCInst.h\"\n";
|
||||
OS << "#include \"llvm/MC/MCSubtargetInfo.h\"\n";
|
||||
OS << "#include \"llvm/MC/SubtargetFeature.h\"\n";
|
||||
OS << "#include \"llvm/Support/DataTypes.h\"\n";
|
||||
OS << "#include \"llvm/Support/Debug.h\"\n";
|
||||
OS << "#include \"llvm/Support/LEB128.h\"\n";
|
||||
OS << "#include \"llvm/Support/raw_ostream.h\"\n";
|
||||
OS << "#include \"llvm/TargetParser/SubtargetFeature.h\"\n";
|
||||
OS << "#include <assert.h>\n";
|
||||
OS << '\n';
|
||||
}
|
||||
|
@ -731,7 +731,6 @@ void RegisterInfoEmitter::run() {
|
||||
CodeGenRegBank &RegBank = Target.getRegBank();
|
||||
Records.startTimer("Print enums");
|
||||
|
||||
PI.regInfoEmitSourceFileHeader("Target Register Enum Values");
|
||||
PI.regInfoEmitEnums(Target, RegBank);
|
||||
|
||||
Records.startTimer("Print MC registers");
|
||||
|
Loading…
Reference in New Issue
Block a user