From tbrethou at cs.uiuc.edu Mon Jul 28 11:43:01 2003 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Mon Jul 28 11:43:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Mangler.h Message-ID: <200307281642.LAA02280@tank.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Mangler.h updated: 1.3 -> 1.4 --- Log message: Need to include to fix compile error on Sun --- Diffs of the changes: Index: llvm/include/llvm/Support/Mangler.h diff -u llvm/include/llvm/Support/Mangler.h:1.3 llvm/include/llvm/Support/Mangler.h:1.4 --- llvm/include/llvm/Support/Mangler.h:1.3 Fri Jul 25 15:20:53 2003 +++ llvm/include/llvm/Support/Mangler.h Mon Jul 28 11:42:33 2003 @@ -11,6 +11,7 @@ class Module; #include #include +#include class Mangler { public: From brukman at cs.uiuc.edu Mon Jul 28 11:54:02 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 11:54:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Instruction.h Message-ID: <200307281653.LAA12781@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instruction.h updated: 1.42 -> 1.43 --- Log message: Removed extra parenthesis and fixed spelling. --- Diffs of the changes: Index: llvm/include/llvm/Instruction.h diff -u llvm/include/llvm/Instruction.h:1.42 llvm/include/llvm/Instruction.h:1.43 --- llvm/include/llvm/Instruction.h:1.42 Mon Jun 30 16:58:26 2003 +++ llvm/include/llvm/Instruction.h Mon Jul 28 11:53:28 2003 @@ -79,7 +79,7 @@ /// isAssociative - Return true if the instruction is associative: /// - /// Associative operators satisfy: x op (y op z) === (x op y) op z) + /// Associative operators satisfy: x op (y op z) === (x op y) op z /// /// In LLVM, the Add, Mul, And, Or, and Xor operators are associative, when /// not applied to floating point types. @@ -89,7 +89,7 @@ /// isCommutative - Return true if the instruction is commutative: /// - /// Commutative operators satistify: (x op y) === (y op x) + /// Commutative operators satisfy: (x op y) === (y op x) /// /// In LLVM, these are the associative operators, plus SetEQ and SetNE, when /// applied to any type. From brukman at cs.uiuc.edu Mon Jul 28 14:07:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 14:07:01 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/JIT/Makefile Message-ID: <200307281907.OAA21490@zion.cs.uiuc.edu> Changes in directory llvm/tools/lli/JIT: Makefile updated: 1.2 -> 1.3 --- Log message: Fix reference to architecture. --- Diffs of the changes: Index: llvm/tools/lli/JIT/Makefile diff -u llvm/tools/lli/JIT/Makefile:1.2 llvm/tools/lli/JIT/Makefile:1.3 --- llvm/tools/lli/JIT/Makefile:1.2 Wed Jul 2 12:53:19 2003 +++ llvm/tools/lli/JIT/Makefile Mon Jul 28 14:06:50 2003 @@ -15,7 +15,7 @@ CPPFLAGS += -DENABLE_X86_JIT endif -# Enable the X86 JIT if compiling on X86 +# Enable the Sparc JIT if compiling on Sparc ifeq ($(ARCH), Sparc) ENABLE_SPARC_JIT = 1 endif From brukman at cs.uiuc.edu Mon Jul 28 14:07:05 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 14:07:05 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/Makefile Message-ID: <200307281906.OAA21475@zion.cs.uiuc.edu> Changes in directory llvm/tools/lli: Makefile updated: 1.33 -> 1.34 --- Log message: Add in support to load shared objects (-load is provided by Support library). --- Diffs of the changes: Index: llvm/tools/lli/Makefile diff -u llvm/tools/lli/Makefile:1.33 llvm/tools/lli/Makefile:1.34 --- llvm/tools/lli/Makefile:1.33 Wed Jul 2 12:53:14 2003 +++ llvm/tools/lli/Makefile Mon Jul 28 14:06:19 2003 @@ -40,7 +40,7 @@ endif USEDLIBS = lli-interpreter $(JITLIBS) $(ARCHLIBS) scalaropts analysis.a \ - transformutils.a bcreader vmcore support.a target.a + transformutils.a bcreader vmcore support target.a # Have gcc tell the linker to export symbols from the program so that # dynamically loaded modules can be linked against them. From brukman at cs.uiuc.edu Mon Jul 28 14:08:03 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 14:08:03 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/JIT/Intercept.cpp Message-ID: <200307281907.OAA21507@zion.cs.uiuc.edu> Changes in directory llvm/tools/lli/JIT: Intercept.cpp updated: 1.5 -> 1.6 --- Log message: Clean up code dealing with RTLD_SELF differences on Sparc and X86. --- Diffs of the changes: Index: llvm/tools/lli/JIT/Intercept.cpp diff -u llvm/tools/lli/JIT/Intercept.cpp:1.5 llvm/tools/lli/JIT/Intercept.cpp:1.6 --- llvm/tools/lli/JIT/Intercept.cpp:1.5 Mon Jun 30 16:59:03 2003 +++ llvm/tools/lli/JIT/Intercept.cpp Mon Jul 28 14:07:30 2003 @@ -54,11 +54,12 @@ if (Name == "atexit") return (void*)&jit_atexit; // If it's an external function, look it up in the process image... -#if defined(i386) || defined(__i386__) || defined(__x86__) - void *Ptr = dlsym(0, Name.c_str()); -#elif defined(sparc) || defined(__sparc__) || defined(__sparcv9) - void *Ptr = dlsym(RTLD_SELF, Name.c_str()); + // On Sparc, RTLD_SELF is already defined and it's not zero + // Linux/x86 wants to use a 0, other systems may differ +#ifndef RTLD_SELF +#define RTLD_SELF 0 #endif + void *Ptr = dlsym(RTLD_SELF, Name.c_str()); if (Ptr == 0) { std::cerr << "WARNING: Cannot resolve fn '" << Name << "' using a dummy noop function instead!\n"; @@ -67,4 +68,3 @@ return Ptr; } - From brukman at cs.uiuc.edu Mon Jul 28 14:10:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 14:10:01 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/JIT/Emitter.cpp Message-ID: <200307281909.OAA21526@zion.cs.uiuc.edu> Changes in directory llvm/tools/lli/JIT: Emitter.cpp updated: 1.17 -> 1.18 --- Log message: Add ability for external C code to get pointers to functions given their name. This us used by bugpoint -- when code is compiled to a shared object to be JITted, it must use the JIT's lazy resolution method to find function addresses, because some functions will not be available at .so load time, as they are in the bytecode file. --- Diffs of the changes: Index: llvm/tools/lli/JIT/Emitter.cpp diff -u llvm/tools/lli/JIT/Emitter.cpp:1.17 llvm/tools/lli/JIT/Emitter.cpp:1.18 --- llvm/tools/lli/JIT/Emitter.cpp:1.17 Mon Jun 30 16:59:03 2003 +++ llvm/tools/lli/JIT/Emitter.cpp Mon Jul 28 14:09:06 2003 @@ -11,14 +11,13 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/Target/TargetData.h" -#include "llvm/Function.h" +#include "llvm/Module.h" #include "Support/Statistic.h" #include -static VM *TheVM = 0; - namespace { Statistic<> NumBytes("jello", "Number of bytes of machine code compiled"); + VM *TheVM = 0; class Emitter : public MachineCodeEmitter { // CurBlock - The start of the current block of memory. CurByte - The @@ -186,3 +185,16 @@ return (intptr_t)TheVM->getPointerToFunction(F); } +// getPointerToNamedFunction - This function is used as a global wrapper to +// VM::getPointerToNamedFunction for the purpose of resolving symbols when +// bugpoint is debugging the JIT. In that scenario, we are loading an .so and +// need to resolve function(s) that are being mis-codegenerated, so we need to +// resolve their addresses at runtime, and this is the way to do it. +extern "C" { + void *getPointerToNamedFunction(const char *Name) { + Module &M = TheVM->getModule(); + if (Function *F = M.getNamedFunction(Name)) + return TheVM->getPointerToFunction(F); + return TheVM->getPointerToNamedFunction(Name); + } +} From brukman at cs.uiuc.edu Mon Jul 28 14:17:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 14:17:01 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.h CodeGeneratorBug.cpp ExecutionDriver.cpp Message-ID: <200307281916.OAA21559@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: BugDriver.h updated: 1.10 -> 1.11 CodeGeneratorBug.cpp updated: 1.2 -> 1.3 ExecutionDriver.cpp updated: 1.8 -> 1.9 --- Log message: BugDriver.h: * Added method to query if BugDriver is executing the JIT currently. This provides the ability in adding code that is conditionally executed in codegen debugging phase. CodeGeneratorBug.cpp: * Delete test functions from the Safe module * Code conditionally added when debugging the JIT: use the lazy resolver function added to Emitter.cpp to get function pointer by name. When compiled into an .so, this is the only way to get a pointer to an external function * Added a symbol disambiguator which will keep symbols uniquely named across modules * Delete generated files by default * The function `main' *must* stay in the .bc file for the JIT, but that prevents debugging it alone. This patch makes the old `main' become `old_main' and adds a new function named `main' which just calls the original with the same parameters, thereby keeping functionality the same. ExecutionDriver.cpp: * Returned to getting unique filenames * Simplified code choosing between using and not using shared library option --- Diffs of the changes: Index: llvm/tools/bugpoint/BugDriver.h diff -u llvm/tools/bugpoint/BugDriver.h:1.10 llvm/tools/bugpoint/BugDriver.h:1.11 --- llvm/tools/bugpoint/BugDriver.h:1.10 Thu Jul 24 16:59:10 2003 +++ llvm/tools/bugpoint/BugDriver.h Mon Jul 28 14:16:13 2003 @@ -81,7 +81,6 @@ bool debugPassMiscompilation(const PassInfo *ThePass, const std::string &ReferenceOutput); - /// compileSharedObject - This method creates a SharedObject from a given /// BytecodeFile for debugging a code generator. int compileSharedObject(const std::string &BytecodeFile, @@ -91,6 +90,8 @@ /// set of functions, using the CBE as a ``safe'' code generator for other /// functions that are not under consideration. bool debugCodeGenerator(); + + bool isExecutingJIT(); private: /// ParseInputFile - Given a bytecode or assembly input filename, parse and Index: llvm/tools/bugpoint/CodeGeneratorBug.cpp diff -u llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.2 llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.3 --- llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.2 Thu Jul 24 16:59:10 2003 +++ llvm/tools/bugpoint/CodeGeneratorBug.cpp Mon Jul 28 14:16:14 2003 @@ -7,11 +7,18 @@ #include "BugDriver.h" #include "SystemUtils.h" #include "ListReducer.h" -#include "llvm/Pass.h" +#include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" +#include "llvm/GlobalValue.h" +#include "llvm/iMemory.h" +#include "llvm/iTerminators.h" +#include "llvm/iOther.h" #include "llvm/Module.h" +#include "llvm/Pass.h" +#include "llvm/Analysis/Verifier.h" +#include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Linker.h" -#include "Support/CommandLine.h" #include "Support/Statistic.h" #include "Support/StringExtras.h" #include @@ -31,14 +38,21 @@ return NoFailure; } - bool TestFuncs(const std::vector &CodegenTest); + bool TestFuncs(const std::vector &CodegenTest, + bool KeepFiles = false); void DisambiguateGlobalSymbols(Module *M); }; -bool ReduceMisCodegenFunctions::TestFuncs(const std::vector &Funcs) +bool ReduceMisCodegenFunctions::TestFuncs(const std::vector &Funcs, + bool KeepFiles) { + DEBUG(std::cerr << "Test functions are:\n"); + for (std::vector::const_iterator I = Funcs.begin(),E = Funcs.end(); + I != E; ++I) + DEBUG(std::cerr << "\t" << (*I)->getName() << "\n"); + // Clone the module for the two halves of the program we want. Module *SafeModule = CloneModule(BD.Program); @@ -64,8 +78,114 @@ DeleteFunctionBody(TNOF); // Function is now external in this module! } + // Remove the Safe functions from the Test module + for (Module::iterator I=TestModule->begin(),E=TestModule->end(); I!=E; ++I) { + bool funcFound = false; + for (std::vector::const_iterator F=Funcs.begin(),Fe=Funcs.end(); + F != Fe; ++F) + if (I->getName() == (*F)->getName()) funcFound = true; + + if (!funcFound && !(BD.isExecutingJIT() && I->getName() == "main")) + DeleteFunctionBody(I); + } + + // This is only applicable if we are debugging the JIT: + // Find all external functions in the Safe modules that are actually used + // (called or taken address of), and make them call the JIT wrapper instead + if (BD.isExecutingJIT()) { + // Must delete `main' from Safe module if it has it + for (Module::iterator I=SafeModule->begin(), E=SafeModule->end();I!=E;++I) + if (I->getName() == "main") DeleteFunctionBody(I); + + // Add an external function "getPointerToNamedFunction" that JIT provides + // Prototype: void *getPointerToNamedFunction(const char* Name) + std::vector Params; + Params.push_back(PointerType::get(Type::SByteTy)); // std::string& + FunctionType *resolverTy = FunctionType::get(PointerType::get(Type::VoidTy), + Params, false /* isVarArg */); + const std::string ResolverFunctionName = "getPointerToNamedFunction"; + Function *resolverFunc = new Function(resolverTy, + GlobalValue::ExternalLinkage, + ResolverFunctionName, + SafeModule); + + // Use the function we just added to get addresses of functions we need + // Iterate over the global declarations in the Safe module + for (Module::iterator F=SafeModule->begin(),E=SafeModule->end(); F!=E; ++F){ + if (F->isExternal() && F->use_begin() != F->use_end() && + F->getName() != ResolverFunctionName) { + // If it has a non-zero use list, + // 1. Add a string constant with its name to the global file + // The correct type is `const [ NUM x sbyte ]' where NUM is length of + // function name + 1 + const std::string &Name = F->getName(); + GlobalVariable *funcName = + new GlobalVariable(ArrayType::get(Type::SByteTy, Name.length()+1), + true /* isConstant */, + GlobalValue::InternalLinkage, + ConstantArray::get(Name), + Name + "_name", + SafeModule); + + // 2. Use `GetElementPtr *funcName, 0, 0' to convert the string to an + // sbyte* so it matches the signature of the resolver function. + Constant *Zero = Constant::getNullValue(Type::LongTy); + std::vector GEPargs; + GEPargs.push_back(Zero); + GEPargs.push_back(Zero); + + // 3. Replace all uses of `func' with calls to resolver by: + // (a) Iterating through the list of uses of this function + // (b) Insert a cast instruction in front of each use + // (c) Replace use of old call with new call + + // Insert code at the beginning of the function + + for (Value::use_iterator i=F->use_begin(), e=F->use_end(); i!=e; ++i) { + if (Instruction* Inst = dyn_cast(*i)) { + // GetElementPtr *funcName, ulong 0, ulong 0 + Value *GEP = + ConstantExpr::getGetElementPtr(ConstantPointerRef::get(funcName), + GEPargs); + std::vector ResolverArgs; + ResolverArgs.push_back(GEP); + // call resolver(GetElementPtr...) + CallInst *resolve = new CallInst(resolverFunc, ResolverArgs, + "resolver", Inst); + // cast the result from the resolver to correctly-typed function + CastInst *castResolver = + new CastInst(resolve, PointerType::get(F->getFunctionType()), + "", Inst); + // actually use the resolved function + Inst->replaceUsesOfWith(F, castResolver); + + //BasicBlock::iterator ii(Inst); + //ReplaceInstWithValue(Inst->getParent()->getInstList(), + // ii, ResolverResult); + } + } + } + } + } + + DEBUG(std::cerr << "Safe module:\n"); + for (Module::iterator I = SafeModule->begin(), E = SafeModule->end();I!=E;++I) + if (!I->isExternal()) DEBUG(std::cerr << "\t" << I->getName() << "\n"); + for (Module::giterator I=SafeModule->gbegin(),E = SafeModule->gend();I!=E;++I) + if (!I->isExternal()) DEBUG(std::cerr << "\t" << I->getName() << "\n"); + + DEBUG(std::cerr << "Test module:\n"); + for (Module::iterator I =TestModule->begin(),E = TestModule->end(); I!=E;++I) + if (!I->isExternal()) DEBUG(std::cerr << "\t" << I->getName() << "\n"); + for (Module::giterator I=TestModule->gbegin(),E = TestModule->gend();I!=E;++I) + if (!I->isExternal()) DEBUG(std::cerr << "\t" << I->getName() << "\n"); + // Write out the bytecode to be sent to CBE - std::string SafeModuleBC = "bugpoint.safe.bc"; + std::string SafeModuleBC = getUniqueFilename("bugpoint.safe.bc"); + if (verifyModule(*SafeModule)) { + std::cerr << "Bytecode file corrupted!\n"; + exit(1); + } if (BD.writeProgramToFile(SafeModuleBC, SafeModule)) { std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; exit(1); @@ -88,48 +208,78 @@ DeleteFunctionBody(I); } - std::string TestModuleBC = "bugpoint.test.bc"; + std::string TestModuleBC = getUniqueFilename("bugpoint.test.bc"); + if (verifyModule(*TestModule)) { + std::cerr << "Bytecode file corrupted!\n"; + exit(1); + } if (BD.writeProgramToFile(TestModuleBC, TestModule)) { std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; exit(1); } + delete SafeModule; + delete TestModule; + // Run the code generator on the `Test' code, loading the shared library. // The function returns whether or not the new output differs from reference. int Result = BD.diffProgram(TestModuleBC, SharedObject, false); - removeFile(SharedObject); + if (KeepFiles) { + std::cout << "You can reproduce the problem with the command line: \n" + << "lli (or llc) -load " << SharedObject << " " << TestModuleBC + << "\n"; + } else { + removeFile(TestModuleBC); + removeFile(SafeModuleBC); + removeFile(SharedObject); + } return Result; } namespace { struct Disambiguator { - std::set SymbolNames; + std::set SymbolNames; + std::set Symbols; uint64_t uniqueCounter; bool externalOnly; public: Disambiguator() : uniqueCounter(0), externalOnly(true) {} void setExternalOnly(bool value) { externalOnly = value; } void add(GlobalValue &V) { + // If we're only processing externals and this isn't external, bail if (externalOnly && !V.isExternal()) return; + // If we're already processed this symbol, don't add it again + if (Symbols.count(&V) != 0) return; + + std::string SymName = V.getName(); - if (SymbolNames.count(V.getName()) == 0) { - DEBUG(std::cerr << "Disambiguator: adding " << V.getName() + // If the symbol starts with a '.', replace it with 'x' + // This solves the problem of not being able to find symbols in an .so + // file when those symbol names start with '.' + if (SymName[0] == '.') { + SymName[0] = 'x'; + V.setName(SymName); + } + + if (SymbolNames.count(SymName) == 0) { + DEBUG(std::cerr << "Disambiguator: adding " << SymName << ", no conflicts.\n"); - SymbolNames.insert(V.getName()); + SymbolNames.insert(SymName); } else { // Mangle name before adding std::string newName; do { - newName = V.getName() + "_" + utostr(uniqueCounter); + newName = SymName + "_" + utostr(uniqueCounter); if (SymbolNames.count(newName) == 0) break; else ++uniqueCounter; } while (1); //while (SymbolNames.count(V->getName()+utostr(uniqueCounter++))==0); - DEBUG(std::cerr << "Disambiguator: conflict: " << V.getName() + DEBUG(std::cerr << "Disambiguator: conflict: " << SymName << ", adding: " << newName << "\n"); V.setName(newName); SymbolNames.insert(newName); } + Symbols.insert(&V); } }; } @@ -138,13 +288,17 @@ // First, try not to cause collisions by minimizing chances of renaming an // already-external symbol, so take in external globals and functions as-is. Disambiguator D; + DEBUG(std::cerr << "Disambiguating globals (external-only)\n"); for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) D.add(*I); + DEBUG(std::cerr << "Disambiguating functions (external-only)\n"); for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) D.add(*I); // Now just rename functions and globals as necessary, keeping what's already // in the set unique. D.setExternalOnly(false); + DEBUG(std::cerr << "Disambiguating globals\n"); for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) D.add(*I); + DEBUG(std::cerr << "Disambiguating globals\n"); for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) D.add(*I); } @@ -157,6 +311,40 @@ if (!I->isExternal()) MisCodegenFunctions.push_back(I); + // If we are executing the JIT, we *must* keep the function `main' in the + // module that is passed in, and not the shared library. However, we still + // want to be able to debug the `main' function alone. Thus, we create a new + // function `main' which just calls the old one. + if (isExecutingJIT()) { + // Get the `main' function + Function *oldMain = Program->getNamedFunction("main"); + // Rename it + oldMain->setName("old_main"); + // Create a NEW `main' function with same type + Function *newMain = new Function(oldMain->getFunctionType(), + GlobalValue::InternalLinkage, + "main", Program); + // Call the old main function and return its result + BasicBlock *BB = new BasicBlock("entry", newMain); + std::vector args; + for (Function::aiterator I=newMain->abegin(), E=newMain->aend(); I!=E; ++I) + args.push_back(I); + CallInst *call = new CallInst(oldMain, args); + BB->getInstList().push_back(call); + + // if the type of old function wasn't void, return value of call + ReturnInst *ret; + if (oldMain->getReturnType() != Type::VoidTy) { + ret = new ReturnInst(call); + } else { + ret = new ReturnInst(); + } + + // Add the return instruction to the BasicBlock + BB->getInstList().push_back(ret); + } + + // Do the reduction... ReduceMisCodegenFunctions(*this).reduceList(MisCodegenFunctions); @@ -165,7 +353,7 @@ std::cout << "\n"; // Output a bunch of bytecode files for the user... - // ReduceMisCodegenFunctions(*this).TestFuncs(MisCodegenFunctions); + ReduceMisCodegenFunctions(*this).TestFuncs(MisCodegenFunctions, true); return false; } Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.8 llvm/tools/bugpoint/ExecutionDriver.cpp:1.9 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.8 Thu Jul 24 16:59:10 2003 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Mon Jul 28 14:16:14 2003 @@ -17,6 +17,7 @@ #include "BugDriver.h" #include "SystemUtils.h" #include "Support/CommandLine.h" +#include "Support/Statistic.h" #include #include @@ -101,12 +102,13 @@ 0 }; + std::cout << ""; return RunProgramWithTimeout(LLIPath, Args, InputFile, OutputFile, OutputFile); } //===----------------------------------------------------------------------===// -// GCC Implementation of AbstractIntepreter interface +// GCC abstraction // // This is not a *real* AbstractInterpreter as it does not accept bytecode // files, but only input acceptable to GCC, i.e. C, C++, and assembly files @@ -145,7 +147,7 @@ FileType fileType, const std::string &OutputFile, const std::string &SharedLib) { - std::string OutputBinary = "bugpoint.gcc.exe"; + std::string OutputBinary = getUniqueFilename("bugpoint.gcc.exe"); const char **GCCArgs; const char *ArgsWithoutSO[] = { @@ -159,9 +161,9 @@ }; const char *ArgsWithSO[] = { GCCPath.c_str(), + SharedLib.c_str(), // Specify the shared library to link in... "-x", (fileType == AsmFile) ? "assembler" : "c", ProgramFile.c_str(), // Specify the input filename... - SharedLib.c_str(), // Specify the shared library to link in... "-o", OutputBinary.c_str(), // Output to the right filename... "-lm", // Hard-code the math library... "-O2", // Optimize the program a bit... @@ -181,9 +183,8 @@ 0 }; - std::cout << ""; - // Now that we have a binary, run it! + std::cout << ""; int ProgramResult = RunProgramWithTimeout(OutputBinary, ProgramArgs, InputFile, OutputFile, OutputFile); std::cout << "\n"; @@ -194,7 +195,7 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, std::string &OutputFile) { - OutputFile = "./bugpoint.so"; + OutputFile = getUniqueFilename("./bugpoint.so"); // Compile the C/asm file into a shared object const char* GCCArgs[] = { GCCPath.c_str(), @@ -277,7 +278,6 @@ int OutputAsm(const std::string &Bytecode, std::string &OutputAsmFile); - }; int LLC::OutputAsm(const std::string &Bytecode, @@ -347,26 +347,25 @@ int JIT::ExecuteProgram(const std::string &Bytecode, const std::string &OutputFile, const std::string &SharedLib) { - if (SharedLib.empty()) { - const char* Args[] = { - LLIPath.c_str(), - "-quiet", - "-force-interpreter=false", - Bytecode.c_str(), - 0 - }; - return RunProgramWithTimeout(LLIPath, Args, - InputFile, OutputFile, OutputFile); - } else { - const char* Args[] = { - LLIPath.c_str(), "-quiet", "-force-interpreter=false", - "-load", SharedLib.c_str(), - Bytecode.c_str(), - 0 - }; - return RunProgramWithTimeout(LLIPath, Args, - InputFile, OutputFile, OutputFile); - } + const char* ArgsWithoutSO[] = { + LLIPath.c_str(), "-quiet", "-force-interpreter=false", + Bytecode.c_str(), + 0 + }; + + const char* ArgsWithSO[] = { + LLIPath.c_str(), "-quiet", "-force-interpreter=false", + "-load", SharedLib.c_str(), + Bytecode.c_str(), + 0 + }; + + const char** JITArgs = SharedLib.empty() ? ArgsWithoutSO : ArgsWithSO; + + std::cout << ""; + DEBUG(std::cerr << "\nSending output to " << OutputFile << "\n"); + return RunProgramWithTimeout(LLIPath, JITArgs, + InputFile, OutputFile, OutputFile); } //===----------------------------------------------------------------------===// @@ -591,7 +590,11 @@ if (C1 != C2) { FilesDifferent = true; break; } } while (C1 != EOF); - removeFile(Output); + //removeFile(Output); if (RemoveBytecode) removeFile(BytecodeFile); return FilesDifferent; +} + +bool BugDriver::isExecutingJIT() { + return InterpreterSel == RunJIT; } From brukman at cs.uiuc.edu Mon Jul 28 14:19:02 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 14:19:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Module.h Message-ID: <200307281918.OAA21589@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Module.h updated: 1.31 -> 1.32 --- Log message: Lined things up in a more aesthetically pleasing way. --- Diffs of the changes: Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.31 llvm/include/llvm/Module.h:1.32 --- llvm/include/llvm/Module.h:1.31 Tue Apr 22 13:02:02 2003 +++ llvm/include/llvm/Module.h Mon Jul 28 14:17:53 2003 @@ -45,8 +45,8 @@ typedef std::reverse_iterator const_reverse_giterator; // Function iterators... - typedef FunctionListType::iterator iterator; - typedef FunctionListType::const_iterator const_iterator; + typedef FunctionListType::iterator iterator; + typedef FunctionListType::const_iterator const_iterator; typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; From brukman at cs.uiuc.edu Mon Jul 28 14:21:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 14:21:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/PluginLoader.cpp Message-ID: <200307281920.OAA21606@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: PluginLoader.cpp updated: 1.3 -> 1.4 --- Log message: The RTLD_GLOBAL flag allows symbols to be globally accessible, which makes resolution of symbols in the .so possible (currently assists debugging with bugpoint). --- Diffs of the changes: Index: llvm/lib/Support/PluginLoader.cpp diff -u llvm/lib/Support/PluginLoader.cpp:1.3 llvm/lib/Support/PluginLoader.cpp:1.4 --- llvm/lib/Support/PluginLoader.cpp:1.3 Mon Jun 30 16:58:48 2003 +++ llvm/lib/Support/PluginLoader.cpp Mon Jul 28 14:19:58 2003 @@ -18,7 +18,7 @@ namespace { struct PluginLoader { void operator=(const std::string &Filename) { - if (dlopen(Filename.c_str(), RTLD_NOW) == 0) + if (dlopen(Filename.c_str(), RTLD_NOW|RTLD_GLOBAL) == 0) std::cerr << "Error opening '" << Filename << "': " << dlerror() << "\n -load request ignored.\n"; } From brukman at cs.uiuc.edu Mon Jul 28 14:22:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 14:22:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/ProgrammersManual.html Message-ID: <200307281921.OAA21644@zion.cs.uiuc.edu> Changes in directory llvm/www/docs: ProgrammersManual.html updated: 1.40 -> 1.41 --- Log message: Added comma after `i.e.' --- Diffs of the changes: Index: llvm/www/docs/ProgrammersManual.html diff -u llvm/www/docs/ProgrammersManual.html:1.40 llvm/www/docs/ProgrammersManual.html:1.41 --- llvm/www/docs/ProgrammersManual.html:1.40 Wed May 7 16:47:39 2003 +++ llvm/www/docs/ProgrammersManual.html Mon Jul 28 14:21:20 2003 @@ -641,8 +641,8 @@ Say that you're writing a FunctionPass and would like to count all the locations in the entire module (that is, across every -Function) where a certain function (i.e. some -Function*) already in scope. As you'll learn later, you may +Function) where a certain function (i.e., some +Function*) is already in scope. As you'll learn later, you may want to use an InstVisitor to accomplish this in a much more straightforward manner, but this example will allow us to explore how you'd do it if you didn't have InstVisitor around. In @@ -869,8 +869,7 @@

Replacing individual instructions

Including "llvm/Transforms/Utils/BasicBlockUtils.h -" permits use of two very useful replace functions: +href="/doxygen/BasicBlockUtils_8h-source.html">llvm/Transforms/Utils/BasicBlockUtils.h" permits use of two very useful replace functions: ReplaceInstWithValue and ReplaceInstWithInst.

    From criswell at cs.uiuc.edu Mon Jul 28 14:27:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Jul 28 14:27:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/ReleaseTasks.html Message-ID: <200307281926.OAA14386@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: ReleaseTasks.html updated: 1.4 -> 1.5 --- Log message: Added two tasks: o Check for GCC version in configure script. o Rewrite this file without Netscape Composer. --- Diffs of the changes: Index: llvm/www/docs/ReleaseTasks.html diff -u llvm/www/docs/ReleaseTasks.html:1.4 llvm/www/docs/ReleaseTasks.html:1.5 --- llvm/www/docs/ReleaseTasks.html:1.4 Mon Jul 21 17:22:48 2003 +++ llvm/www/docs/ReleaseTasks.html Mon Jul 28 14:26:39 2003 @@ -4,247 +4,277 @@ LLVM Public Release Project - -
    + +

    LLVM Public Release Project

    -
    - +
    + -
    - - +
    + + - - - + - - - + + +
    +
    What is this?
    - +
      - - This document is a list of things to do before the LLVM project is publicly - released.  It will provide a checklist so that we know what has been - done and what is left to be done.  It will also keep a "wishlist" -of desirable features. + + This document is a list of things to do before the LLVM project is publicly + released.  It will provide a checklist so that we know what has +been done and what is left to be done.  It will also keep a "wishlist" +of desirable features.

      -

      - +

      +
    - + - - - + - - - + + +
    +
    Priorities
    - +
      - The - list of things to do... + The + list of things to do...

      -

      - +

      +
    - + - - - - + + - - - + + +
       High Priority +
       High Priority
    - +
      - +
        - +
          - +
        -
      • Fix currently known bugs and write regression tests.
      • +
      • Fix currently known bugs and write regression tests.
      • +
          -
        • The gccld segfault from GlobalDCE.cpp.
        • -
        • The infinite loop for Tail Recursion.
        • -
        • The C++ constructor on dlopen() bug on Solaris.
          -
        • +
        • The gccld segfault from GlobalDCE.cpp.
        • +
        • The infinite loop for Tail Recursion.
        • +
        • The C++ constructor on dlopen() bug on Solaris.
          +
        • +
        -
      • Get autoconf to configure source and build directories according -to normal autoconf procedures.
      • +
      • Get autoconf to configure source and build directories according + to normal autoconf procedures.
      • +
          -
        • Get test tree to work properly when configuring for a different -object root.
        • -
        • Get lex/yacc/etc output to be placed into the build tree, not the -source tree.
          -
        • +
        • Get test tree to work properly when configuring for a different + object root.
        • +
        • Get lex/yacc/etc output to be placed into the build tree, not +the source tree.
          +
        • +
        -
      • Test Suite
      • +
      • Test Suite
      • +
          -
        • Create a nightly tester for Sparc.
        • -
        • Modify the test suite to have consistent output.
        • -
        • Add Pass/Fail tests to nightly tester.
          -
        • -
        • Make the USE_SPEC option work for the test directory.
        • -
        • Cleanup test/Programs.
        • +
        • Create a nightly tester for Sparc.
        • +
        • Modify the test suite to have consistent output.
        • +
        • Add Pass/Fail tests to nightly tester.
          +
        • +
        • Make the USE_SPEC option work for the test directory.
        • +
        • Cleanup test/Programs.
        • +
        -
      • Move the pool allocator and Reoptimizer code out of mainline CVS -and the release.
      • -
      • Documentation
      • +
      • Move the pool allocator and Reoptimizer code out of mainline CVS + and the release.
      • +
      • Add autoconf checks to ensure that the compiler is GCC 3.x or higher.
        +
      • +
      • Documentation
      • +
          -
        • Write documentation on the LLVM tools.
        • -
        • Review docs, ensuring that the information is up to date.
        • +
        • Write documentation on the LLVM tools.
        • +
        • Review docs, ensuring that the information is up to date.
        • +
        -
      • GCC C Front End
        -
      • +
      • GCC C Front End
        +
      • +
          -
        • Create a fix (i.e. better hack) for the sys/select.h hack.
        • +
        • Create a fix (i.e. better hack) for the sys/select.h hack.
        • +
        -
      • Licenses
      • +
      • Licenses
      • +
          -
        • Ensure all software in source tree has proper license.
          -
        • +
        • Ensure all software in source tree has proper license.
          +
        • +
        +
          -
        • Check licenses in test/Programs to ensure everything is good.
        • -
        • Create license files for anything in the distribution that is not -under our license.
          -
        • +
        • Check licenses in test/Programs to ensure everything is good.
        • +
        • Create license files for anything in the distribution that is +not under our license.
          +
        • +
        -
      • Ensure SafeCode builds.
      • -
      • Create a system for managing development and releases -(i.e. CVS branching, labeling revisions, etc).
        -
      • - +
      • Ensure SafeCode builds.
      • +
      • Create a system for managing development and releases + (i.e. CVS branching, labeling revisions, etc).
        +
      • +
      - +

      -

      - +

      +
    - + - - - - + + - - - + + +
       Medium Priority +
       Medium Priority
    - +
      - +
        -
      • Improve documentation on how to create an LLVM project.
        -
      • -
      • Testing
      • - -
          -
        • Cleanup Reoptimizer tests so that they fit into the framework.
          -
        • - -
        -
      • Create an installer for the software.
      • -
      • Put autoconf files into a separate directory (i.e. not llvm).
        -
      • - +
      • Improve documentation on how to create an LLVM project.
        +
      • +
      • Testing
      • + +
          +
        • Cleanup Reoptimizer tests so that they fit into the framework.
          +
        • + +
        +
      • Create an installer for the +software.
      • +
      • Put autoconf files into a separate directory (i.e. not llvm).
        +
      • +
      - +

      -

      - +

      +
    - + - - - - + + - - - + + +
       Low Priority +
       Low Priority
    - +
      - +
        -
      • GCC C Front End
      • +
      • GCC C Front End
      • +
          -
        • Place the C front end into the CVS repository.
        • -
        • Ensure that the C front end compiles and installs nicely.
        • -
        • Add C++ support.
          -
        • +
        • Place the C front end into the CVS repository.
        • +
        • Ensure that the C front end compiles and installs nicely.
        • +
        • Add C++ support.
          +
        • +
        -
      • Release Management
      • +
      • Release Management
      • +
          -
        • Find and implement a bug reporting system (i.e. Bugzilla).
        • +
        • Find and implement a bug reporting system (i.e. Bugzilla).
        • +
        -
      • Make the projects/sample directory an actual example of LLVM code.
      • -
      • Testing
      • +
      • Make the projects/sample directory an actual example of LLVM code.
      • +
      • Testing
      • +
          -
        • Create descriptions of what each test is doing (test specifications).
          -
        • -
        • Test LLVM on various Linux distributions.
        • -
        • Test LLVM on various Solaris distributions.
        • -
        • Test LLVM on Solaris/x86.
          -
        • +
        • Create descriptions of what each test is doing (test specifications).
          +
        • +
        • Test LLVM on various Linux distributions.
        • +
        • Test LLVM on various Solaris distributions.
        • +
        • Test LLVM on Solaris/x86.
          +
        • +
        -
      • Licenses
      • +
      • Licenses
      • +
          -
        • Create a license for the UIUC specific LLVM code.
        • -
        • Add a license file to the distribution.
        • -
        • Add a copyright notice and license information to each source -file.
        • +
        • Create a license for the UIUC specific LLVM code.
        • +
        • Add a license file to the distribution.
        • +
        • Add a copyright notice and license information to each source + file.
        • +
        -
      • Documentation
      • +
      • Documentation
      • +
          -
        • Create man pages for the LLVM utilities.
        • -
        • Create man pages for the LLVM libraries.
          -
        • +
        • Create man pages for the LLVM utilities.
        • +
        • Create man pages for the LLVM libraries.
        • +
        - +
      • Rewrite this page without Netscape Composer :)
        +
      • +
      - +
    - +
    John Criswell
    - - Last modified: Sat May 31 14:54:03 CDT 2003

    -
    -
    + + Last modified: Sat May 31 14:54:03 CDT 2003

    +
    +
    +
    +


    From brukman at cs.uiuc.edu Mon Jul 28 14:27:03 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 14:27:03 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/JIT/Emitter.cpp Message-ID: <200307281926.OAA21749@zion.cs.uiuc.edu> Changes in directory llvm/tools/lli/JIT: Emitter.cpp updated: 1.18 -> 1.19 --- Log message: Add rationale for the MAP_ANONYMOUS vs. MAP_ANON flags. --- Diffs of the changes: Index: llvm/tools/lli/JIT/Emitter.cpp diff -u llvm/tools/lli/JIT/Emitter.cpp:1.18 llvm/tools/lli/JIT/Emitter.cpp:1.19 --- llvm/tools/lli/JIT/Emitter.cpp:1.18 Mon Jul 28 14:09:06 2003 +++ llvm/tools/lli/JIT/Emitter.cpp Mon Jul 28 14:26:19 2003 @@ -73,6 +73,7 @@ static const long pageSize = sysconf(_SC_PAGESIZE); #if defined(i386) || defined(__i386__) || defined(__x86__) + /* Linux and *BSD tend to have these flags named differently. */ #if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) # define MAP_ANONYMOUS MAP_ANON #endif From brukman at cs.uiuc.edu Mon Jul 28 16:00:03 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 16:00:03 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.h Message-ID: <200307282059.PAA21946@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: BugDriver.h updated: 1.11 -> 1.12 --- Log message: Added comment to function isExecutingJIT() --- Diffs of the changes: Index: llvm/tools/bugpoint/BugDriver.h diff -u llvm/tools/bugpoint/BugDriver.h:1.11 llvm/tools/bugpoint/BugDriver.h:1.12 --- llvm/tools/bugpoint/BugDriver.h:1.11 Mon Jul 28 14:16:13 2003 +++ llvm/tools/bugpoint/BugDriver.h Mon Jul 28 15:59:16 2003 @@ -91,6 +91,8 @@ /// functions that are not under consideration. bool debugCodeGenerator(); + /// isExecutingJIT - Returns true if bugpoint is currently testing the JIT + /// bool isExecutingJIT(); private: From brukman at cs.uiuc.edu Mon Jul 28 16:08:02 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 28 16:08:02 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/CodeGeneratorBug.cpp Message-ID: <200307282107.QAA23384@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: CodeGeneratorBug.cpp updated: 1.3 -> 1.4 --- Log message: Implemented cleanups as suggested by Chris: * Use Module::getNamedFunction() to delete "main" instead of using a loop * Compare function pointers instead of function names to determine equivalence * Simplified creation of a 2-element vector containing zeroes * Manually performed LICM on code * Added an abort() in case a function we're considering occurs in something that is not an instruction * Use DEBUG() around code sections instead of just in a statement in a loop, because GCC's DCE may not be good enough to completely remove it in a release build * Print out a command that can be directly copied-and-pasted to re-execute * Instead of just checking if a symbol begins with a dot and fixing it accordingly, use Mangler and fix all the problems (invalid chars in C symbol names) entirely * The new `main' function has external linkage --- Diffs of the changes: Index: llvm/tools/bugpoint/CodeGeneratorBug.cpp diff -u llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.3 llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.4 --- llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.3 Mon Jul 28 14:16:14 2003 +++ llvm/tools/bugpoint/CodeGeneratorBug.cpp Mon Jul 28 16:07:39 2003 @@ -16,6 +16,7 @@ #include "llvm/Module.h" #include "llvm/Pass.h" #include "llvm/Analysis/Verifier.h" +#include "llvm/Support/Mangler.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Linker.h" @@ -94,8 +95,8 @@ // (called or taken address of), and make them call the JIT wrapper instead if (BD.isExecutingJIT()) { // Must delete `main' from Safe module if it has it - for (Module::iterator I=SafeModule->begin(), E=SafeModule->end();I!=E;++I) - if (I->getName() == "main") DeleteFunctionBody(I); + Function *safeMain = SafeModule->getNamedFunction("main"); + DeleteFunctionBody(safeMain); // Add an external function "getPointerToNamedFunction" that JIT provides // Prototype: void *getPointerToNamedFunction(const char* Name) @@ -103,17 +104,15 @@ Params.push_back(PointerType::get(Type::SByteTy)); // std::string& FunctionType *resolverTy = FunctionType::get(PointerType::get(Type::VoidTy), Params, false /* isVarArg */); - const std::string ResolverFunctionName = "getPointerToNamedFunction"; Function *resolverFunc = new Function(resolverTy, GlobalValue::ExternalLinkage, - ResolverFunctionName, + "getPointerToNamedFunction", SafeModule); // Use the function we just added to get addresses of functions we need // Iterate over the global declarations in the Safe module for (Module::iterator F=SafeModule->begin(),E=SafeModule->end(); F!=E; ++F){ - if (F->isExternal() && F->use_begin() != F->use_end() && - F->getName() != ResolverFunctionName) { + if (F->isExternal() && !F->use_empty() && &(*F) != resolverFunc) { // If it has a non-zero use list, // 1. Add a string constant with its name to the global file // The correct type is `const [ NUM x sbyte ]' where NUM is length of @@ -129,26 +128,23 @@ // 2. Use `GetElementPtr *funcName, 0, 0' to convert the string to an // sbyte* so it matches the signature of the resolver function. - Constant *Zero = Constant::getNullValue(Type::LongTy); - std::vector GEPargs; - GEPargs.push_back(Zero); - GEPargs.push_back(Zero); + std::vector GEPargs(2, Constant::getNullValue(Type::LongTy)); // 3. Replace all uses of `func' with calls to resolver by: // (a) Iterating through the list of uses of this function // (b) Insert a cast instruction in front of each use // (c) Replace use of old call with new call - // Insert code at the beginning of the function + // GetElementPtr *funcName, ulong 0, ulong 0 + Value *GEP = + ConstantExpr::getGetElementPtr(ConstantPointerRef::get(funcName), + GEPargs); + std::vector ResolverArgs; + ResolverArgs.push_back(GEP); + // Insert code at the beginning of the function for (Value::use_iterator i=F->use_begin(), e=F->use_end(); i!=e; ++i) { if (Instruction* Inst = dyn_cast(*i)) { - // GetElementPtr *funcName, ulong 0, ulong 0 - Value *GEP = - ConstantExpr::getGetElementPtr(ConstantPointerRef::get(funcName), - GEPargs); - std::vector ResolverArgs; - ResolverArgs.push_back(GEP); // call resolver(GetElementPtr...) CallInst *resolve = new CallInst(resolverFunc, ResolverArgs, "resolver", Inst); @@ -158,27 +154,32 @@ "", Inst); // actually use the resolved function Inst->replaceUsesOfWith(F, castResolver); - - //BasicBlock::iterator ii(Inst); - //ReplaceInstWithValue(Inst->getParent()->getInstList(), - // ii, ResolverResult); + } else { + // FIXME: need to take care of cases where a function is used that + // is not an instruction, e.g. global variable initializer... + std::cerr << "Non-instruction is using an external function!\n"; + abort(); } } } } } - DEBUG(std::cerr << "Safe module:\n"); - for (Module::iterator I = SafeModule->begin(), E = SafeModule->end();I!=E;++I) - if (!I->isExternal()) DEBUG(std::cerr << "\t" << I->getName() << "\n"); - for (Module::giterator I=SafeModule->gbegin(),E = SafeModule->gend();I!=E;++I) - if (!I->isExternal()) DEBUG(std::cerr << "\t" << I->getName() << "\n"); - - DEBUG(std::cerr << "Test module:\n"); - for (Module::iterator I =TestModule->begin(),E = TestModule->end(); I!=E;++I) - if (!I->isExternal()) DEBUG(std::cerr << "\t" << I->getName() << "\n"); - for (Module::giterator I=TestModule->gbegin(),E = TestModule->gend();I!=E;++I) - if (!I->isExternal()) DEBUG(std::cerr << "\t" << I->getName() << "\n"); + DEBUG(std::cerr << "Safe module:\n"; + typedef Module::iterator MI; + typedef Module::giterator MGI; + + for (MI I = SafeModule->begin(), E = SafeModule->end(); I != E; ++I) + if (!I->isExternal()) std::cerr << "\t" << I->getName() << "\n"; + for (MGI I = SafeModule->gbegin(), E = SafeModule->gend(); I!=E; ++I) + if (!I->isExternal()) std::cerr << "\t" << I->getName() << "\n"; + + std::cerr << "Test module:\n"; + for (MI I = TestModule->begin(), E = TestModule->end(); I != E; ++I) + if (!I->isExternal()) std::cerr << "\t" << I->getName() << "\n"; + for (MGI I=TestModule->gbegin(),E = TestModule->gend(); I!= E; ++I) + if (!I->isExternal()) std::cerr << "\t" << I->getName() << "\n"; + ); // Write out the bytecode to be sent to CBE std::string SafeModuleBC = getUniqueFilename("bugpoint.safe.bc"); @@ -226,7 +227,8 @@ int Result = BD.diffProgram(TestModuleBC, SharedObject, false); if (KeepFiles) { std::cout << "You can reproduce the problem with the command line: \n" - << "lli (or llc) -load " << SharedObject << " " << TestModuleBC + << (BD.isExecutingJIT() ? "lli" : "llc") + << " -load " << SharedObject << " " << TestModuleBC << "\n"; } else { removeFile(TestModuleBC); @@ -253,13 +255,10 @@ std::string SymName = V.getName(); - // If the symbol starts with a '.', replace it with 'x' - // This solves the problem of not being able to find symbols in an .so - // file when those symbol names start with '.' - if (SymName[0] == '.') { - SymName[0] = 'x'; - V.setName(SymName); - } + // Use the Mangler facility to make symbol names that will be valid in + // shared objects. + SymName = Mangler::makeNameProper(SymName); + V.setName(SymName); if (SymbolNames.count(SymName) == 0) { DEBUG(std::cerr << "Disambiguator: adding " << SymName @@ -322,7 +321,7 @@ oldMain->setName("old_main"); // Create a NEW `main' function with same type Function *newMain = new Function(oldMain->getFunctionType(), - GlobalValue::InternalLinkage, + GlobalValue::ExternalLinkage, "main", Program); // Call the old main function and return its result BasicBlock *BB = new BasicBlock("entry", newMain); @@ -343,7 +342,6 @@ // Add the return instruction to the BasicBlock BB->getInstList().push_back(ret); } - // Do the reduction... ReduceMisCodegenFunctions(*this).reduceList(MisCodegenFunctions); From lattner at cs.uiuc.edu Mon Jul 28 16:19:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 28 16:19:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Intrinsics.h Message-ID: <200307282118.QAA23096@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Intrinsics.h updated: 1.3 -> 1.4 --- Log message: Add alpha intrinsics, contributed by Rahul Joshi --- Diffs of the changes: Index: llvm/include/llvm/Intrinsics.h diff -u llvm/include/llvm/Intrinsics.h:1.3 llvm/include/llvm/Intrinsics.h:1.4 --- llvm/include/llvm/Intrinsics.h:1.3 Tue Jun 3 10:30:13 2003 +++ llvm/include/llvm/Intrinsics.h Mon Jul 28 16:18:21 2003 @@ -17,12 +17,26 @@ enum ID { not_intrinsic = 0, // Must be zero - va_start, // Used to represent a va_start call in C - va_end, // Used to represent a va_end call in C - va_copy, // Used to represent a va_copy call in C + va_start, // Used to represent a va_start call in C + va_end, // Used to represent a va_end call in C + va_copy, // Used to represent a va_copy call in C - setjmp, // Used to represent a setjmp call in C - longjmp, // Used to represent a longjmp call in C + setjmp, // Used to represent a setjmp call in C + longjmp, // Used to represent a longjmp call in C + + //===------------------------------------------------------------------===// + // This section defines intrinsic functions used to represent Alpha + // instructions... + // + alpha_ctlz, // CTLZ (count leading zero): counts the number of leading + // zeros in the given ulong value + alpha_cttz, // CTTZ (count trailing zero): counts the number of trailing + // zeros in the given ulong value + alpha_ctpop, // CTPOP (count population): counts the number of ones in + // the given ulong value + alpha_umulh, // UMULH (unsigned multiply quadword high): Takes two 64-bit + // (ulong) values, and returns the upper 64 bits of their + // 128 bit product as a ulong }; } From lattner at cs.uiuc.edu Mon Jul 28 16:22:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 28 16:22:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Verifier.cpp Message-ID: <200307282121.QAA23513@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.39 -> 1.40 Verifier.cpp updated: 1.51 -> 1.52 --- Log message: Add support for Alpha intrinsics, contributed by Rahul Joshi --- Diffs of the changes: Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.39 llvm/lib/VMCore/Function.cpp:1.40 --- llvm/lib/VMCore/Function.cpp:1.39 Sat May 17 17:26:33 2003 +++ llvm/lib/VMCore/Function.cpp Mon Jul 28 16:20:57 2003 @@ -164,6 +164,12 @@ return 0; // All intrinsics start with 'llvm.' switch (getName()[5]) { + case 'a': + if (getName() == "llvm.alpha.ctlz") return LLVMIntrinsic::alpha_ctlz; + if (getName() == "llvm.alpha.cttz") return LLVMIntrinsic::alpha_cttz; + if (getName() == "llvm.alpha.ctpop") return LLVMIntrinsic::alpha_ctpop; + if (getName() == "llvm.alpha.umulh") return LLVMIntrinsic::alpha_umulh; + break; case 'l': if (getName() == "llvm.longjmp") return LLVMIntrinsic::longjmp; break; Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.51 llvm/lib/VMCore/Verifier.cpp:1.52 --- llvm/lib/VMCore/Verifier.cpp:1.51 Thu Jun 5 16:01:26 2003 +++ llvm/lib/VMCore/Verifier.cpp Mon Jul 28 16:20:57 2003 @@ -521,6 +521,12 @@ case LLVMIntrinsic::va_copy: NumArgs = 2; break; case LLVMIntrinsic::setjmp: NumArgs = 1; break; case LLVMIntrinsic::longjmp: NumArgs = 2; break; + + case LLVMIntrinsic::alpha_ctlz: NumArgs = 1; break; + case LLVMIntrinsic::alpha_cttz: NumArgs = 1; break; + case LLVMIntrinsic::alpha_ctpop: NumArgs = 1; break; + case LLVMIntrinsic::alpha_umulh: NumArgs = 2; break; + case LLVMIntrinsic::not_intrinsic: assert(0 && "Invalid intrinsic!"); NumArgs = 0; break; } From brukman at cs.uiuc.edu Mon Jul 28 16:58:01 2003 From: brukman at cs.uiuc.edu (Michael Brukman) Date: Mon Jul 28 16:58:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/CodingStandards.html Message-ID: <200307282157.QAA28236@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: CodingStandards.html updated: 1.7 -> 1.8 --- Log message: Made many paragraphs fit into 80 characters per line to avoid wrapping in an editor window. Re-worded confusing description about interdependence of modules. --- Diffs of the changes: Index: llvm/www/docs/CodingStandards.html diff -u llvm/www/docs/CodingStandards.html:1.7 llvm/www/docs/CodingStandards.html:1.8 --- llvm/www/docs/CodingStandards.html:1.7 Fri Jul 25 13:05:51 2003 +++ llvm/www/docs/CodingStandards.html Mon Jul 28 16:57:18 2003 @@ -173,33 +173,53 @@ }

    -...which shuts gcc up. Any gcc warning that annoys you can be fixed by massaging the code appropriately.

    +...which shuts gcc up. Any gcc warning that annoys you can be +fixed by massaging the code appropriately.

    -These are the gcc warnings that I prefer to enable: -Wall -Winline -W -Wwrite-strings -Wno-unused

    +These are the gcc warnings that I prefer to enable: -Wall -Winline +-W -Wwrite-strings -Wno-unused


Which C++ features can I use?

    -Compilers are finally catching up to the C++ standard. Most compilers implement most features, so you can use just about any features that you would like. In the LLVM source tree, I have chosen to not use these features:

    +Compilers are finally catching up to the C++ standard. Most compilers implement +most features, so you can use just about any features that you would like. In +the LLVM source tree, I have chosen to not use these features:

      -
    1. Exceptions: Exceptions are very useful for error reporting and handling exceptional conditions. I do not use them in LLVM because they do have an associated performance impact (by restricting restructuring of code), and parts of LLVM are designed for performance critical purposes.

      - -Just like most of the rules in this document, this isn't a hard and fast requirement. Exceptions are used in the Parser, because it simplifies error reporting significantly, and the LLVM parser is not at all in the critical path.

      - -

    2. RTTI: RTTI has a large cost in terms of executable size, and compilers are not yet very good at stomping out "dead" class information blocks. Because of this, typeinfo and dynamic cast are not used. +
    3. Exceptions: Exceptions are very useful for error reporting and handling +exceptional conditions. I do not use them in LLVM because they do have an +associated performance impact (by restricting restructuring of code), and parts +of LLVM are designed for performance critical purposes.

      + +Just like most of the rules in this document, this isn't a hard and fast +requirement. Exceptions are used in the Parser, because it simplifies error +reporting significantly, and the LLVM parser is not at all in the +critical path.

      + +

    4. RTTI: RTTI has a large cost in terms of executable size, and compilers are +not yet very good at stomping out "dead" class information blocks. Because of +this, typeinfo and dynamic cast are not used.

    -Other features, such as templates (without partial specialization) can be used freely. The general goal is to have clear, consise, performant code... if a technique assists with that then use it.

    +Other features, such as templates (without partial specialization) can be used +freely. The general goal is to have clear, consise, performant code... if a +technique assists with that then use it.


Write Portable Code

    -In almost all cases, it is possible and within reason to write completely portable code. If there are cases where it isn't possible to write portable code, isolate it behind a well defined (and well documented) interface.

    - -In practice, this means that you shouldn't assume much about the host compiler, including its support for "high tech" features like partial specialization of templates. In fact, Visual C++ 6 could be an important target for our work in the future, and we don't want to have to rewrite all of our code to support it.

    +In almost all cases, it is possible and within reason to write completely +portable code. If there are cases where it isn't possible to write portable +code, isolate it behind a well defined (and well documented) interface.

    + +In practice, this means that you shouldn't assume much about the host compiler, +including its support for "high tech" features like partial specialization of +templates. In fact, Visual C++ 6 could be an important target for our work in +the future, and we don't want to have to rewrite all of our code to support +it.

    @@ -219,33 +239,71 @@


A Public Header File is a Module


#include as Little as Possible

    -#include hurts compile time performance. Don't do it unless you have to, especially in header files.

    +#include hurts compile time performance. Don't do it unless you have +to, especially in header files.

    -But wait, sometimes you need to have the definition of a class to use it, or to inherit from it. In these cases go ahead and #include that header file. Be aware however that there are many cases where you don't need to have the full definition of a class. If you are using a pointer or reference to a class, you don't need the header file. If you are simply returning a class instance from a prototyped function or method, you don't need it. In fact, for most cases, you simply don't need the definition of a class... and not #include'ing speeds up compilation.

    - -It is easy to try to go too overboard on this recommendation, however. You must include all of the header files that you are using, either directly or indirectly (through another header file). To make sure that you don't accidently forget to include a header file in your module header, make sure to include your module header first in the implementation file (as mentioned above). This way there won't be any hidden dependencies that you'll find out about later...

    +But wait, sometimes you need to have the definition of a class to use it, or to +inherit from it. In these cases go ahead and #include that header file. Be +aware however that there are many cases where you don't need to have the full +definition of a class. If you are using a pointer or reference to a class, you +don't need the header file. If you are simply returning a class instance from a +prototyped function or method, you don't need it. In fact, for most cases, you +simply don't need the definition of a class... and not #include'ing +speeds up compilation.

    + +It is easy to try to go too overboard on this recommendation, however. You +must include all of the header files that you are using, either directly +or indirectly (through another header file). To make sure that you don't +accidently forget to include a header file in your module header, make sure to +include your module header first in the implementation file (as mentioned +above). This way there won't be any hidden dependencies that you'll find out +about later...


Keep "internal" Headers Private

    -Many modules have a complex implementation that causes them to use more than one implementation (.cpp) file. It is often tempting to put the internal communication interface (helper classes, extra functions, etc) in the public module header file. Don't do this. :)

    - -If you really need to do something like this, put a private header file in the same directory as the source files, and include it locally. This ensures that your private interface remains private and undisturbed by outsiders.

    +Many modules have a complex implementation that causes them to use more than one +implementation (.cpp) file. It is often tempting to put the internal +communication interface (helper classes, extra functions, etc) in the public +module header file. Don't do this. :)

    + +If you really need to do something like this, put a private header file in the +same directory as the source files, and include it locally. This ensures that +your private interface remains private and undisturbed by outsiders.

    -Note however, that it's okay to put extra implementation methods a public class itself... just make them private (or protected), and all is well.

    +Note however, that it's okay to put extra implementation methods a public class +itself... just make them private (or protected), and all is well.

    @@ -257,9 +315,17 @@


Assert Liberally

    -Use the "assert" function to its fullest. Check all of your preconditions and assumptions, you never know when a bug (not neccesarily even yours) might be caught early by an assertion, which reduces debugging time dramatically. The "<cassert>" header file is probably already included by the header files you are using, so it doesn't cost anything to use it.

    - -To further assist with debugging, make sure to put some kind of error message in the assertion statement (which is printed if the assertion is tripped). This helps the poor debugging make sense of why an assertion is being made and enforced, and hopefully what to do about it. Here is one complete example:

    +Use the "assert" function to its fullest. Check all of your +preconditions and assumptions, you never know when a bug (not neccesarily even +yours) might be caught early by an assertion, which reduces debugging time +dramatically. The "<cassert>" header file is probably already +included by the header files you are using, so it doesn't cost anything to use +it.

    + +To further assist with debugging, make sure to put some kind of error message in +the assertion statement (which is printed if the assertion is tripped). This +helps the poor debugging make sense of why an assertion is being made and +enforced, and hopefully what to do about it. Here is one complete example:

       inline Value *getOperand(unsigned i) { 
    @@ -288,15 +354,24 @@
     
     


Prefer Preincrement

    -Hard fast rule: Preincrement (++X) may be no slower than postincrement (X++) and could very well be a lot faster than it. Use preincrementation whenever possible.

    - -The semantics of postincrement include making a copy of the value being incremented, returning it, and then preincrementing the "work value". For primitive types, this isn't a big deal... but for iterators, it can be a huge issue (for example, some iterators contains stack and set objects in them... copying an iterator could invoke the copy ctor's of these as well). In general, get in the habit of always using preincrement, and you won't have a problem.

    +Hard fast rule: Preincrement (++X) may be no slower than postincrement (X++) and +could very well be a lot faster than it. Use preincrementation whenever +possible.

    + +The semantics of postincrement include making a copy of the value being +incremented, returning it, and then preincrementing the "work value". For +primitive types, this isn't a big deal... but for iterators, it can be a huge +issue (for example, some iterators contains stack and set objects in them... +copying an iterator could invoke the copy ctor's of these as well). In general, +get in the habit of always using preincrement, and you won't have a problem.


Avoid endl

    -The endl modifier, when used with iostreams outputs a newline to the output stream specified. In addition to doing this, however, it also flushes the output stream. In other words, these are equivalent:

    +The endl modifier, when used with iostreams outputs a newline to the +output stream specified. In addition to doing this, however, it also flushes +the output stream. In other words, these are equivalent:

       cout << endl;
    @@ -309,9 +384,15 @@
     
     


Exploit C++ to its Fullest

From vadve at cs.uiuc.edu Fri Aug 1 10:54:01 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Aug 1 10:54:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/Sparc.cpp Message-ID: <200308011553.KAA01021@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: Sparc.cpp updated: 1.70 -> 1.71 --- Log message: Put back the separate pass to decompose multi-dimensional references since it is *necessary* for correct code generation. Only optional transformations belong in the PreOpts pass (which needs to be renamed from PreSelection to PreOpts). --- Diffs of the changes: Index: llvm/lib/Target/Sparc/Sparc.cpp diff -u llvm/lib/Target/Sparc/Sparc.cpp:1.70 llvm/lib/Target/Sparc/Sparc.cpp:1.71 --- llvm/lib/Target/Sparc/Sparc.cpp:1.70 Tue Jul 29 14:58:00 2003 +++ llvm/lib/Target/Sparc/Sparc.cpp Fri Aug 1 10:53:24 2003 @@ -161,6 +161,9 @@ // FIXME: implement the switch instruction in the instruction selector. PM.add(createLowerSwitchPass()); + // decompose multi-dimensional array references into single-dim refs + PM.add(createDecomposeMultiDimRefsPass()); + // Construct and initialize the MachineFunction object for this fn. PM.add(createMachineCodeConstructionPass(*this)); From vadve at cs.uiuc.edu Fri Aug 1 10:57:01 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Aug 1 10:57:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/EmitAssembly.cpp Message-ID: <200308011556.KAA04687@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: EmitAssembly.cpp updated: 1.86 -> 1.87 --- Log message: Add all arithmetic operators to ConstantExprToString(). Note that some generated operators (like &, | or ^) may not be supported by the assembler -- but if they've got this far, it's better to generate them and let the assembler decide. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/EmitAssembly.cpp diff -u llvm/lib/Target/Sparc/EmitAssembly.cpp:1.86 llvm/lib/Target/Sparc/EmitAssembly.cpp:1.87 --- llvm/lib/Target/Sparc/EmitAssembly.cpp:1.86 Wed Jul 30 07:54:47 2003 +++ llvm/lib/Target/Sparc/EmitAssembly.cpp Fri Aug 1 10:55:53 2003 @@ -213,6 +213,46 @@ + valToExprString(CE->getOperand(1), target) + ")"; break; + case Instruction::Sub: + S += "(" + valToExprString(CE->getOperand(0), target) + ") - (" + + valToExprString(CE->getOperand(1), target) + ")"; + break; + + case Instruction::Mul: + S += "(" + valToExprString(CE->getOperand(0), target) + ") * (" + + valToExprString(CE->getOperand(1), target) + ")"; + break; + + case Instruction::Div: + S += "(" + valToExprString(CE->getOperand(0), target) + ") / (" + + valToExprString(CE->getOperand(1), target) + ")"; + break; + + case Instruction::Rem: + S += "(" + valToExprString(CE->getOperand(0), target) + ") % (" + + valToExprString(CE->getOperand(1), target) + ")"; + break; + + case Instruction::And: + // Logical && for booleans; bitwise & otherwise + S += "(" + valToExprString(CE->getOperand(0), target) + + ((CE->getType() == Type::BoolTy)? ") && (" : ") & (") + + valToExprString(CE->getOperand(1), target) + ")"; + break; + + case Instruction::Or: + // Logical || for booleans; bitwise | otherwise + S += "(" + valToExprString(CE->getOperand(0), target) + + ((CE->getType() == Type::BoolTy)? ") || (" : ") | (") + + valToExprString(CE->getOperand(1), target) + ")"; + break; + + case Instruction::Xor: + // Bitwise ^ for all types + S += "(" + valToExprString(CE->getOperand(0), target) + ") ^ (" + + valToExprString(CE->getOperand(1), target) + ")"; + break; + default: assert(0 && "Unsupported operator in ConstantExprToString()"); break; From vadve at cs.uiuc.edu Fri Aug 1 10:57:06 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Aug 1 10:57:06 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcInstrSelection.cpp Message-ID: <200308011556.KAA04776@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcInstrSelection.cpp updated: 1.109 -> 1.110 --- Log message: *Both* operands of divide need sign-extension before divide (if smaller than machine register size), not just the second operand. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcInstrSelection.cpp diff -u llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.109 llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.110 --- llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.109 Tue Jul 29 14:59:23 2003 +++ llvm/lib/Target/Sparc/SparcInstrSelection.cpp Fri Aug 1 10:54:38 2003 @@ -2053,29 +2053,37 @@ { maskUnsignedResult = true; - // If second operand of divide is smaller than 64 bits, we have + // If either operand of divide is smaller than 64 bits, we have // to make sure the unused top bits are correct because they affect // the result. These bits are already correct for unsigned values. // They may be incorrect for signed values, so sign extend to fill in. Instruction* divI = subtreeRoot->getInstruction(); + Value* divOp1 = subtreeRoot->leftChild()->getValue(); Value* divOp2 = subtreeRoot->rightChild()->getValue(); - Value* divOpToUse = divOp2; - if (divOp2->getType()->isSigned()) { - unsigned opSize=target.getTargetData().getTypeSize(divOp2->getType()); + Value* divOp1ToUse = divOp1; + Value* divOp2ToUse = divOp2; + if (divI->getType()->isSigned()) { + unsigned opSize=target.getTargetData().getTypeSize(divI->getType()); if (opSize < 8) { MachineCodeForInstruction& mcfi=MachineCodeForInstruction::get(divI); - divOpToUse = new TmpInstruction(mcfi, divOp2); + divOp1ToUse = new TmpInstruction(mcfi, divOp1); + divOp2ToUse = new TmpInstruction(mcfi, divOp2); target.getInstrInfo(). CreateSignExtensionInstructions(target, divI->getParent()->getParent(), - divOp2, divOpToUse, + divOp1, divOp1ToUse, + 8*opSize, mvec, mcfi); + target.getInstrInfo(). + CreateSignExtensionInstructions(target, + divI->getParent()->getParent(), + divOp2, divOp2ToUse, 8*opSize, mvec, mcfi); } } mvec.push_back(BuildMI(ChooseDivInstruction(target, subtreeRoot), 3) - .addReg(subtreeRoot->leftChild()->getValue()) - .addReg(divOpToUse) + .addReg(divOp1ToUse) + .addReg(divOp2ToUse) .addRegDef(divI)); break; From lattner at cs.uiuc.edu Fri Aug 1 11:14:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 11:14:02 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.h ExtractFunction.cpp Message-ID: <200308011614.LAA18345@apoc.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: BugDriver.h updated: 1.12 -> 1.13 ExtractFunction.cpp updated: 1.10 -> 1.11 --- Log message: Parameterize the performFinalCleanups a bit --- Diffs of the changes: Index: llvm/tools/bugpoint/BugDriver.h diff -u llvm/tools/bugpoint/BugDriver.h:1.12 llvm/tools/bugpoint/BugDriver.h:1.13 --- llvm/tools/bugpoint/BugDriver.h:1.12 Mon Jul 28 15:59:16 2003 +++ llvm/tools/bugpoint/BugDriver.h Fri Aug 1 11:13:49 2003 @@ -147,9 +147,10 @@ /// performFinalCleanups - This method clones the current Program and performs /// a series of cleanups intended to get rid of extra cruft on the module - /// before handing it to the user... + /// before handing it to the user... if the module parameter is specified, it + /// operates directly on the specified Module, modifying it in place. /// - Module *performFinalCleanups() const; + Module *performFinalCleanups(Module *M = 0) const; /// initializeExecutionEnvironment - This method is used to set up the /// environment for executing LLVM programs. Index: llvm/tools/bugpoint/ExtractFunction.cpp diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.10 llvm/tools/bugpoint/ExtractFunction.cpp:1.11 --- llvm/tools/bugpoint/ExtractFunction.cpp:1.10 Tue Jun 24 23:13:36 2003 +++ llvm/tools/bugpoint/ExtractFunction.cpp Fri Aug 1 11:13:49 2003 @@ -79,8 +79,8 @@ /// a series of cleanups intended to get rid of extra cruft on the module /// before handing it to the user... /// -Module *BugDriver::performFinalCleanups() const { - Module *M = CloneModule(Program); +Module *BugDriver::performFinalCleanups(Module *InM) const { + Module *M = InM ? InM : CloneModule(Program); // Allow disabling these passes if they crash bugpoint. // @@ -97,7 +97,7 @@ CleanupPasses.add(createFunctionResolvingPass()); CleanupPasses.add(createGlobalDCEPass()); CleanupPasses.add(createDeadTypeEliminationPass()); - CleanupPasses.add(createDeadArgEliminationPass(true)); + CleanupPasses.add(createDeadArgEliminationPass(InM == 0)); CleanupPasses.add(createVerifierPass()); CleanupPasses.run(*M); return M; From lattner at cs.uiuc.edu Fri Aug 1 11:15:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 11:15:01 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/CodeGeneratorBug.cpp Message-ID: <200308011614.LAA18358@apoc.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: CodeGeneratorBug.cpp updated: 1.7 -> 1.8 --- Log message: Don't emit modules with lots of cruft hanging off of them. --- Diffs of the changes: Index: llvm/tools/bugpoint/CodeGeneratorBug.cpp diff -u llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.7 llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.8 --- llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.7 Wed Jul 30 16:45:20 2003 +++ llvm/tools/bugpoint/CodeGeneratorBug.cpp Fri Aug 1 11:14:33 2003 @@ -167,6 +167,15 @@ } } + if (verifyModule(*SafeModule) || verifyModule(*TestModule)) { + std::cerr << "Bugpoint has a bug, an corrupted a module!!\n"; + abort(); + } + + // Clean up the modules, removing extra cruft that we don't need anymore... + SafeModule = BD.performFinalCleanups(SafeModule); + TestModule = BD.performFinalCleanups(TestModule); + DEBUG(std::cerr << "Safe module:\n"; typedef Module::iterator MI; typedef Module::giterator MGI; @@ -185,10 +194,7 @@ // Write out the bytecode to be sent to CBE std::string SafeModuleBC = getUniqueFilename("bugpoint.safe.bc"); - if (verifyModule(*SafeModule)) { - std::cerr << "Bytecode file corrupted!\n"; - exit(1); - } + if (BD.writeProgramToFile(SafeModuleBC, SafeModule)) { std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; exit(1); From criswell at cs.uiuc.edu Fri Aug 1 14:06:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:06:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Makefile Message-ID: <200308011905.OAA28373@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer: Makefile (r1.13) removed --- Log message: (null) --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:06:08 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:06:08 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/LLVMTrace.cpp Message-ID: <200308011905.OAA28391@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/BinInterface: LLVMTrace.cpp (r1.2) removed --- Log message: Removing Reoptimizer from this release branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:07:00 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:07:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/analyze.cpp Message-ID: <200308011906.OAA28409@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/BinInterface: analyze.cpp (r1.11) removed --- Log message: Removing reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:07:07 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:07:07 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/construct.cpp Message-ID: <200308011906.OAA28427@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/BinInterface: construct.cpp (r1.6) removed --- Log message: Removing Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:07:12 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:07:12 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/Makefile Message-ID: <200308011906.OAA28400@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/BinInterface: Makefile (r1.2) removed --- Log message: Removing Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:07:18 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:07:18 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/emit.cpp Message-ID: <200308011906.OAA28436@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/BinInterface: emit.cpp (r1.6) removed --- Log message: Removing Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:07:23 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:07:23 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/select.cpp Message-ID: <200308011906.OAA28445@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/BinInterface: select.cpp (r1.7) removed --- Log message: Removing Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:07:29 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:07:29 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/sparc9.cpp Message-ID: <200308011906.OAA28450@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/BinInterface: sparc9.cpp (r1.6) removed --- Log message: Removing Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:07:35 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:07:35 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/sparcbin.cpp Message-ID: <200308011906.OAA28459@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/BinInterface: sparcbin.cpp (r1.10) removed --- Log message: Removing Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:07:41 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:07:41 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/sparcdis.cpp Message-ID: <200308011906.OAA28472@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/BinInterface: sparcdis.cpp (r1.14) removed --- Log message: Removing Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:08:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:08:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/Makefile Message-ID: <200308011907.OAA28513@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib: Makefile (r1.4) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:08:07 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:08:07 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/PhaseInfo.h Message-ID: <200308011907.OAA28522@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib: PhaseInfo.h (r1.10) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:08:13 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:08:13 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/Phases.cpp Message-ID: <200308011907.OAA28527@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib: Phases.cpp (r1.36) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:08:18 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:08:18 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/ElfReader.cpp Message-ID: <200308011907.OAA28486@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib: ElfReader.cpp (r1.12) removed --- Log message: Removing Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:08:25 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:08:25 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/Makefile Message-ID: <200308011907.OAA28481@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst: Makefile (r1.4) removed --- Log message: Removing Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:08:31 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:08:31 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/InstManip.h Message-ID: <200308011907.OAA28500@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib: InstManip.h (r1.18) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:08:37 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:08:37 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/InstManip.cpp Message-ID: <200308011907.OAA28491@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib: InstManip.cpp (r1.13) removed --- Log message: Removing Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:09:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:09:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/design.txt Message-ID: <200308011908.OAA28555@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib: design.txt (r1.16) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:09:08 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:09:08 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/Phase1/Intraphase.h Message-ID: <200308011908.OAA28564@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib/Phase1: Intraphase.h (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:09:15 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:09:15 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/Phase1/Makefile Message-ID: <200308011908.OAA28573@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib/Phase1: Makefile (r1.2) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:09:21 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:09:21 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/Phase1/Phase1.cpp Message-ID: <200308011908.OAA28582@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib/Phase1: Phase1.cpp (r1.28) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:09:27 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:09:27 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/SparcInstManip.cpp Message-ID: <200308011908.OAA28536@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib: SparcInstManip.cpp (r1.17) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:09:35 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:09:35 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/Phase1/PrimInfo.cpp Message-ID: <200308011908.OAA28591@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib/Phase1: PrimInfo.cpp (r1.16) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:09:41 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:09:41 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/Phase1/PrimInfo.h Message-ID: <200308011908.OAA28600@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib/Phase1: PrimInfo.h (r1.11) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:09:47 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:09:47 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/Phase1/design.txt Message-ID: <200308011908.OAA28609@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib/Phase1: design.txt (r1.11) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:09:53 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:09:53 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/mkexcl/Makefile Message-ID: <200308011908.OAA28618@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/mkexcl: Makefile (r1.2) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:10:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:10:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/Makefile Message-ID: <200308011909.OAA28690@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger: Makefile (r1.2) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:10:08 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:10:08 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/mkexcl/mkexcl.cpp Message-ID: <200308011909.OAA28627@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/mkexcl: mkexcl.cpp (r1.4) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:10:14 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:10:14 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/rtl/pprtl.cpp Message-ID: <200308011909.OAA28645@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/rtl: pprtl.cpp (r1.3) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:10:21 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:10:21 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/rtl/Makefile Message-ID: <200308011909.OAA28636@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/rtl: Makefile (r1.4) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:10:28 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:10:28 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Makefile Message-ID: <200308011909.OAA28663@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/LightWtProfiling: Makefile (r1.2) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:10:35 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:10:35 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/rtl/pprtl.h Message-ID: <200308011909.OAA28654@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/rtl: pprtl.h (r1.4) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:10:41 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:10:41 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/GetTimer.h Message-ID: <200308011909.OAA28681@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger: GetTimer.h (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:10:48 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:10:48 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/FirstTrigger.cpp Message-ID: <200308011909.OAA28672@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger: FirstTrigger.cpp (r1.5) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:10:55 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:10:55 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp Message-ID: <200308011909.OAA28708@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger: SecondTrigger.cpp (r1.2) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:11:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:11:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SLI.cpp Message-ID: <200308011909.OAA28699@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger: SLI.cpp (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:11:08 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:11:08 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/scheduler.cpp Message-ID: <200308011909.OAA28726@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger: scheduler.cpp (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:11:14 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:11:14 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/Timer.cpp Message-ID: <200308011909.OAA28717@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger: Timer.cpp (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:11:21 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:11:21 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Mapping/getLLVMinfo.cpp Message-ID: <200308011909.OAA28785@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Mapping: getLLVMinfo.cpp (r1.11) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:11:27 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:11:27 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Mapping/Makefile Message-ID: <200308011909.OAA28731@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Mapping: Makefile (r1.4) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:12:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:12:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/ScratchMemory/DummyFile.cpp Message-ID: <200308011910.OAA28813@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/ScratchMemory: DummyFile.cpp (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:12:08 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:12:08 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/ScratchMemory/DummyFile2.cpp Message-ID: <200308011910.OAA28822@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/ScratchMemory: DummyFile2.cpp (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:12:16 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:12:16 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/ScratchMemory/Makefile Message-ID: <200308011910.OAA28831@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/ScratchMemory: Makefile (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:12:24 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:12:24 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp Message-ID: <200308011910.OAA28840@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/TraceCache: InstrUtils.cpp (r1.12) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:12:31 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:12:31 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/Makefile Message-ID: <200308011910.OAA28849@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/TraceCache: Makefile (r1.3) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:12:38 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:12:38 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp Message-ID: <200308011910.OAA28858@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/TraceCache: MemoryManager.cpp (r1.9) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:12:44 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:12:44 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp Message-ID: <200308011910.OAA28867@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/TraceCache: TraceCache.cpp (r1.16) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:12:50 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:12:50 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/VirtualMem.cpp Message-ID: <200308011910.OAA28876@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/TraceCache: VirtualMem.cpp (r1.11) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:12:56 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:12:56 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Trigger/GetTraceTime.cpp Message-ID: <200308011911.OAA28886@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Trigger: GetTraceTime.cpp (r1.2) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:13:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:13:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Trigger/Makefile Message-ID: <200308011911.OAA28891@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Trigger: Makefile (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:13:08 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:13:08 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Trigger/Trigger.cpp Message-ID: <200308011911.OAA28912@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Trigger: Trigger.cpp (r1.19) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:13:14 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:13:14 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Trigger/TriggerAuxillary.cpp Message-ID: <200308011911.OAA28917@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Trigger: TriggerAuxillary.cpp (r1.5) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:13:21 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:13:21 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Trigger/TriggerAuxillary.h Message-ID: <200308011911.OAA28923@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Trigger: TriggerAuxillary.h (r1.3) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:13:27 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:13:27 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Trigger/RuntimeOptimizations.cpp Message-ID: <200308011911.OAA28896@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Trigger: RuntimeOptimizations.cpp (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:14:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:14:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Makefile Message-ID: <200308011912.OAA28942@psmith.cs.uiuc.edu> Changes in directory llvm/lib: Makefile updated: 1.12 -> 1.12.4.1 --- Log message: Removed the Reoptimizer. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:15:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:15:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/SparcInstManip.h Message-ID: <200308011914.OAA28978@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib: SparcInstManip.h (r1.14) removed --- Log message: Removed the Reoptimizer from the branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 14:15:07 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:15:07 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/SSAPRE/RuntimeLICM.cpp Message-ID: <200308011914.OAA28993@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/SSAPRE: RuntimeLICM.cpp (r1.1) removed --- Log message: Removed Reoptimizer from this branch. --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Aug 1 14:17:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 14:17:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/Signals.h Message-ID: <200308011916.OAA21986@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: Signals.h updated: 1.3 -> 1.4 --- Log message: This file doesn't need this include --- Diffs of the changes: Index: llvm/include/Support/Signals.h diff -u llvm/include/Support/Signals.h:1.3 llvm/include/Support/Signals.h:1.4 --- llvm/include/Support/Signals.h:1.3 Mon Jun 30 16:58:23 2003 +++ llvm/include/Support/Signals.h Fri Aug 1 14:16:18 2003 @@ -10,11 +10,6 @@ #include -// -// This will include the signal handler return type. -// -#include "Config/config.h" - // RemoveFileOnSignal - This function registers signal handlers to ensure that // if a signal gets delivered that the named file is removed. // From lattner at cs.uiuc.edu Fri Aug 1 14:17:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 14:17:07 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Signals.cpp Message-ID: <200308011916.OAA22150@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: Signals.cpp updated: 1.6 -> 1.7 --- Log message: Move #include from a header to here --- Diffs of the changes: Index: llvm/lib/Support/Signals.cpp diff -u llvm/lib/Support/Signals.cpp:1.6 llvm/lib/Support/Signals.cpp:1.7 --- llvm/lib/Support/Signals.cpp:1.6 Mon Jun 30 16:58:48 2003 +++ llvm/lib/Support/Signals.cpp Fri Aug 1 14:16:29 2003 @@ -11,6 +11,7 @@ #include #include #include +#include "Config/config.h" // Get the signal handler return type static std::vector FilesToRemove; From lattner at cs.uiuc.edu Fri Aug 1 14:22:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 14:22:01 2003 Subject: [llvm-commits] CVS: llvm/utils/TableGen/TableGen.cpp Message-ID: <200308011921.OAA24253@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: TableGen.cpp updated: 1.13 -> 1.14 --- Log message: Make sure to delete the output file if there is an error --- Diffs of the changes: Index: llvm/utils/TableGen/TableGen.cpp diff -u llvm/utils/TableGen/TableGen.cpp:1.13 llvm/utils/TableGen/TableGen.cpp:1.14 --- llvm/utils/TableGen/TableGen.cpp:1.13 Fri Aug 1 00:59:20 2003 +++ llvm/utils/TableGen/TableGen.cpp Fri Aug 1 14:21:43 2003 @@ -431,7 +431,10 @@ } } catch (const std::string &Error) { std::cerr << Error << "\n"; - if (Out != &std::cout) delete Out; + if (Out != &std::cout) { + delete Out; // Close the file + std::remove(OutputFilename.c_str()); // Remove the file, it's broken + } return 1; } From criswell at cs.uiuc.edu Fri Aug 1 14:41:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:41:01 2003 Subject: [llvm-commits] CVS: llvm/projects/sample/Makefile Message-ID: <200308011940.OAA12431@psmith.cs.uiuc.edu> Changes in directory llvm/projects/sample: Makefile updated: 1.3 -> 1.3.2.1 --- Log message: Re-enabling. It seems to work for this pre-release branch. --- Diffs of the changes: Index: llvm/projects/sample/Makefile diff -u llvm/projects/sample/Makefile:1.3 llvm/projects/sample/Makefile:1.3.2.1 --- llvm/projects/sample/Makefile:1.3 Wed Jul 23 18:28:57 2003 +++ llvm/projects/sample/Makefile Fri Aug 1 14:40:11 2003 @@ -10,7 +10,7 @@ # # Directories that needs to be built. # -#DIRS = lib tools +DIRS = lib tools # # Include the Master Makefile that knows how to build all. From criswell at cs.uiuc.edu Fri Aug 1 14:42:00 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 14:42:00 2003 Subject: [llvm-commits] CVS: llvm/Makefile Message-ID: <200308011941.OAA12450@psmith.cs.uiuc.edu> Changes in directory llvm: Makefile updated: 1.4 -> 1.4.6.1 --- Log message: Disabled projects. There's no need to build them in a default compile. --- Diffs of the changes: Index: llvm/Makefile diff -u llvm/Makefile:1.4 llvm/Makefile:1.4.6.1 --- llvm/Makefile:1.4 Wed Jun 11 08:55:26 2003 +++ llvm/Makefile Fri Aug 1 14:41:15 2003 @@ -1,6 +1,10 @@ LEVEL = . DIRS = lib/Support utils lib tools -OPTIONAL_DIRS = projects + +# +# Insert any optional project directories here. +# +#OPTIONAL_DIRS = projects include $(LEVEL)/Makefile.common From brukman at cs.uiuc.edu Fri Aug 1 15:27:00 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Aug 1 15:27:00 2003 Subject: [llvm-commits] CVS: CVSROOT/loginfo Message-ID: <200308012026.PAA19328@zion.cs.uiuc.edu> Changes in directory CVSROOT: loginfo updated: 1.29 -> 1.30 --- Log message: Temporarily save a log of all commit messages in an attempt to track down how to get the name of the branch being committed to. --- Diffs of the changes: Index: CVSROOT/loginfo diff -u CVSROOT/loginfo:1.29 CVSROOT/loginfo:1.30 --- CVSROOT/loginfo:1.29 Tue Oct 1 18:06:18 2002 +++ CVSROOT/loginfo Fri Aug 1 15:26:20 2003 @@ -30,3 +30,5 @@ ^llvm/www ( /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/update-www.sh &); /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu ^llvm /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu ^CVSROOT /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu + +DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog From brukman at cs.uiuc.edu Fri Aug 1 15:28:00 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Aug 1 15:28:00 2003 Subject: [llvm-commits] CVS: CVSROOT/commit-diffs.pl Message-ID: <200308012027.PAA19356@zion.cs.uiuc.edu> Changes in directory CVSROOT: commit-diffs.pl updated: 1.38 -> 1.39 --- Log message: Fixed some comments, deleted some empty space. --- Diffs of the changes: Index: CVSROOT/commit-diffs.pl diff -u CVSROOT/commit-diffs.pl:1.38 CVSROOT/commit-diffs.pl:1.39 --- CVSROOT/commit-diffs.pl:1.38 Mon Jun 30 17:43:06 2003 +++ CVSROOT/commit-diffs.pl Fri Aug 1 15:27:35 2003 @@ -17,7 +17,8 @@ # Original author: Jouni Heikniemi # This script was improved by Misha & Chris: # * Hacked to work under Unix -# * ...? +# * Displays contents of new files (`cvs diff -r0 -r1.1') +# * Displays branch name in the subject line # ###################################################################### @@ -69,7 +70,6 @@ print "num changes: " .scalar(@changes) . "\n"; } - if ($changes[0] ne "-") { # Ignore " - New directory" messages for ($j=0; $j < scalar(@changes); $j++) { $changeItems[$j] = createChangeItem($changes[$j]); @@ -120,16 +120,12 @@ $msg .= "\n---\nLog message:\n\n" . join('', at logmessage); $msg .= "\n---\nDiffs of the changes:\n\n" . $diffs; - -# Send the mail. -# use mailx instead - open TEMP, ">$TEMPFILE"; print TEMP $msg; close TEMP; -# the mail sending program is called mailx on solaris, but mail on everything -# else. +# The mail sending program is called `mailx' on Solaris, but `mail' on +# everything else. if ((uname())[0] eq "SunOS") { system("mailx -s 'CVS: $subject' $target < $TEMPFILE"); } else { From lattner at cs.uiuc.edu Fri Aug 1 15:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 15:30:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/FileUtilities.h Message-ID: <200308012029.PAA26784@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: FileUtilities.h added (r1.1) --- Log message: New file --- Diffs of the changes: Index: llvm/include/Support/FileUtilities.h diff -c /dev/null llvm/include/Support/FileUtilities.h:1.1 *** /dev/null Fri Aug 1 15:29:06 2003 --- llvm/include/Support/FileUtilities.h Fri Aug 1 15:28:55 2003 *************** *** 0 **** --- 1,29 ---- + //===- Support/FileUtilities.h - File System Utilities ----------*- C++ -*-===// + // + // This file defines a family of utility functions which are useful for doing + // various things with files. + // + //===----------------------------------------------------------------------===// + + #ifndef SUPPORT_FILEUTILITIES_H + #define SUPPORT_FILEUTILITIES_H + + #include + + /// DiffFiles - Compare the two files specified, returning true if they are + /// different or if there is a file error. If you specify a string to fill in + /// for the error option, it will set the string to an error message if an error + /// occurs, allowing the caller to distinguish between a failed diff and a file + /// system error. + /// + bool DiffFiles(const std::string &FileA, const std::string &FileB, + std::string *Error = 0); + + + /// MoveFileOverIfUpdated - If the file specified by New is different than Old, + /// or if Old does not exist, move the New file over the Old file. Otherwise, + /// remove the New file. + /// + void MoveFileOverIfUpdated(const std::string &New, const std::string &Old); + + #endif From lattner at cs.uiuc.edu Fri Aug 1 15:30:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 15:30:08 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExecutionDriver.cpp Message-ID: <200308012029.PAA26803@apoc.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExecutionDriver.cpp updated: 1.12 -> 1.13 --- Log message: Use the new FileUtilities library to do diff'ing of files --- Diffs of the changes: Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.12 llvm/tools/bugpoint/ExecutionDriver.cpp:1.13 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.12 Wed Jul 30 15:15:44 2003 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Fri Aug 1 15:29:45 2003 @@ -18,6 +18,7 @@ #include "SystemUtils.h" #include "Support/CommandLine.h" #include "Support/Statistic.h" +#include "Support/FileUtilities.h" #include #include @@ -583,30 +584,16 @@ // Execute the program, generating an output file... std::string Output = executeProgram("", BytecodeFile, SharedObject); - std::ifstream ReferenceFile(ReferenceOutputFile.c_str()); - if (!ReferenceFile) { - std::cerr << "Couldn't open reference output file '" - << ReferenceOutputFile << "'\n"; - exit(1); - } - - std::ifstream OutputFile(Output.c_str()); - if (!OutputFile) { - std::cerr << "Couldn't open output file: " << Output << "'!\n"; - exit(1); - } - + std::string Error; bool FilesDifferent = false; + if (DiffFiles(ReferenceOutputFile, Output, &Error)) { + if (!Error.empty()) { + std::cerr << "While diffing output: " << Error << "\n"; + exit(1); + } + FilesDifferent = true; + } - // Compare the two files... - int C1, C2; - do { - C1 = ReferenceFile.get(); - C2 = OutputFile.get(); - if (C1 != C2) { FilesDifferent = true; break; } - } while (C1 != EOF); - - //removeFile(Output); if (RemoveBytecode) removeFile(BytecodeFile); return FilesDifferent; } From lattner at cs.uiuc.edu Fri Aug 1 15:30:15 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 15:30:15 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/SystemUtils.cpp Message-ID: <200308012029.PAA26808@apoc.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: SystemUtils.cpp updated: 1.8 -> 1.9 --- Log message: Use the C++, more portable, deleter --- Diffs of the changes: Index: llvm/tools/bugpoint/SystemUtils.cpp diff -u llvm/tools/bugpoint/SystemUtils.cpp:1.8 llvm/tools/bugpoint/SystemUtils.cpp:1.9 --- llvm/tools/bugpoint/SystemUtils.cpp:1.8 Mon Jul 14 12:16:01 2003 +++ llvm/tools/bugpoint/SystemUtils.cpp Fri Aug 1 15:29:18 2003 @@ -20,7 +20,7 @@ /// removeFile - Delete the specified file /// void removeFile(const std::string &Filename) { - unlink(Filename.c_str()); + std::remove(Filename.c_str()); } /// getUniqueFilename - Return a filename with the specified prefix. If the From brukman at cs.uiuc.edu Fri Aug 1 15:31:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Aug 1 15:31:01 2003 Subject: [llvm-commits] CVS: CVSROOT/loginfo Message-ID: <200308012030.PAA19428@zion.cs.uiuc.edu> Changes in directory CVSROOT: loginfo updated: 1.30 -> 1.31 --- Log message: Instead of DEFAULT, ALL should be used to also be executed. --- Diffs of the changes: Index: CVSROOT/loginfo diff -u CVSROOT/loginfo:1.30 CVSROOT/loginfo:1.31 --- CVSROOT/loginfo:1.30 Fri Aug 1 15:26:20 2003 +++ CVSROOT/loginfo Fri Aug 1 15:30:32 2003 @@ -31,4 +31,4 @@ ^llvm /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu ^CVSROOT /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu -DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog +ALL (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog From brukman at cs.uiuc.edu Fri Aug 1 15:33:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Aug 1 15:33:01 2003 Subject: [llvm-commits] CVS: CVSROOT/commit-diffs.pl Message-ID: <200308012032.PAA19468@zion.cs.uiuc.edu> Changes in directory CVSROOT: commit-diffs.pl updated: 1.39 -> 1.40 --- Log message: Comming a minor comment fix-up, testing the commitlog functionality. --- Diffs of the changes: Index: CVSROOT/commit-diffs.pl diff -u CVSROOT/commit-diffs.pl:1.39 CVSROOT/commit-diffs.pl:1.40 --- CVSROOT/commit-diffs.pl:1.39 Fri Aug 1 15:27:35 2003 +++ CVSROOT/commit-diffs.pl Fri Aug 1 15:32:32 2003 @@ -58,7 +58,7 @@ } } -# Find out who did the changes and who shall we mail to. +# Find out who we shall send mail to my $target = $ARGV[1] || $DEFAULT_ADMIN; # Manipulate the CVS's change info; see docs for further information. From lattner at cs.uiuc.edu Fri Aug 1 15:36:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 15:36:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/Makefile Message-ID: <200308012035.PAA27087@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: Makefile updated: 1.27 -> 1.28 --- Log message: Remove makefile complexity by always running tablegen with its final output directory. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/Makefile diff -u llvm/lib/Target/Sparc/Makefile:1.27 llvm/lib/Target/Sparc/Makefile:1.28 --- llvm/lib/Target/Sparc/Makefile:1.27 Wed Jul 30 16:00:37 2003 +++ llvm/lib/Target/Sparc/Makefile Fri Aug 1 15:34:56 2003 @@ -48,13 +48,8 @@ TABLEGEN_FILES := $(wildcard *.td) -$(TARGET_NAME)CodeEmitter.inc.tmp: $(TABLEGEN_FILES) $(TBLGEN) - @${ECHO} "TableGen-erating " $(TARGET_NAME) +$(TARGET_NAME)CodeEmitter.inc: $(TABLEGEN_FILES) $(TBLGEN) $(TBLGEN) $(TARGET_NAME).td -gen-emitter -o $@ -$(TARGET_NAME)CodeEmitter.inc: $(TARGET_NAME)CodeEmitter.inc.tmp - $(VERB) # Only copy over the real .inc file if it has changed! - $(VERB) diff $@ $< > /dev/null || cp $< $@ - clean:: - ${RM} -f $(TARGET_NAME)CodeEmitter.inc $(TARGET_NAME)CodeEmitter.inc.tmp + ${RM} -f $(TARGET_NAME)CodeEmitter.inc From lattner at cs.uiuc.edu Fri Aug 1 15:36:09 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 15:36:09 2003 Subject: [llvm-commits] CVS: llvm/utils/TableGen/TableGen.cpp Message-ID: <200308012035.PAA27094@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: TableGen.cpp updated: 1.14 -> 1.15 --- Log message: Tablegen should only replace the output if it changes --- Diffs of the changes: Index: llvm/utils/TableGen/TableGen.cpp diff -u llvm/utils/TableGen/TableGen.cpp:1.14 llvm/utils/TableGen/TableGen.cpp:1.15 --- llvm/utils/TableGen/TableGen.cpp:1.14 Fri Aug 1 14:21:43 2003 +++ llvm/utils/TableGen/TableGen.cpp Fri Aug 1 15:35:01 2003 @@ -11,6 +11,7 @@ #include "Record.h" #include "Support/CommandLine.h" #include "Support/Signals.h" +#include "Support/FileUtilities.h" #include "CodeEmitterGen.h" #include "RegisterInfoEmitter.h" #include @@ -391,15 +392,18 @@ std::ostream *Out = &std::cout; if (OutputFilename != "-") { - Out = new std::ofstream(OutputFilename.c_str()); + // Output to a .tmp file, because we don't actually want to overwrite the + // output file unless the generated file is different or the specified file + // does not exist. + Out = new std::ofstream((OutputFilename+".tmp").c_str()); if (!Out->good()) { - std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; + std::cerr << argv[0] << ": error opening " << OutputFilename << ".tmp!\n"; return 1; } // Make sure the file gets removed if *gasp* tablegen crashes... - RemoveFileOnSignal(OutputFilename); + RemoveFileOnSignal(OutputFilename+".tmp"); } try { @@ -438,6 +442,16 @@ return 1; } - if (Out != &std::cout) delete Out; + if (Out != &std::cout) { + delete Out; // Close the file + + // Now that we have generated the result, check to see if we either don't + // have the requested file, or if the requested file is different than the + // file we generated. If so, move the generated file over the requested + // file. Otherwise, just remove the file we just generated, so 'make' + // doesn't try to regenerate tons of dependencies. + // + MoveFileOverIfUpdated(OutputFilename+".tmp", OutputFilename); + } return 0; } From criswell at cs.uiuc.edu Fri Aug 1 15:38:00 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 15:38:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/PoolAllocate.cpp Message-ID: <200308012037.PAA13918@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: PoolAllocate.cpp (r1.11) removed --- Log message: Removing Pool Allocation from this branch. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Aug 1 15:40:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Aug 1 15:40:01 2003 Subject: [llvm-commits] CVS: llvm/autoconf/aclocal.m4 Message-ID: <200308012039.PAA14127@psmith.cs.uiuc.edu> Changes in directory llvm/autoconf: aclocal.m4 updated: 1.3 -> 1.3.2.1 --- Log message: CVS Test. --- Diffs of the changes: Index: llvm/autoconf/aclocal.m4 diff -u llvm/autoconf/aclocal.m4:1.3 llvm/autoconf/aclocal.m4:1.3.2.1 --- llvm/autoconf/aclocal.m4:1.3 Tue Jul 29 14:11:50 2003 +++ llvm/autoconf/aclocal.m4 Fri Aug 1 15:39:46 2003 @@ -6139,6 +6139,8 @@ # Check for anonymous mmap macros. This is modified from # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html # +# Adding extra comment for CVS tests. +# AC_DEFUN([AC_HEADER_MMAP_ANONYMOUS], [AC_CACHE_CHECK(for MAP_ANONYMOUS vs. MAP_ANON, ac_cv_header_mmap_anon, From brukman at cs.uiuc.edu Fri Aug 1 16:07:05 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Aug 1 16:07:05 2003 Subject: [llvm-commits] CVS: CVSROOT/commit-diffs.pl Message-ID: <200308012106.QAA19560@zion.cs.uiuc.edu> Changes in directory CVSROOT: commit-diffs.pl updated: 1.40 -> 1.41 --- Log message: Display the branch name in the email subject line. --- Diffs of the changes: Index: CVSROOT/commit-diffs.pl diff -u CVSROOT/commit-diffs.pl:1.40 CVSROOT/commit-diffs.pl:1.41 --- CVSROOT/commit-diffs.pl:1.40 Fri Aug 1 15:32:32 2003 +++ CVSROOT/commit-diffs.pl Fri Aug 1 16:05:55 2003 @@ -76,16 +76,15 @@ } } -if ($DEBUG) { - print "changedir: $changedir\n"; -} +print "changedir: $changedir\n" if $DEBUG; my @loginfodata = ; #print "loginfo: ". join("\n--\n", @loginfodata) if $DEBUG; -# Pick up the committer's log message from the loginfo we received +# Pick up the committer's log message and branch from the loginfo we received my @logmessage; my $islogmessage = 0; +my $branch = ""; foreach $s (@loginfodata) { if ($islogmessage) { @@ -96,6 +95,9 @@ if ($s =~ /^Log Message:/) { $islogmessage = 1; next; + } else if ($s =~ /^.+Tag:/) { + $branch = $s; + $branch =~ s/^.+Tag: (\s+)/$1/; } } @@ -103,10 +105,10 @@ my $msg = "\n\nChanges in directory $changedir:\n\n"; my $diffs = ""; -my $subject = "$changedir/"; +my $filePath = "$changedir/"; foreach $m (@changeItems) { - $subject .= "$m->{'filename'} "; + $filePath .= "$m->{'filename'} "; if ($m->{'type'} eq 'add') { $msg .= "$m->{'filename'} added (r$m->{'newrev'})\n"; $diffs .= `cvs -Qf rdiff -r0 -r$m->{'newrev'} $changedir/$m->{'filename'} 2> /dev/null` . "\n\n"; @@ -124,11 +126,18 @@ print TEMP $msg; close TEMP; +# Include the branch, if applicable, into the subject line of the email +my $emailSubject = ""; +if ($branch ne "") { + $emailSubject = "[$branch]"; +} +$emailSubject .= " CVS: $filePath"; + # The mail sending program is called `mailx' on Solaris, but `mail' on # everything else. if ((uname())[0] eq "SunOS") { - system("mailx -s 'CVS: $subject' $target < $TEMPFILE"); + system("mailx -s '$emailSubject' $target < $TEMPFILE"); } else { - system("mail -s 'CVS: $subject' $target < $TEMPFILE"); + system("mail -s '$emailSubject' $target < $TEMPFILE"); } unlink "$TEMPFILE"; From brukman at cs.uiuc.edu Fri Aug 1 16:14:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Aug 1 16:14:01 2003 Subject: [llvm-commits] [ Tag: prerelease-11 Message-ID: <200308012113.QAA19748@zion.cs.uiuc.edu> ] CVS: llvm/autoconf/aclocal.m4 Changes in directory llvm/autoconf: aclocal.m4 updated: 1.3.2.2 -> 1.3.2.3 --- Log message: Testing branch displaying in email in the commit script. --- Diffs of the changes: Index: llvm/autoconf/aclocal.m4 diff -u llvm/autoconf/aclocal.m4:1.3.2.2 llvm/autoconf/aclocal.m4:1.3.2.3 --- llvm/autoconf/aclocal.m4:1.3.2.2 Fri Aug 1 16:10:33 2003 +++ llvm/autoconf/aclocal.m4 Fri Aug 1 16:13:35 2003 @@ -6139,6 +6139,7 @@ # Check for anonymous mmap macros. This is modified from # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html # +# AC_DEFUN([AC_HEADER_MMAP_ANONYMOUS], [AC_CACHE_CHECK(for MAP_ANONYMOUS vs. MAP_ANON, ac_cv_header_mmap_anon, From lattner at cs.uiuc.edu Fri Aug 1 16:17:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 16:17:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200308012116.QAA10058@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp added (r1.1) --- Log message: Check in the implementation of the FileUtilities! --- Diffs of the changes: Index: llvm/lib/Support/FileUtilities.cpp diff -c /dev/null llvm/lib/Support/FileUtilities.cpp:1.1 *** /dev/null Fri Aug 1 16:16:26 2003 --- llvm/lib/Support/FileUtilities.cpp Fri Aug 1 16:16:14 2003 *************** *** 0 **** --- 1,56 ---- + //===- Support/FileUtilities.cpp - File System Utilities ------------------===// + // + // This file implements a family of utility functions which are useful for doing + // various things with files. + // + //===----------------------------------------------------------------------===// + + #include "Support/FileUtilities.h" + #include + #include + #include + + /// DiffFiles - Compare the two files specified, returning true if they are + /// different or if there is a file error. If you specify a string to fill in + /// for the error option, it will set the string to an error message if an error + /// occurs, allowing the caller to distinguish between a failed diff and a file + /// system error. + /// + bool DiffFiles(const std::string &FileA, const std::string &FileB, + std::string *Error) { + std::ifstream FileAStream(FileA.c_str()); + if (!FileAStream) { + if (Error) *Error = "Couldn't open file '" + FileA + "'"; + return true; + } + + std::ifstream FileBStream(FileB.c_str()); + if (!FileBStream) { + if (Error) *Error = "Couldn't open file '" + FileB + "'"; + return true; + } + + // Compare the two files... + int C1, C2; + do { + C1 = FileAStream.get(); + C2 = FileBStream.get(); + if (C1 != C2) return true; + } while (C1 != EOF); + + return false; + } + + + /// MoveFileOverIfUpdated - If the file specified by New is different than Old, + /// or if Old does not exist, move the New file over the Old file. Otherwise, + /// remove the New file. + /// + void MoveFileOverIfUpdated(const std::string &New, const std::string &Old) { + if (DiffFiles(New, Old)) { + if (std::rename(New.c_str(), Old.c_str())) + std::cerr << "Error renaming '" << New << "' to '" << Old << "'!\n"; + } else { + std::remove(New.c_str()); + } + } From brukman at cs.uiuc.edu Fri Aug 1 16:18:00 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Aug 1 16:18:00 2003 Subject: [llvm-commits] CVS: CVSROOT/commit-diffs.pl Message-ID: <200308012117.QAA19797@zion.cs.uiuc.edu> Changes in directory CVSROOT: commit-diffs.pl updated: 1.42 -> 1.43 --- Log message: Improve branch display: remove end-of-line marker, empty space, the word "Tag". --- Diffs of the changes: Index: CVSROOT/commit-diffs.pl diff -u CVSROOT/commit-diffs.pl:1.42 CVSROOT/commit-diffs.pl:1.43 --- CVSROOT/commit-diffs.pl:1.42 Fri Aug 1 16:12:04 2003 +++ CVSROOT/commit-diffs.pl Fri Aug 1 16:17:10 2003 @@ -95,9 +95,10 @@ if ($s =~ /^Log Message:/) { $islogmessage = 1; next; - } elsif ($s =~ m/^.+Tag:/) { + } elsif ($s =~ m/^\s+Tag:/) { $branch = $s; - $branch =~ s/^.+Tag: (\s+)/$1/; + chop $branch; + $branch =~ s/^\s+Tag:\s([^\s]+).*/$1/; } } From brukman at cs.uiuc.edu Fri Aug 1 16:18:07 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Aug 1 16:18:07 2003 Subject: [llvm-commits] [prerelease-11] CVS: llvm/autoconf/aclocal.m4 Message-ID: <200308012117.QAA19826@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: aclocal.m4 updated: 1.3.2.3 -> 1.3.2.4 --- Log message: Refining the output of the branch name in CVS commit script. --- Diffs of the changes: Index: llvm/autoconf/aclocal.m4 diff -u llvm/autoconf/aclocal.m4:1.3.2.3 llvm/autoconf/aclocal.m4:1.3.2.4 --- llvm/autoconf/aclocal.m4:1.3.2.3 Fri Aug 1 16:13:35 2003 +++ llvm/autoconf/aclocal.m4 Fri Aug 1 16:17:43 2003 @@ -6139,7 +6139,6 @@ # Check for anonymous mmap macros. This is modified from # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html # -# AC_DEFUN([AC_HEADER_MMAP_ANONYMOUS], [AC_CACHE_CHECK(for MAP_ANONYMOUS vs. MAP_ANON, ac_cv_header_mmap_anon, From lattner at cs.uiuc.edu Fri Aug 1 16:31:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 16:31:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/CommandLine.html Message-ID: <200308012130.QAA28996@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: CommandLine.html updated: 1.11 -> 1.12 --- Log message: Fix <>'s in HTML --- Diffs of the changes: Index: llvm/www/docs/CommandLine.html diff -u llvm/www/docs/CommandLine.html:1.11 llvm/www/docs/CommandLine.html:1.12 --- llvm/www/docs/CommandLine.html:1.11 Mon Jul 14 12:20:40 2003 +++ llvm/www/docs/CommandLine.html Fri Aug 1 16:30:37 2003 @@ -877,7 +877,7 @@
 bool DebugFlag;      // the actual value
-static cl::opt       // The parser
+static cl::opt<bool, true>       // The parser
 Debug("debug", cl::desc("Enable debug output"), cl::Hidden,
       cl::location(DebugFlag));
 
@@ -1496,7 +1496,7 @@
Chris Lattner
-Last modified: Mon Jul 14 12:12:15 CDT 2003 +Last modified: Fri Aug 1 16:30:11 CDT 2003 From lattner at cs.uiuc.edu Fri Aug 1 17:13:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:13:00 2003 Subject: [llvm-commits] CVS: llvm/include/Support/TarjanSCCIterator.h Message-ID: <200308012212.RAA23829@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: TarjanSCCIterator.h updated: 1.8 -> 1.9 --- Log message: Including statistics into an anonymous namespace that gets #included into every file is a bad idea. --- Diffs of the changes: Index: llvm/include/Support/TarjanSCCIterator.h diff -u llvm/include/Support/TarjanSCCIterator.h:1.8 llvm/include/Support/TarjanSCCIterator.h:1.9 --- llvm/include/Support/TarjanSCCIterator.h:1.8 Mon Jun 30 16:58:23 2003 +++ llvm/include/Support/TarjanSCCIterator.h Fri Aug 1 17:12:07 2003 @@ -16,7 +16,7 @@ #define SUPPORT_TARJANSCCITERATOR_H #include "Support/GraphTraits.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include "Support/iterator" #include #include @@ -56,11 +56,6 @@ // reverse topological order of the SCC DAG. //-------------------------------------------------------------------------- -namespace { - Statistic<> NumSCCs("NumSCCs", "Number of Strongly Connected Components"); - Statistic<> MaxSCCSize("MaxSCCSize", "Size of largest Strongly Connected Component"); -} - template > class TarjanSCC_iterator : public forward_iterator, ptrdiff_t> { @@ -152,10 +147,6 @@ SCCNodeStack.pop(); nodeVisitNumbers[CurrentSCC.back()] = ~0UL; } while (CurrentSCC.back() != visitingN); - - ++NumSCCs; - if (CurrentSCC.size() > MaxSCCSize) MaxSCCSize = CurrentSCC.size(); - return; } } From lattner at cs.uiuc.edu Fri Aug 1 17:13:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:13:08 2003 Subject: [llvm-commits] CVS: llvm/include/Support/Debug.h Statistic.h Message-ID: <200308012212.RAA23849@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: Debug.h added (r1.1) Statistic.h updated: 1.5 -> 1.6 --- Log message: Move debugging support out of Statistic.h into Debug.h, implement the new DEBUG_TYPE facilities --- Diffs of the changes: Index: llvm/include/Support/Debug.h diff -c /dev/null llvm/include/Support/Debug.h:1.1 *** /dev/null Fri Aug 1 17:12:50 2003 --- llvm/include/Support/Debug.h Fri Aug 1 17:12:40 2003 *************** *** 0 **** --- 1,53 ---- + //===- Debug.h - An easy way to add debug output to your code ---*- C++ -*-===// + // + // This file implements a handle way of adding debugging information to your + // code, without it being enabled all of the time, and without having to add + // command line options to enable it. + // + // In particular, just wrap your code with the DEBUG() macro, and it will be + // enabled automatically if you specify '-debug' on the command-line. + // Alternatively, you can also use the SET_DEBUG_TYPE("foo") macro to specify + // that your debug code belongs to class "foo". Then, on the command line, you + // can specify '-debug-only=foo' to enable JUST the debug information for the + // foo class. + // + // When compiling in release mode, the -debug-* options and all code in DEBUG() + // statements disappears, so it does not effect the runtime of the code. + // + //===----------------------------------------------------------------------===// + + #ifndef SUPPORT_DEBUG_H + #define SUPPORT_DEBUG_H + + // DebugFlag - This boolean is set to true if the '-debug' command line option + // is specified. This should probably not be referenced directly, instead, use + // the DEBUG macro below. + // + extern bool DebugFlag; + + // isCurrentDebugType - Return true if the specified string is the debug type + // specified on the command line, or if none was specified on the command line + // with the -debug-only=X option. + // + bool isCurrentDebugType(const char *Type); + + // DEBUG macro - This macro should be used by passes to emit debug information. + // In the '-debug' option is specified on the commandline, and if this is a + // debug build, then the code specified as the option to the macro will be + // executed. Otherwise it will not be. Example: + // + // DEBUG(cerr << "Bitset contains: " << Bitset << "\n"); + // + + #ifndef DEBUG_TYPE + #define DEBUG_TYPE "" + #endif + + #ifdef NDEBUG + #define DEBUG(X) + #else + #define DEBUG(X) \ + do { if (DebugFlag && isCurrentDebugType(DEBUG_TYPE)) { X; } } while (0) + #endif + + #endif Index: llvm/include/Support/Statistic.h diff -u llvm/include/Support/Statistic.h:1.5 llvm/include/Support/Statistic.h:1.6 --- llvm/include/Support/Statistic.h:1.5 Wed Oct 30 20:50:27 2002 +++ llvm/include/Support/Statistic.h Fri Aug 1 17:12:40 2003 @@ -19,27 +19,6 @@ #include -// DebugFlag - This boolean is set to true if the '-debug' command line option -// is specified. This should probably not be referenced directly, instead, use -// the DEBUG macro below. -// -extern bool DebugFlag; - -// DEBUG macro - This macro should be used by passes to emit debug information. -// In the '-debug' option is specified on the commandline, and if this is a -// debug build, then the code specified as the option to the macro will be -// executed. Otherwise it will not be. Example: -// -// DEBUG(cerr << "Bitset contains: " << Bitset << "\n"); -// -#ifdef NDEBUG -#define DEBUG(X) -#else -#define DEBUG(X) \ - do { if (DebugFlag) { X; } } while (0) -#endif - - // StatisticBase - Nontemplated base class for Statistic<> class... class StatisticBase { const char *Name; From lattner at cs.uiuc.edu Fri Aug 1 17:14:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:14:01 2003 Subject: [llvm-commits] CVS: llvm/utils/TableGen/CodeEmitterGen.cpp Message-ID: <200308012213.RAA23869@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: CodeEmitterGen.cpp updated: 1.20 -> 1.21 --- Log message: DEBUG got moved to Debug.h --- Diffs of the changes: Index: llvm/utils/TableGen/CodeEmitterGen.cpp diff -u llvm/utils/TableGen/CodeEmitterGen.cpp:1.20 llvm/utils/TableGen/CodeEmitterGen.cpp:1.21 --- llvm/utils/TableGen/CodeEmitterGen.cpp:1.20 Thu Jul 31 23:46:24 2003 +++ llvm/utils/TableGen/CodeEmitterGen.cpp Fri Aug 1 17:13:14 2003 @@ -6,7 +6,7 @@ #include "CodeEmitterGen.h" #include "Record.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" void CodeEmitterGen::run(std::ostream &o) { std::vector Insts = Records.getAllDerivedDefinitions("Instruction"); From lattner at cs.uiuc.edu Fri Aug 1 17:15:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:15:00 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/ExecutionEngine.cpp Message-ID: <200308012214.RAA23910@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli: ExecutionEngine.cpp updated: 1.16 -> 1.17 --- Log message: DEBUG got moved to Debug.h --- Diffs of the changes: Index: llvm/tools/lli/ExecutionEngine.cpp diff -u llvm/tools/lli/ExecutionEngine.cpp:1.16 llvm/tools/lli/ExecutionEngine.cpp:1.17 --- llvm/tools/lli/ExecutionEngine.cpp:1.16 Fri Jul 18 13:33:38 2003 +++ llvm/tools/lli/ExecutionEngine.cpp Fri Aug 1 17:13:57 2003 @@ -11,6 +11,7 @@ #include "llvm/Constants.h" #include "llvm/Module.h" #include "llvm/Target/TargetData.h" +#include "Support/Debug.h" #include "Support/Statistic.h" #include "Config/dlfcn.h" @@ -295,13 +296,11 @@ } } - - void *ExecutionEngine::CreateArgv(const std::vector &InputArgv) { if (getTargetData().getPointerSize() == 8) { // 64 bit target? PointerTy *Result = new PointerTy[InputArgv.size()+1]; DEBUG(std::cerr << "ARGV = " << (void*)Result << "\n"); - + for (unsigned i = 0; i < InputArgv.size(); ++i) { unsigned Size = InputArgv[i].size()+1; char *Dest = new char[Size]; From lattner at cs.uiuc.edu Fri Aug 1 17:15:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:15:07 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/JIT/Emitter.cpp Message-ID: <200308012214.RAA23903@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli/JIT: Emitter.cpp updated: 1.20 -> 1.21 --- Log message: DEBUG got moved to Debug.h --- Diffs of the changes: Index: llvm/tools/lli/JIT/Emitter.cpp diff -u llvm/tools/lli/JIT/Emitter.cpp:1.20 llvm/tools/lli/JIT/Emitter.cpp:1.21 --- llvm/tools/lli/JIT/Emitter.cpp:1.20 Tue Jul 29 11:57:16 2003 +++ llvm/tools/lli/JIT/Emitter.cpp Fri Aug 1 17:13:56 2003 @@ -12,6 +12,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/Target/TargetData.h" #include "llvm/Module.h" +#include "Support/Debug.h" #include "Support/Statistic.h" #include From lattner at cs.uiuc.edu Fri Aug 1 17:15:14 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:15:14 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/CodeGeneratorBug.cpp ExecutionDriver.cpp Message-ID: <200308012214.RAA23919@apoc.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: CodeGeneratorBug.cpp updated: 1.8 -> 1.9 ExecutionDriver.cpp updated: 1.13 -> 1.14 --- Log message: DEBUG got moved to Debug.h --- Diffs of the changes: Index: llvm/tools/bugpoint/CodeGeneratorBug.cpp diff -u llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.8 llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.9 --- llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.8 Fri Aug 1 11:14:33 2003 +++ llvm/tools/bugpoint/CodeGeneratorBug.cpp Fri Aug 1 17:13:58 2003 @@ -21,7 +21,7 @@ #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Linker.h" #include "Support/CommandLine.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include "Support/StringExtras.h" #include #include Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.13 llvm/tools/bugpoint/ExecutionDriver.cpp:1.14 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.13 Fri Aug 1 15:29:45 2003 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Fri Aug 1 17:13:59 2003 @@ -17,7 +17,7 @@ #include "BugDriver.h" #include "SystemUtils.h" #include "Support/CommandLine.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include "Support/FileUtilities.h" #include #include From lattner at cs.uiuc.edu Fri Aug 1 17:15:21 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:15:21 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/InductionVariable.cpp Message-ID: <200308012214.RAA23948@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: InductionVariable.cpp updated: 1.23 -> 1.24 --- Log message: DEBUG got moved to Support/Debug.h --- Diffs of the changes: Index: llvm/lib/Analysis/InductionVariable.cpp diff -u llvm/lib/Analysis/InductionVariable.cpp:1.23 llvm/lib/Analysis/InductionVariable.cpp:1.24 --- llvm/lib/Analysis/InductionVariable.cpp:1.23 Wed Jul 23 10:17:01 2003 +++ llvm/lib/Analysis/InductionVariable.cpp Fri Aug 1 17:14:27 2003 @@ -27,7 +27,7 @@ #include "llvm/Constants.h" #include "llvm/Support/CFG.h" #include "llvm/Assembly/Writer.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" static bool isLoopInvariant(const Value *V, const Loop *L) { if (isa(V) || isa(V) || isa(V)) From lattner at cs.uiuc.edu Fri Aug 1 17:15:27 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:15:27 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp DataStructure.cpp Local.cpp Steensgaard.cpp TopDownClosure.cpp Message-ID: <200308012214.RAA23963@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: BottomUpClosure.cpp updated: 1.62 -> 1.63 DataStructure.cpp updated: 1.116 -> 1.117 Local.cpp updated: 1.59 -> 1.60 Steensgaard.cpp updated: 1.30 -> 1.31 TopDownClosure.cpp updated: 1.52 -> 1.53 --- Log message: DEBUG got moved to Support/Debug.h --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.62 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.63 --- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.62 Wed Jul 16 16:42:03 2003 +++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Fri Aug 1 17:14:28 2003 @@ -10,6 +10,7 @@ #include "llvm/Analysis/DataStructure.h" #include "llvm/Module.h" #include "Support/Statistic.h" +#include "Support/Debug.h" #include "DSCallSiteIterator.h" namespace { Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.116 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.117 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.116 Tue Jul 22 07:08:58 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Fri Aug 1 17:14:28 2003 @@ -10,6 +10,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Target/TargetData.h" #include "llvm/Assembly/Writer.h" +#include "Support/Debug.h" #include "Support/STLExtras.h" #include "Support/Statistic.h" #include "Support/Timer.h" Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.59 llvm/lib/Analysis/DataStructure/Local.cpp:1.60 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.59 Wed Jul 2 01:06:34 2003 +++ llvm/lib/Analysis/DataStructure/Local.cpp Fri Aug 1 17:14:28 2003 @@ -17,9 +17,9 @@ #include "llvm/GlobalVariable.h" #include "llvm/Support/InstVisitor.h" #include "llvm/Target/TargetData.h" -#include "Support/Statistic.h" -#include "Support/Timer.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Timer.h" // FIXME: This should eventually be a FunctionPass that is automatically // aggregated into a Pass. Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.30 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.31 --- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.30 Sun Jun 29 22:36:09 2003 +++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Fri Aug 1 17:14:28 2003 @@ -11,7 +11,7 @@ #include "llvm/Analysis/DSGraph.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Module.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" namespace { class Steens : public Pass, public AliasAnalysis { Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.52 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.53 --- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.52 Wed Jul 16 16:40:28 2003 +++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Fri Aug 1 17:14:28 2003 @@ -10,6 +10,7 @@ #include "llvm/Analysis/DataStructure.h" #include "llvm/Module.h" #include "llvm/DerivedTypes.h" +#include "Support/Debug.h" #include "Support/Statistic.h" #include "DSCallSiteIterator.h" From lattner at cs.uiuc.edu Fri Aug 1 17:16:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:16:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200308012215.RAA24080@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.23 -> 1.24 --- Log message: Describe the value name --- Diffs of the changes: Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.23 llvm/lib/Support/Timer.cpp:1.24 --- llvm/lib/Support/Timer.cpp:1.23 Thu Jul 31 14:38:34 2003 +++ llvm/lib/Support/Timer.cpp Fri Aug 1 17:15:15 2003 @@ -39,7 +39,7 @@ #endif cl::opt - InfoOutputFilename("info-output-file", + InfoOutputFilename("info-output-file", cl::value_desc("filename"), cl::desc("File to append -stats and -timer output to"), cl::Hidden, cl::location(getLibSupportInfoOutputFilename())); } From lattner at cs.uiuc.edu Fri Aug 1 17:16:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:16:08 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Debug.cpp Statistic.cpp Message-ID: <200308012215.RAA24102@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: Debug.cpp added (r1.1) Statistic.cpp updated: 1.8 -> 1.9 --- Log message: Move debug functionality to Debug.cpp/Debug.h --- Diffs of the changes: Index: llvm/lib/Support/Debug.cpp diff -c /dev/null llvm/lib/Support/Debug.cpp:1.1 *** /dev/null Fri Aug 1 17:15:51 2003 --- llvm/lib/Support/Debug.cpp Fri Aug 1 17:15:41 2003 *************** *** 0 **** --- 1,53 ---- + //===-- Debug.cpp - An easy way to add debug output to your code ----------===// + // + // This file implements a handle way of adding debugging information to your + // code, without it being enabled all of the time, and without having to add + // command line options to enable it. + // + // In particular, just wrap your code with the DEBUG() macro, and it will be + // enabled automatically if you specify '-debug' on the command-line. + // Alternatively, you can also use the SET_DEBUG_TYPE("foo") macro to specify + // that your debug code belongs to class "foo". Then, on the command line, you + // can specify '-debug-only=foo' to enable JUST the debug information for the + // foo class. + // + // When compiling in release mode, the -debug-* options and all code in DEBUG() + // statements disappears, so it does not effect the runtime of the code. + // + //===----------------------------------------------------------------------===// + + #include "Support/Statistic.h" + #include "Support/CommandLine.h" + + bool DebugFlag; // DebugFlag - Exported boolean set by the -debug option + + namespace { + #ifndef NDEBUG + // -debug - Command line option to enable the DEBUG statements in the passes. + // This flag may only be enabled in debug builds. + cl::opt + Debug("debug", cl::desc("Enable debug output"), cl::Hidden, + cl::location(DebugFlag)); + + std::string CurrentDebugType; + struct DebugOnlyOpt { + void operator=(const std::string &Val) const { + DebugFlag |= !Val.empty(); + CurrentDebugType = Val; + } + } DebugOnlyOptLoc; + + cl::opt > + DebugOnly("debug-only", cl::desc("Enable a specific type of debug output"), + cl::Hidden, cl::value_desc("debug string"), + cl::location(DebugOnlyOptLoc), cl::ValueRequired); + #endif + } + + // isCurrentDebugType - Return true if the specified string is the debug type + // specified on the command line, or if none was specified on the command line + // with the -debug-only=X option. + // + bool isCurrentDebugType(const char *DebugType) { + return CurrentDebugType.empty() || DebugType == CurrentDebugType; + } Index: llvm/lib/Support/Statistic.cpp diff -u llvm/lib/Support/Statistic.cpp:1.8 llvm/lib/Support/Statistic.cpp:1.9 --- llvm/lib/Support/Statistic.cpp:1.8 Fri May 9 15:05:44 2003 +++ llvm/lib/Support/Statistic.cpp Fri Aug 1 17:15:41 2003 @@ -16,15 +16,12 @@ #include "Support/Statistic.h" #include "Support/CommandLine.h" -#include #include -#include +#include // GetLibSupportInfoOutputFile - Return a file stream to print our output on... std::ostream *GetLibSupportInfoOutputFile(); -bool DebugFlag; // DebugFlag - Exported boolean set by the -debug option - unsigned StatisticBase::NumStats = 0; // -stats - Command line option to cause transformations to emit stats about @@ -32,14 +29,6 @@ // static cl::opt Enabled("stats", cl::desc("Enable statistics output from program")); - -#ifndef NDEBUG -// -debug - Command line option to enable the DEBUG statements in the passes. -// This flag may only be enabled in debug builds. -static cl::opt -Debug("debug", cl::desc("Enable debug output"), cl::Hidden, - cl::location(DebugFlag)); -#endif struct StatRecord { std::string Value; From lattner at cs.uiuc.edu Fri Aug 1 17:16:15 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:16:15 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp LevelRaise.cpp Message-ID: <200308012215.RAA24008@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: ExprTypeConvert.cpp updated: 1.75 -> 1.76 LevelRaise.cpp updated: 1.83 -> 1.84 --- Log message: DEBUG got moved to Support/Debug.h --- Diffs of the changes: Index: llvm/lib/Transforms/ExprTypeConvert.cpp diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.75 llvm/lib/Transforms/ExprTypeConvert.cpp:1.76 --- llvm/lib/Transforms/ExprTypeConvert.cpp:1.75 Thu Jul 24 12:31:56 2003 +++ llvm/lib/Transforms/ExprTypeConvert.cpp Fri Aug 1 17:15:00 2003 @@ -13,7 +13,7 @@ #include "llvm/ConstantHandling.h" #include "llvm/Analysis/Expressions.h" #include "Support/STLExtras.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include using std::cerr; Index: llvm/lib/Transforms/LevelRaise.cpp diff -u llvm/lib/Transforms/LevelRaise.cpp:1.83 llvm/lib/Transforms/LevelRaise.cpp:1.84 --- llvm/lib/Transforms/LevelRaise.cpp:1.83 Tue May 20 16:01:14 2003 +++ llvm/lib/Transforms/LevelRaise.cpp Fri Aug 1 17:15:00 2003 @@ -16,11 +16,11 @@ #include "llvm/Analysis/Expressions.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" -#include "Support/STLExtras.h" -#include "Support/Statistic.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" +#include "Support/STLExtras.h" #include -using std::cerr; // StartInst - This enables the -raise-start-inst=foo option to cause the level // raising pass to start at instruction "foo", which is immensely useful for @@ -274,7 +274,7 @@ if (ExpressionConvertibleToType(Src, DestTy, ConvertedTypes, TD)) { PRINT_PEEPHOLE3("CAST-SRC-EXPR-CONV:in ", Src, CI, BB->getParent()); - DEBUG(cerr << "\nCONVERTING SRC EXPR TYPE:\n"); + DEBUG(std::cerr << "\nCONVERTING SRC EXPR TYPE:\n"); { // ValueMap must be destroyed before function verified! ValueMapCache ValueMap; Value *E = ConvertExpressionToType(Src, DestTy, ValueMap, TD); @@ -283,7 +283,8 @@ CI->replaceAllUsesWith(CPV); PRINT_PEEPHOLE1("CAST-SRC-EXPR-CONV:out", E); - DEBUG(cerr << "DONE CONVERTING SRC EXPR TYPE: \n" << BB->getParent()); + DEBUG(std::cerr << "DONE CONVERTING SRC EXPR TYPE: \n" + << BB->getParent()); } DEBUG(assert(verifyFunction(*BB->getParent()) == false && @@ -302,14 +303,14 @@ if (ValueConvertibleToType(CI, Src->getType(), ConvertedTypes, TD)) { PRINT_PEEPHOLE3("CAST-DEST-EXPR-CONV:in ", Src, CI, BB->getParent()); - DEBUG(cerr << "\nCONVERTING EXPR TYPE:\n"); + DEBUG(std::cerr << "\nCONVERTING EXPR TYPE:\n"); { // ValueMap must be destroyed before function verified! ValueMapCache ValueMap; ConvertValueToNewType(CI, Src, ValueMap, TD); // This will delete CI! } PRINT_PEEPHOLE1("CAST-DEST-EXPR-CONV:out", Src); - DEBUG(cerr << "DONE CONVERTING EXPR TYPE: \n\n" << BB->getParent()); + DEBUG(std::cerr << "DONE CONVERTING EXPR TYPE: \n\n" << BB->getParent()); DEBUG(assert(verifyFunction(*BB->getParent()) == false && "Function broken!")); @@ -556,11 +557,11 @@ bool Changed = false; for (Function::iterator BB = F.begin(), BBE = F.end(); BB != BBE; ++BB) for (BasicBlock::iterator BI = BB->begin(); BI != BB->end();) { - DEBUG(cerr << "Processing: " << *BI); + DEBUG(std::cerr << "Processing: " << *BI); if (dceInstruction(BI) || doConstantPropagation(BI)) { Changed = true; ++NumDCEorCP; - DEBUG(cerr << "***\t\t^^-- Dead code eliminated!\n"); + DEBUG(std::cerr << "***\t\t^^-- Dead code eliminated!\n"); } else if (PeepholeOptimize(BB, BI)) { Changed = true; } else { @@ -574,7 +575,8 @@ // runOnFunction - Raise a function representation to a higher level. bool RPR::runOnFunction(Function &F) { - DEBUG(cerr << "\n\n\nStarting to work on Function '" << F.getName() << "'\n"); + DEBUG(std::cerr << "\n\n\nStarting to work on Function '" << F.getName() + << "'\n"); // Insert casts for all incoming pointer pointer values that are treated as // arrays... @@ -596,7 +598,7 @@ } do { - DEBUG(cerr << "Looping: \n" << F); + DEBUG(std::cerr << "Looping: \n" << F); // Iterate over the function, refining it, until it converges on a stable // state From lattner at cs.uiuc.edu Fri Aug 1 17:16:22 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:16:22 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp FunctionInlining.cpp Internalize.cpp MutateStructTypes.cpp PoolAllocate.cpp Message-ID: <200308012215.RAA24023@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: DeadArgumentElimination.cpp updated: 1.3 -> 1.4 FunctionInlining.cpp updated: 1.46 -> 1.47 Internalize.cpp updated: 1.17 -> 1.18 MutateStructTypes.cpp updated: 1.36 -> 1.37 PoolAllocate.cpp updated: 1.11 -> 1.12 --- Log message: DEBUG got moved to Support/Debug.h --- Diffs of the changes: Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.3 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.4 --- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.3 Tue Jun 24 23:12:49 2003 +++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Fri Aug 1 17:15:01 2003 @@ -17,6 +17,7 @@ #include "llvm/iOther.h" #include "llvm/iTerminators.h" #include "llvm/Support/CallSite.h" +#include "Support/Debug.h" #include "Support/Statistic.h" #include "Support/iterator" #include Index: llvm/lib/Transforms/IPO/FunctionInlining.cpp diff -u llvm/lib/Transforms/IPO/FunctionInlining.cpp:1.46 llvm/lib/Transforms/IPO/FunctionInlining.cpp:1.47 --- llvm/lib/Transforms/IPO/FunctionInlining.cpp:1.46 Sat Jun 28 10:57:04 2003 +++ llvm/lib/Transforms/IPO/FunctionInlining.cpp Fri Aug 1 17:15:01 2003 @@ -10,8 +10,9 @@ #include "llvm/Pass.h" #include "llvm/iOther.h" #include "llvm/iMemory.h" -#include "Support/Statistic.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" #include namespace { Index: llvm/lib/Transforms/IPO/Internalize.cpp diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.17 llvm/lib/Transforms/IPO/Internalize.cpp:1.18 --- llvm/lib/Transforms/IPO/Internalize.cpp:1.17 Thu Jun 26 00:30:40 2003 +++ llvm/lib/Transforms/IPO/Internalize.cpp Fri Aug 1 17:15:01 2003 @@ -9,8 +9,9 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Pass.h" #include "llvm/Module.h" -#include "Support/Statistic.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" #include #include Index: llvm/lib/Transforms/IPO/MutateStructTypes.cpp diff -u llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.36 llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.37 --- llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.36 Thu May 22 17:00:04 2003 +++ llvm/lib/Transforms/IPO/MutateStructTypes.cpp Fri Aug 1 17:15:01 2003 @@ -18,7 +18,7 @@ #include "llvm/Instructions.h" #include "llvm/Constants.h" #include "Support/STLExtras.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include // ValuePlaceHolder - A stupid little marker value. It appears as an Index: llvm/lib/Transforms/IPO/PoolAllocate.cpp diff -u llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.11 llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.12 --- llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.11 Sun Jun 29 22:14:44 2003 +++ llvm/lib/Transforms/IPO/PoolAllocate.cpp Fri Aug 1 17:15:01 2003 @@ -15,7 +15,7 @@ #include "llvm/Instructions.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/InstVisitor.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include "Support/VectorExtras.h" using namespace PA; From lattner at cs.uiuc.edu Fri Aug 1 17:16:30 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:16:30 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp CorrelatedExprs.cpp IndVarSimplify.cpp LICM.cpp PRE.cpp Reassociate.cpp SCCP.cpp ScalarReplAggregates.cpp TailDuplication.cpp Message-ID: <200308012215.RAA24057@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.56 -> 1.57 CorrelatedExprs.cpp updated: 1.10 -> 1.11 IndVarSimplify.cpp updated: 1.33 -> 1.34 LICM.cpp updated: 1.27 -> 1.28 PRE.cpp updated: 1.2 -> 1.3 Reassociate.cpp updated: 1.18 -> 1.19 SCCP.cpp updated: 1.70 -> 1.71 ScalarReplAggregates.cpp updated: 1.7 -> 1.8 TailDuplication.cpp updated: 1.5 -> 1.6 --- Log message: DEBUG got moved to Support/Debug.h --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.56 llvm/lib/Transforms/Scalar/ADCE.cpp:1.57 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.56 Tue Jun 24 18:02:45 2003 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Fri Aug 1 17:15:03 2003 @@ -15,9 +15,10 @@ #include "llvm/iPHINode.h" #include "llvm/Constant.h" #include "llvm/Support/CFG.h" -#include "Support/STLExtras.h" +#include "Support/Debug.h" #include "Support/DepthFirstIterator.h" #include "Support/Statistic.h" +#include "Support/STLExtras.h" #include namespace { Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.10 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.11 --- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.10 Tue May 20 16:01:16 2003 +++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Fri Aug 1 17:15:03 2003 @@ -31,6 +31,7 @@ #include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/ConstantRange.h" #include "llvm/Support/CFG.h" +#include "Support/Debug.h" #include "Support/PostOrderIterator.h" #include "Support/Statistic.h" #include Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.33 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.34 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.33 Wed Apr 23 11:37:42 2003 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Fri Aug 1 17:15:03 2003 @@ -13,8 +13,9 @@ #include "llvm/Type.h" #include "llvm/Constants.h" #include "llvm/Support/CFG.h" -#include "Support/STLExtras.h" +#include "Support/Debug.h" #include "Support/Statistic.h" +#include "Support/STLExtras.h" namespace { Statistic<> NumRemoved ("indvars", "Number of aux indvars removed"); Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.27 llvm/lib/Transforms/Scalar/LICM.cpp:1.28 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.27 Wed Apr 23 11:37:42 2003 +++ llvm/lib/Transforms/Scalar/LICM.cpp Fri Aug 1 17:15:03 2003 @@ -31,8 +31,9 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/InstVisitor.h" #include "llvm/Support/CFG.h" -#include "Support/Statistic.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" #include "llvm/Assembly/Writer.h" #include Index: llvm/lib/Transforms/Scalar/PRE.cpp diff -u llvm/lib/Transforms/Scalar/PRE.cpp:1.2 llvm/lib/Transforms/Scalar/PRE.cpp:1.3 --- llvm/lib/Transforms/Scalar/PRE.cpp:1.2 Thu May 29 15:26:30 2003 +++ llvm/lib/Transforms/Scalar/PRE.cpp Fri Aug 1 17:15:03 2003 @@ -23,6 +23,7 @@ #include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/ValueNumbering.h" #include "llvm/Transforms/Scalar.h" +#include "Support/Debug.h" #include "Support/DepthFirstIterator.h" #include "Support/PostOrderIterator.h" #include "Support/Statistic.h" Index: llvm/lib/Transforms/Scalar/Reassociate.cpp diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.18 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.19 --- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.18 Fri May 2 14:26:34 2003 +++ llvm/lib/Transforms/Scalar/Reassociate.cpp Fri Aug 1 17:15:03 2003 @@ -26,6 +26,7 @@ #include "llvm/Pass.h" #include "llvm/Constant.h" #include "llvm/Support/CFG.h" +#include "Support/Debug.h" #include "Support/PostOrderIterator.h" #include "Support/Statistic.h" Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.70 llvm/lib/Transforms/Scalar/SCCP.cpp:1.71 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.70 Tue Jun 24 15:29:52 2003 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Fri Aug 1 17:15:03 2003 @@ -20,8 +20,9 @@ #include "llvm/Instructions.h" #include "llvm/Pass.h" #include "llvm/Support/InstVisitor.h" -#include "Support/STLExtras.h" +#include "Support/Debug.h" #include "Support/Statistic.h" +#include "Support/STLExtras.h" #include #include Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.7 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.8 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.7 Wed Jul 23 10:22:25 2003 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Fri Aug 1 17:15:03 2003 @@ -13,8 +13,9 @@ #include "llvm/iMemory.h" #include "llvm/DerivedTypes.h" #include "llvm/Constants.h" -#include "Support/StringExtras.h" +#include "Support/Debug.h" #include "Support/Statistic.h" +#include "Support/StringExtras.h" namespace { Statistic<> NumReplaced("scalarrepl", "Number of alloca's broken up"); Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.5 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.6 --- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.5 Tue Jul 22 22:32:41 2003 +++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Fri Aug 1 17:15:03 2003 @@ -19,6 +19,7 @@ #include "llvm/Type.h" #include "llvm/Support/CFG.h" #include "llvm/Transforms/Utils/Local.h" +#include "Support/Debug.h" #include "Support/Statistic.h" namespace { From lattner at cs.uiuc.edu Fri Aug 1 17:16:37 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:16:37 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp GraphAuxillary.cpp Message-ID: <200308012215.RAA24034@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: Graph.cpp updated: 1.9 -> 1.10 GraphAuxillary.cpp updated: 1.15 -> 1.16 --- Log message: DEBUG got moved to Support/Debug.h --- Diffs of the changes: Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp:1.9 llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp:1.10 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp:1.9 Fri Feb 14 14:37:52 2003 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp Fri Aug 1 17:15:02 2003 @@ -7,7 +7,7 @@ #include "Graph.h" #include "llvm/iTerminators.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include using std::map; Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp:1.15 llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp:1.16 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp:1.15 Fri Feb 14 14:38:05 2003 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp Fri Aug 1 17:15:02 2003 @@ -10,7 +10,7 @@ #include "llvm/Pass.h" #include "llvm/Module.h" #include "llvm/iTerminators.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include #include "Graph.h" From lattner at cs.uiuc.edu Fri Aug 1 17:20:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:20:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp Message-ID: <200308012219.RAA24132@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcV9CodeEmitter.cpp updated: 1.23 -> 1.24 --- Log message: DEBUG got moved to Debug.h --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp diff -u llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.23 llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.24 --- llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.23 Tue Jul 29 14:00:58 2003 +++ llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp Fri Aug 1 17:19:03 2003 @@ -1,5 +1,6 @@ -//===-- SparcV9CodeEmitter.cpp - --------===// +//===-- SparcV9CodeEmitter.cpp --------------------------------------------===// // +// FIXME: document // //===----------------------------------------------------------------------===// @@ -14,7 +15,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetData.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include "Support/hash_set" #include "SparcInternals.h" #include "SparcV9CodeEmitter.h" From lattner at cs.uiuc.edu Fri Aug 1 17:21:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:21:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/FloatingPoint.cpp Message-ID: <200308012220.RAA26026@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: FloatingPoint.cpp updated: 1.3 -> 1.4 --- Log message: Move DEBUG to Debug.h --- Diffs of the changes: Index: llvm/lib/Target/X86/FloatingPoint.cpp diff -u llvm/lib/Target/X86/FloatingPoint.cpp:1.3 llvm/lib/Target/X86/FloatingPoint.cpp:1.4 --- llvm/lib/Target/X86/FloatingPoint.cpp:1.3 Thu Jun 26 19:00:45 2003 +++ llvm/lib/Target/X86/FloatingPoint.cpp Fri Aug 1 17:20:37 2003 @@ -12,6 +12,7 @@ #include "llvm/CodeGen/LiveVariables.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" +#include "Support/Debug.h" #include "Support/Statistic.h" #include #include From lattner at cs.uiuc.edu Fri Aug 1 17:22:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:22:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/ProgrammersManual.html Message-ID: <200308012221.RAA29434@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: ProgrammersManual.html updated: 1.41 -> 1.42 --- Log message: Update information about the new DEBUG_TYPE macro --- Diffs of the changes: Index: llvm/www/docs/ProgrammersManual.html diff -u llvm/www/docs/ProgrammersManual.html:1.41 llvm/www/docs/ProgrammersManual.html:1.42 --- llvm/www/docs/ProgrammersManual.html:1.41 Mon Jul 28 14:21:20 2003 +++ llvm/www/docs/ProgrammersManual.html Fri Aug 1 17:20:59 2003 @@ -24,6 +24,10 @@ dyn_cast<> templates
  • The DEBUG() macro & -debug option +
  • The Statistic template & -stats option +


    Fine grained debug info with + DEBUG_TYPE() and the -debug-only option

      + +Sometimes you may find yourself in a situation where enabling -debug +just turns on too much information (such as when working on the code +generator). If you want to enable debug information with more fine-grained +control, you define the DEBUG_TYPE macro and the -debug only +option as follows:

      + +

      +     ...
      +     DEBUG(std::cerr << "No debug type\n");
      +     #undef  DEBUG_TYPE
      +     #define DEBUG_TYPE "foo"
      +     DEBUG(std::cerr << "'foo' debug type\n");
      +     #undef  DEBUG_TYPE
      +     #define DEBUG_TYPE "bar"
      +     DEBUG(std::cerr << "'bar' debug type\n");
      +     #undef  DEBUG_TYPE
      +     #define DEBUG_TYPE ""
      +     DEBUG(std::cerr << "No debug type (2)\n");
      +     ...
      +

      + +Then you can run your pass like this:

      + +

      +  $ opt < a.bc > /dev/null -mypass
      +    <no output>
      +  $ opt < a.bc > /dev/null -mypass -debug
      +    No debug type
      +    'foo' debug type
      +    'bar' debug type
      +    No debug type (2)
      +  $ opt < a.bc > /dev/null -mypass -debug-only=foo
      +    No debug type
      +    'foo' debug type
      +    No debug type (2)
      +  $ opt < a.bc > /dev/null -mypass -debug-only=bar
      +    No debug type
      +    'bar' debug type
      +    No debug type (2)
      +  $
      +

      + +Of course, in practice, you should only set DEBUG_TYPE at the top of a +file, to specify the debug type for the entire module (if you do this before you +#include "Support/Debug.h", you don't have to insert the ugly +#undef's). Also, you should use names more meaningful that "foo" and +"bar", because there is no system in place to ensure that names do not conflict: +if two different modules use the same string, they will all be turned on when +the name is specified. This allows all, say, instruction scheduling debug +information to be enabled with -debug-type=InstrSched, even if the +source lives in multiple files.

      +

    @@ -1734,6 +1793,6 @@ Chris Lattner -Last modified: Wed Apr 23 11:21:57 CDT 2003 +Last modified: Fri Aug 1 16:40:37 CDT 2003 From lattner at cs.uiuc.edu Fri Aug 1 17:22:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:22:08 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp Message-ID: <200308012221.RAA26137@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.31 -> 1.32 --- Log message: Move DEBUG to Debug.h --- Diffs of the changes: Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.31 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.32 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.31 Sat Jul 26 18:06:00 2003 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Fri Aug 1 17:20:22 2003 @@ -12,6 +12,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/Value.h" +#include "Support/Debug.h" #include "Support/Statistic.h" #include "Config/alloca.h" From lattner at cs.uiuc.edu Fri Aug 1 17:22:15 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:22:15 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/RegAllocLocal.cpp RegAllocSimple.cpp Message-ID: <200308012221.RAA26279@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: RegAllocLocal.cpp updated: 1.16 -> 1.17 RegAllocSimple.cpp updated: 1.39 -> 1.40 --- Log message: Move DEBUG to Debug.h --- Diffs of the changes: Index: llvm/lib/CodeGen/RegAllocLocal.cpp diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.16 llvm/lib/CodeGen/RegAllocLocal.cpp:1.17 --- llvm/lib/CodeGen/RegAllocLocal.cpp:1.16 Mon May 26 19:05:17 2003 +++ llvm/lib/CodeGen/RegAllocLocal.cpp Fri Aug 1 17:21:34 2003 @@ -13,8 +13,9 @@ #include "llvm/CodeGen/LiveVariables.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" -#include "Support/Statistic.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" #include namespace { Index: llvm/lib/CodeGen/RegAllocSimple.cpp diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.39 llvm/lib/CodeGen/RegAllocSimple.cpp:1.40 --- llvm/lib/CodeGen/RegAllocSimple.cpp:1.39 Mon May 26 19:05:17 2003 +++ llvm/lib/CodeGen/RegAllocSimple.cpp Fri Aug 1 17:21:34 2003 @@ -14,6 +14,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" +#include "Support/Debug.h" #include "Support/Statistic.h" #include From lattner at cs.uiuc.edu Fri Aug 1 17:22:22 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:22:22 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td Message-ID: <200308012221.RAA26295@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target: Target.td updated: 1.7 -> 1.8 --- Log message: Rename fields --- Diffs of the changes: Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.7 llvm/lib/Target/Target.td:1.8 --- llvm/lib/Target/Target.td:1.7 Fri Aug 1 00:18:03 2003 +++ llvm/lib/Target/Target.td Fri Aug 1 17:21:49 2003 @@ -70,11 +70,9 @@ // list MemberList = regList; - // allocation_order_* - These methods define the order that the registers - // should be allocated. See the MRegister.h file for more information. - // - code allocation_order_begin; - code allocation_order_end; + // Methods - This member can be used to insert arbitrary code into a generated + // register class. The normal usage of this is to overload virtual methods. + code Methods = [{}]; } // RegisterInfo - This class should only be instantiated once to provide From lattner at cs.uiuc.edu Fri Aug 1 17:27:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 17:27:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/ProgrammersManual.html Message-ID: <200308012226.RAA29506@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: ProgrammersManual.html updated: 1.42 -> 1.43 --- Log message: Fix a bug --- Diffs of the changes: Index: llvm/www/docs/ProgrammersManual.html diff -u llvm/www/docs/ProgrammersManual.html:1.42 llvm/www/docs/ProgrammersManual.html:1.43 --- llvm/www/docs/ProgrammersManual.html:1.42 Fri Aug 1 17:20:59 2003 +++ llvm/www/docs/ProgrammersManual.html Fri Aug 1 17:26:27 2003 @@ -398,13 +398,9 @@ 'bar' debug type No debug type (2) $ opt < a.bc > /dev/null -mypass -debug-only=foo - No debug type 'foo' debug type - No debug type (2) $ opt < a.bc > /dev/null -mypass -debug-only=bar - No debug type 'bar' debug type - No debug type (2) $

    @@ -414,7 +410,7 @@ #undef's). Also, you should use names more meaningful that "foo" and "bar", because there is no system in place to ensure that names do not conflict: if two different modules use the same string, they will all be turned on when -the name is specified. This allows all, say, instruction scheduling debug +the name is specified. This allows all, say, instruction scheduling, debug information to be enabled with -debug-type=InstrSched, even if the source lives in multiple files.

    @@ -1793,6 +1789,6 @@ Chris Lattner -Last modified: Fri Aug 1 16:40:37 CDT 2003 +Last modified: Fri Aug 1 17:26:10 CDT 2003 From lattner at cs.uiuc.edu Fri Aug 1 18:31:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 18:31:00 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/BugPoint/misopt-basictest.ll Message-ID: <200308012330.SAA31942@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/BugPoint: misopt-basictest.ll updated: 1.1 -> 1.2 --- Log message: Fix problem executing the CBE --- Diffs of the changes: Index: llvm/test/Regression/BugPoint/misopt-basictest.ll diff -u llvm/test/Regression/BugPoint/misopt-basictest.ll:1.1 llvm/test/Regression/BugPoint/misopt-basictest.ll:1.2 --- llvm/test/Regression/BugPoint/misopt-basictest.ll:1.1 Mon Dec 23 17:50:35 2002 +++ llvm/test/Regression/BugPoint/misopt-basictest.ll Fri Aug 1 18:29:59 2003 @@ -1,3 +1,4 @@ +; RUN: export PATH=/usr/bin:/bin/:${PATH} ; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg %.LC0 = internal global [13 x sbyte] c"Hello World\0A\00" From lattner at cs.uiuc.edu Fri Aug 1 18:47:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 18:47:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-em3d/Makefile Message-ID: <200308012346.SAA32642@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-em3d: Makefile updated: 1.3 -> 1.4 --- Log message: Reduce default problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-em3d/Makefile diff -u llvm/test/Programs/MultiSource/Olden-em3d/Makefile:1.3 llvm/test/Programs/MultiSource/Olden-em3d/Makefile:1.4 --- llvm/test/Programs/MultiSource/Olden-em3d/Makefile:1.3 Mon Jun 16 10:51:24 2003 +++ llvm/test/Programs/MultiSource/Olden-em3d/Makefile Fri Aug 1 18:45:55 2003 @@ -3,6 +3,9 @@ PROG = em3d CPPFLAGS = -DTORONTO LDFLAGS = + +ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = 1024 1000 125 +endif include ../Makefile.multisrc From lattner at cs.uiuc.edu Fri Aug 1 20:28:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Aug 1 20:28:01 2003 Subject: [llvm-commits] CVS: llvm/utils/TableGen/Record.h Record.cpp Message-ID: <200308020127.UAA04363@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: Record.h updated: 1.23 -> 1.24 Record.cpp updated: 1.17 -> 1.18 --- Log message: Add new method --- Diffs of the changes: Index: llvm/utils/TableGen/Record.h diff -u llvm/utils/TableGen/Record.h:1.23 llvm/utils/TableGen/Record.h:1.24 --- llvm/utils/TableGen/Record.h:1.23 Fri Aug 1 01:27:59 2003 +++ llvm/utils/TableGen/Record.h Fri Aug 1 20:27:37 2003 @@ -626,6 +626,12 @@ /// ListInit *getValueAsListInit(const std::string &FieldName) const; + /// getValueAsDef - This method looks up the specified field and returns its + /// value as a Record, throwing an exception if the field does not exist or if + /// the value is not the right type. + /// + Record *getValueAsDef(const std::string &FieldName) const; + /// getValueAsInt - This method looks up the specified field and returns its /// value as an int, throwing an exception if the field does not exist or if /// the value is not the right type. Index: llvm/utils/TableGen/Record.cpp diff -u llvm/utils/TableGen/Record.cpp:1.17 llvm/utils/TableGen/Record.cpp:1.18 --- llvm/utils/TableGen/Record.cpp:1.17 Fri Aug 1 01:27:59 2003 +++ llvm/utils/TableGen/Record.cpp Fri Aug 1 20:27:37 2003 @@ -536,6 +536,23 @@ "' does not have a list initializer!"; } +/// getValueAsDef - This method looks up the specified field and returns its +/// value as a Record, throwing an exception if the field does not exist or if +/// the value is not the right type. +/// +Record *Record::getValueAsDef(const std::string &FieldName) const { + const RecordVal *R = getValue(FieldName); + if (R == 0 || R->getValue() == 0) + throw "Record '" + R->getName() + "' does not have a field named '" + + FieldName + "!\n"; + + if (DefInit *DI = dynamic_cast(R->getValue())) + return DI->getDef(); + throw "Record '" + R->getName() + "', field '" + FieldName + + "' does not have a list initializer!"; +} + + void RecordKeeper::dump() const { std::cerr << *this; } std::ostream &operator<<(std::ostream &OS, const RecordKeeper &RK) {