Deleted Added
full compact
ToolRunner.cpp (218885) ToolRunner.cpp (221337)
1//===-- ToolRunner.cpp ----------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 489 unchanged lines hidden (view full) ---

498 const std::vector<std::string> &ArgsForGCC,
499 const std::vector<std::string> &SharedLibs,
500 unsigned Timeout,
501 unsigned MemoryLimit) {
502
503 sys::Path OutputAsmFile;
504 GCC::FileType FileKind = OutputCode(Bitcode, OutputAsmFile, *Error, Timeout,
505 MemoryLimit);
1//===-- ToolRunner.cpp ----------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 489 unchanged lines hidden (view full) ---

498 const std::vector<std::string> &ArgsForGCC,
499 const std::vector<std::string> &SharedLibs,
500 unsigned Timeout,
501 unsigned MemoryLimit) {
502
503 sys::Path OutputAsmFile;
504 GCC::FileType FileKind = OutputCode(Bitcode, OutputAsmFile, *Error, Timeout,
505 MemoryLimit);
506 FileRemover OutFileRemover(OutputAsmFile, !SaveTemps);
506 FileRemover OutFileRemover(OutputAsmFile.str(), !SaveTemps);
507
508 std::vector<std::string> GCCArgs(ArgsForGCC);
509 GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
510
511 // Assuming LLC worked, compile the result with GCC and run it.
512 return gcc->ExecuteProgram(OutputAsmFile.str(), Args, FileKind,
513 InputFile, OutputFile, Error, GCCArgs,
514 Timeout, MemoryLimit);

--- 155 unchanged lines hidden (view full) ---

670 std::string *Error,
671 const std::vector<std::string> &ArgsForGCC,
672 const std::vector<std::string> &SharedLibs,
673 unsigned Timeout,
674 unsigned MemoryLimit) {
675 sys::Path OutputCFile;
676 OutputCode(Bitcode, OutputCFile, *Error, Timeout, MemoryLimit);
677
507
508 std::vector<std::string> GCCArgs(ArgsForGCC);
509 GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
510
511 // Assuming LLC worked, compile the result with GCC and run it.
512 return gcc->ExecuteProgram(OutputAsmFile.str(), Args, FileKind,
513 InputFile, OutputFile, Error, GCCArgs,
514 Timeout, MemoryLimit);

--- 155 unchanged lines hidden (view full) ---

670 std::string *Error,
671 const std::vector<std::string> &ArgsForGCC,
672 const std::vector<std::string> &SharedLibs,
673 unsigned Timeout,
674 unsigned MemoryLimit) {
675 sys::Path OutputCFile;
676 OutputCode(Bitcode, OutputCFile, *Error, Timeout, MemoryLimit);
677
678 FileRemover CFileRemove(OutputCFile, !SaveTemps);
678 FileRemover CFileRemove(OutputCFile.str(), !SaveTemps);
679
680 std::vector<std::string> GCCArgs(ArgsForGCC);
681 GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
682
683 return gcc->ExecuteProgram(OutputCFile.str(), Args, GCC::CFile,
684 InputFile, OutputFile, Error, GCCArgs,
685 Timeout, MemoryLimit);
686}

--- 66 unchanged lines hidden (view full) ---

753 GCCArgs.push_back("c");
754 GCCArgs.push_back("-fno-strict-aliasing");
755 } else {
756 GCCArgs.push_back("assembler");
757
758 // For ARM architectures we don't want this flag. bugpoint isn't
759 // explicitly told what architecture it is working on, so we get
760 // it from gcc flags
679
680 std::vector<std::string> GCCArgs(ArgsForGCC);
681 GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
682
683 return gcc->ExecuteProgram(OutputCFile.str(), Args, GCC::CFile,
684 InputFile, OutputFile, Error, GCCArgs,
685 Timeout, MemoryLimit);
686}

--- 66 unchanged lines hidden (view full) ---

753 GCCArgs.push_back("c");
754 GCCArgs.push_back("-fno-strict-aliasing");
755 } else {
756 GCCArgs.push_back("assembler");
757
758 // For ARM architectures we don't want this flag. bugpoint isn't
759 // explicitly told what architecture it is working on, so we get
760 // it from gcc flags
761 if ((TargetTriple.getOS() == Triple::Darwin) &&
762 !IsARMArchitecture(GCCArgs))
761 if (TargetTriple.isOSDarwin() && !IsARMArchitecture(GCCArgs))
763 GCCArgs.push_back("-force_cpusubtype_ALL");
764 }
765 }
766
767 GCCArgs.push_back(ProgramFile.c_str()); // Specify the input filename.
768
769 GCCArgs.push_back("-x");
770 GCCArgs.push_back("none");

--- 75 unchanged lines hidden (view full) ---

846 // Now that we have a binary, run it!
847 outs() << "<program>"; outs().flush();
848 DEBUG(errs() << "\nAbout to run:\t";
849 for (unsigned i = 0, e = ProgramArgs.size()-1; i != e; ++i)
850 errs() << " " << ProgramArgs[i];
851 errs() << "\n";
852 );
853
762 GCCArgs.push_back("-force_cpusubtype_ALL");
763 }
764 }
765
766 GCCArgs.push_back(ProgramFile.c_str()); // Specify the input filename.
767
768 GCCArgs.push_back("-x");
769 GCCArgs.push_back("none");

--- 75 unchanged lines hidden (view full) ---

845 // Now that we have a binary, run it!
846 outs() << "<program>"; outs().flush();
847 DEBUG(errs() << "\nAbout to run:\t";
848 for (unsigned i = 0, e = ProgramArgs.size()-1; i != e; ++i)
849 errs() << " " << ProgramArgs[i];
850 errs() << "\n";
851 );
852
854 FileRemover OutputBinaryRemover(OutputBinary, !SaveTemps);
853 FileRemover OutputBinaryRemover(OutputBinary.str(), !SaveTemps);
855
856 if (RemoteClientPath.isEmpty()) {
857 DEBUG(errs() << "<run locally>");
858 return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0],
859 sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
860 Timeout, MemoryLimit, Error);
861 } else {
862 outs() << "<run remotely>"; outs().flush();

--- 32 unchanged lines hidden (view full) ---

895 GCCArgs.push_back(fileType == AsmFile ? "assembler" : "c");
896 }
897 GCCArgs.push_back("-fno-strict-aliasing");
898 GCCArgs.push_back(InputFile.c_str()); // Specify the input filename.
899 GCCArgs.push_back("-x");
900 GCCArgs.push_back("none");
901 if (TargetTriple.getArch() == Triple::sparc)
902 GCCArgs.push_back("-G"); // Compile a shared library, `-G' for Sparc
854
855 if (RemoteClientPath.isEmpty()) {
856 DEBUG(errs() << "<run locally>");
857 return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0],
858 sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
859 Timeout, MemoryLimit, Error);
860 } else {
861 outs() << "<run remotely>"; outs().flush();

--- 32 unchanged lines hidden (view full) ---

894 GCCArgs.push_back(fileType == AsmFile ? "assembler" : "c");
895 }
896 GCCArgs.push_back("-fno-strict-aliasing");
897 GCCArgs.push_back(InputFile.c_str()); // Specify the input filename.
898 GCCArgs.push_back("-x");
899 GCCArgs.push_back("none");
900 if (TargetTriple.getArch() == Triple::sparc)
901 GCCArgs.push_back("-G"); // Compile a shared library, `-G' for Sparc
903 else if (TargetTriple.getOS() == Triple::Darwin) {
902 else if (TargetTriple.isOSDarwin()) {
904 // link all source files into a single module in data segment, rather than
905 // generating blocks. dynamic_lookup requires that you set
906 // MACOSX_DEPLOYMENT_TARGET=10.3 in your env. FIXME: it would be better for
907 // bugpoint to just pass that in the environment of GCC.
908 GCCArgs.push_back("-single_module");
909 GCCArgs.push_back("-dynamiclib"); // `-dynamiclib' for MacOS X/PowerPC
910 GCCArgs.push_back("-undefined");
911 GCCArgs.push_back("dynamic_lookup");

--- 58 unchanged lines hidden ---
903 // link all source files into a single module in data segment, rather than
904 // generating blocks. dynamic_lookup requires that you set
905 // MACOSX_DEPLOYMENT_TARGET=10.3 in your env. FIXME: it would be better for
906 // bugpoint to just pass that in the environment of GCC.
907 GCCArgs.push_back("-single_module");
908 GCCArgs.push_back("-dynamiclib"); // `-dynamiclib' for MacOS X/PowerPC
909 GCCArgs.push_back("-undefined");
910 GCCArgs.push_back("dynamic_lookup");

--- 58 unchanged lines hidden ---