Detabify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47596 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2008-02-26 10:46:10 +00:00
parent 27926af828
commit 584c3bf650
5 changed files with 55 additions and 56 deletions

View File

@@ -184,7 +184,7 @@ bool BugDriver::run() {
if (ReferenceOutputFile.empty()) { if (ReferenceOutputFile.empty()) {
std::cout << "Generating reference output from raw program: "; std::cout << "Generating reference output from raw program: ";
if(!createReferenceFile(Program)){ if(!createReferenceFile(Program)){
return debugCodeGeneratorCrash(); return debugCodeGeneratorCrash();
} }
CreatedOutput = true; CreatedOutput = true;
} }

View File

@@ -80,18 +80,17 @@ Backjump:
std::cerr << "\n\n*** Reduction Interrupted, cleaning up...\n\n"; std::cerr << "\n\n*** Reduction Interrupted, cleaning up...\n\n";
return true; return true;
} }
// If the loop doesn't make satisfying progress, try shuffling. // If the loop doesn't make satisfying progress, try shuffling.
// The purpose of shuffling is to avoid the heavy tails of the // The purpose of shuffling is to avoid the heavy tails of the
// distribution (improving the speed of convergence). // distribution (improving the speed of convergence).
if (ShufflingEnabled && if (ShufflingEnabled &&
NumOfIterationsWithoutProgress > MaxIterations) { NumOfIterationsWithoutProgress > MaxIterations) {
std::vector<ElTy> ShuffledList(TheList);
std::vector<ElTy> ShuffledList(TheList); std::random_shuffle(ShuffledList.begin(), ShuffledList.end());
std::random_shuffle(ShuffledList.begin(), ShuffledList.end()); std::cerr << "\n\n*** Testing shuffled set...\n\n";
std::cerr << "\n\n*** Testing shuffled set...\n\n"; // Check that random shuffle doesn't loose the bug
// Check that random shuffle doesn't loose the bug if (doTest(ShuffledList, empty) == KeepPrefix) {
if (doTest(ShuffledList, empty) == KeepPrefix) {
// If the bug is still here, use the shuffled list. // If the bug is still here, use the shuffled list.
TheList.swap(ShuffledList); TheList.swap(ShuffledList);
MidTop = TheList.size(); MidTop = TheList.size();
@@ -99,11 +98,11 @@ Backjump:
// probability of inifinite looping without making progress. // probability of inifinite looping without making progress.
MaxIterations += 2; MaxIterations += 2;
std::cerr << "\n\n*** Shuffling does not hide the bug...\n\n"; std::cerr << "\n\n*** Shuffling does not hide the bug...\n\n";
} else { } else {
ShufflingEnabled = false; // Disable shuffling further on ShufflingEnabled = false; // Disable shuffling further on
std::cerr << "\n\n*** Shuffling hides the bug...\n\n"; std::cerr << "\n\n*** Shuffling hides the bug...\n\n";
} }
NumOfIterationsWithoutProgress = 0; NumOfIterationsWithoutProgress = 0;
} }
unsigned Mid = MidTop / 2; unsigned Mid = MidTop / 2;

View File

@@ -157,7 +157,7 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes,
// setup the child process' arguments // setup the child process' arguments
const char** args = (const char**) const char** args = (const char**)
alloca(sizeof(const char*) * alloca(sizeof(const char*) *
(Passes.size()+13+2*PluginLoader::getNumPlugins()+NumExtraArgs)); (Passes.size()+13+2*PluginLoader::getNumPlugins()+NumExtraArgs));
int n = 0; int n = 0;
sys::Path tool = sys::Program::FindProgramByName(ToolName); sys::Path tool = sys::Program::FindProgramByName(ToolName);
if (UseValgrind) { if (UseValgrind) {

View File

@@ -259,43 +259,43 @@ private:
if (programName[0] == '%' && programName.length() >2) { if (programName[0] == '%' && programName.length() >2) {
switch(programName[1]){ switch(programName[1]){
case 'b': case 'b':
if (programName.substr(0,8) == "%bindir%") { if (programName.substr(0,8) == "%bindir%") {
std::string tmp(LLVM_BINDIR); std::string tmp(LLVM_BINDIR);
tmp.append(programName.substr(8)); tmp.append(programName.substr(8));
pat->program.set(tmp); pat->program.set(tmp);
} }
break; break;
case 'l': case 'l':
if (programName.substr(0,12) == "%llvmgccdir%"){ if (programName.substr(0,12) == "%llvmgccdir%"){
std::string tmp(LLVMGCCDIR); std::string tmp(LLVMGCCDIR);
tmp.append(programName.substr(12)); tmp.append(programName.substr(12));
pat->program.set(tmp); pat->program.set(tmp);
}else if (programName.substr(0,13) == "%llvmgccarch%"){ }else if (programName.substr(0,13) == "%llvmgccarch%"){
std::string tmp(LLVMGCCARCH); std::string tmp(LLVMGCCARCH);
tmp.append(programName.substr(13)); tmp.append(programName.substr(13));
pat->program.set(tmp); pat->program.set(tmp);
}else if (programName.substr(0,9) == "%llvmgcc%"){ }else if (programName.substr(0,9) == "%llvmgcc%"){
std::string tmp(LLVMGCC); std::string tmp(LLVMGCC);
tmp.append(programName.substr(9)); tmp.append(programName.substr(9));
pat->program.set(tmp); pat->program.set(tmp);
}else if (programName.substr(0,9) == "%llvmgxx%"){ }else if (programName.substr(0,9) == "%llvmgxx%"){
std::string tmp(LLVMGXX); std::string tmp(LLVMGXX);
tmp.append(programName.substr(9)); tmp.append(programName.substr(9));
pat->program.set(tmp); pat->program.set(tmp);
}else if (programName.substr(0,9) == "%llvmcc1%"){ }else if (programName.substr(0,9) == "%llvmcc1%"){
std::string tmp(LLVMCC1); std::string tmp(LLVMCC1);
tmp.append(programName.substr(9)); tmp.append(programName.substr(9));
pat->program.set(tmp); pat->program.set(tmp);
}else if (programName.substr(0,13) == "%llvmcc1plus%"){ }else if (programName.substr(0,13) == "%llvmcc1plus%"){
std::string tmp(LLVMCC1PLUS); std::string tmp(LLVMCC1PLUS);
tmp.append(programName.substr(13)); tmp.append(programName.substr(13));
pat->program.set(tmp); pat->program.set(tmp);
}else if (programName.substr(0,8) == "%libdir%") { }else if (programName.substr(0,8) == "%libdir%") {
std::string tmp(LLVM_LIBDIR); std::string tmp(LLVM_LIBDIR);
tmp.append(programName.substr(8)); tmp.append(programName.substr(8));
pat->program.set(tmp); pat->program.set(tmp);
} }
break; break;
} }
} }
action->program = pat->program; action->program = pat->program;

View File

@@ -116,8 +116,8 @@ namespace {
result.clear(); result.clear();
while (next_is_real()) { while (next_is_real()) {
switch (token ) { switch (token ) {
case LLVMGCCDIR_SUBST: case LLVMGCCDIR_SUBST:
case LLVMGCCARCH_SUBST: case LLVMGCCARCH_SUBST:
case STRING : case STRING :
case OPTION : case OPTION :
result += ConfigLexerState.StringVal; result += ConfigLexerState.StringVal;
@@ -262,11 +262,11 @@ namespace {
str.clear(); str.clear();
do { do {
switch (token) { switch (token) {
case BINDIR_SUBST: case BINDIR_SUBST:
case LLVMGCC_SUBST: case LLVMGCC_SUBST:
case LLVMGXX_SUBST: case LLVMGXX_SUBST:
case LLVMCC1_SUBST: case LLVMCC1_SUBST:
case LLVMCC1PLUS_SUBST: case LLVMCC1PLUS_SUBST:
case OPTION: case OPTION:
case STRING: case STRING:
case ARGS_SUBST: case ARGS_SUBST: