Update the dcc tools code
This commit is contained in:
@@ -211,6 +211,7 @@ struct ComLoader : public DosLoader {
|
||||
return false;
|
||||
}
|
||||
bool load(PROG &prog,QFile &fp) {
|
||||
fp.seek(0);
|
||||
/* COM file
|
||||
* In this case the load module size is just the file length
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
|
||||
PerfectHash g_pattern_hasher;
|
||||
#define NIL -1 /* Used like NULL, but 0 is valid */
|
||||
|
||||
/* Hash table structure */
|
||||
@@ -331,7 +331,7 @@ void SetupLibCheck(void)
|
||||
|
||||
/* Initialise the perfhlib stuff. Also allocates T1, T2, g, etc */
|
||||
/* Set the parameters for the hash table */
|
||||
g_pattern_hasher.init(
|
||||
g_pattern_hasher.setHashParams(
|
||||
numKeys, /* The number of symbols */
|
||||
PatLen, /* The length of the pattern to be hashed */
|
||||
256, /* The character set of the pattern (0-FF) */
|
||||
|
||||
74
src/dcc.cpp
74
src/dcc.cpp
@@ -65,7 +65,7 @@ bool TVisitor(raw_ostream &OS, RecordKeeper &Records)
|
||||
// rec = Records.getDef("CCR");
|
||||
// if(rec)
|
||||
// rec->dump();
|
||||
for(auto val : Records.getDefs())
|
||||
for(const auto &val : Records.getDefs())
|
||||
{
|
||||
//std::cout<< "Def "<<val.first<<"\n";
|
||||
}
|
||||
@@ -73,43 +73,43 @@ bool TVisitor(raw_ostream &OS, RecordKeeper &Records)
|
||||
}
|
||||
int testTblGen(int argc, char **argv)
|
||||
{
|
||||
using namespace llvm;
|
||||
sys::PrintStackTraceOnErrorSignal();
|
||||
PrettyStackTraceProgram(argc,argv);
|
||||
cl::ParseCommandLineOptions(argc,argv);
|
||||
return llvm::TableGenMain(argv[0],TVisitor);
|
||||
InitializeNativeTarget();
|
||||
Triple TheTriple;
|
||||
std::string def = sys::getDefaultTargetTriple();
|
||||
std::string MCPU="i386";
|
||||
std::string MARCH="x86";
|
||||
InitializeAllTargetInfos();
|
||||
InitializeAllTargetMCs();
|
||||
InitializeAllAsmPrinters();
|
||||
InitializeAllAsmParsers();
|
||||
InitializeAllDisassemblers();
|
||||
std::string TargetTriple("i386-pc-linux-gnu");
|
||||
TheTriple = Triple(Triple::normalize(TargetTriple));
|
||||
MCOperand op=llvm::MCOperand::CreateImm(11);
|
||||
MCAsmInfo info;
|
||||
raw_os_ostream wrap(std::cerr);
|
||||
op.print(wrap,&info);
|
||||
wrap.flush();
|
||||
std::cerr<<"\n";
|
||||
std::string lookuperr;
|
||||
TargetRegistry::printRegisteredTargetsForVersion();
|
||||
const Target *t = TargetRegistry::lookupTarget(MARCH,TheTriple,lookuperr);
|
||||
TargetOptions opts;
|
||||
std::string Features;
|
||||
opts.PrintMachineCode=1;
|
||||
TargetMachine *tm = t->createTargetMachine(TheTriple.getTriple(),MCPU,Features,opts);
|
||||
std::cerr<<tm->getInstrInfo()->getName(97)<<"\n";
|
||||
const MCInstrDesc &ds(tm->getInstrInfo()->get(97));
|
||||
const MCOperandInfo *op1=ds.OpInfo;
|
||||
uint16_t impl_def = ds.getImplicitDefs()[0];
|
||||
std::cerr<<lookuperr<<"\n";
|
||||
// using namespace llvm;
|
||||
// sys::PrintStackTraceOnErrorSignal();
|
||||
// PrettyStackTraceProgram(argc,argv);
|
||||
// cl::ParseCommandLineOptions(argc,argv);
|
||||
// return llvm::TableGenMain(argv[0],TVisitor);
|
||||
// InitializeNativeTarget();
|
||||
// Triple TheTriple;
|
||||
// std::string def = sys::getDefaultTargetTriple();
|
||||
// std::string MCPU="i386";
|
||||
// std::string MARCH="x86";
|
||||
// InitializeAllTargetInfos();
|
||||
// InitializeAllTargetMCs();
|
||||
// InitializeAllAsmPrinters();
|
||||
// InitializeAllAsmParsers();
|
||||
// InitializeAllDisassemblers();
|
||||
// std::string TargetTriple("i386-pc-linux-gnu");
|
||||
// TheTriple = Triple(Triple::normalize(TargetTriple));
|
||||
// MCOperand op=llvm::MCOperand::CreateImm(11);
|
||||
// MCAsmInfo info;
|
||||
// raw_os_ostream wrap(std::cerr);
|
||||
// op.print(wrap,&info);
|
||||
// wrap.flush();
|
||||
// std::cerr<<"\n";
|
||||
// std::string lookuperr;
|
||||
// TargetRegistry::printRegisteredTargetsForVersion();
|
||||
// const Target *t = TargetRegistry::lookupTarget(MARCH,TheTriple,lookuperr);
|
||||
// TargetOptions opts;
|
||||
// std::string Features;
|
||||
// opts.PrintMachineCode=1;
|
||||
// TargetMachine *tm = t->createTargetMachine(TheTriple.getTriple(),MCPU,Features,opts);
|
||||
// std::cerr<<tm->getInstrInfo()->getName(97)<<"\n";
|
||||
// const MCInstrDesc &ds(tm->getInstrInfo()->get(97));
|
||||
// const MCOperandInfo *op1=ds.OpInfo;
|
||||
// uint16_t impl_def = ds.getImplicitDefs()[0];
|
||||
// std::cerr<<lookuperr<<"\n";
|
||||
|
||||
exit(0);
|
||||
// exit(0);
|
||||
|
||||
}
|
||||
void setupOptions(QCoreApplication &app) {
|
||||
|
||||
Reference in New Issue
Block a user