From reid at x10sys.com Mon Jun 5 10:45:11 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 10:45:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Printer.cpp Message-ID: <200606051545.KAA03036@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Printer.cpp updated: 1.83 -> 1.84 --- Log message: For PR798: http://llvm.cs.uiuc.edu/PR798 : Add support for Graphviz. Patch contributed by Anton Korobeynikov. --- Diffs of the changes: (+82 -6) Printer.cpp | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 82 insertions(+), 6 deletions(-) Index: llvm/lib/Analysis/DataStructure/Printer.cpp diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.83 llvm/lib/Analysis/DataStructure/Printer.cpp:1.84 --- llvm/lib/Analysis/DataStructure/Printer.cpp:1.83 Thu Apr 21 16:07:28 2005 +++ llvm/lib/Analysis/DataStructure/Printer.cpp Mon Jun 5 10:44:46 2006 @@ -19,7 +19,10 @@ #include "llvm/Assembly/Writer.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/GraphWriter.h" +#include "llvm/System/Path.h" +#include "llvm/System/Program.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Config/config.h" #include #include using namespace llvm; @@ -256,17 +259,90 @@ /// then cleanup. For use from the debugger. /// void DSGraph::viewGraph() const { - std::ofstream F("/tmp/tempgraph.dot"); + char pathsuff[9]; + + sprintf(pathsuff, "%06u", unsigned(rand())); + + sys::Path TempDir = sys::Path::GetTemporaryDirectory(); + sys::Path Filename = TempDir; + Filename.appendComponent("ds.tempgraph." + std::string(pathsuff) + ".dot"); + std::cerr << "Writing '" << Filename << "'... "; + std::ofstream F(Filename.c_str()); + if (!F.good()) { - std::cerr << "Error opening '/tmp/tempgraph.dot' for temporary graph!\n"; + std::cerr << " error opening file for writing!\n"; return; } + print(F); F.close(); - if (system("dot -Tps -Gsize=10,7.5 -Grotate=90 /tmp/tempgraph.dot > /tmp/tempgraph.ps")) - std::cerr << "Error running dot: 'dot' not in path?\n"; - system("gv /tmp/tempgraph.ps"); - system("rm /tmp/tempgraph.dot /tmp/tempgraph.ps"); + std::cerr << "\n"; + +#if HAVE_GRAPHVIZ + sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); + std::vector args; + args.push_back(Graphviz.c_str()); + args.push_back(Filename.c_str()); + args.push_back(0); + + std::cerr << "Running 'Graphviz' program... " << std::flush; + if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { + std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; + } else { + Filename.eraseFromDisk(); + return; + } +#elif (HAVE_GV && HAVE_DOT) + sys::Path PSFilename = TempDir; + PSFilename.appendComponent(std::string("ds.tempgraph") + "." + pathsuff + ".ps"); + + sys::Path dot(LLVM_PATH_DOT); + std::vector args; + args.push_back(dot.c_str()); + args.push_back("-Tps"); + args.push_back("-Nfontname=Courier"); + args.push_back("-Gsize=7.5,10"); + args.push_back(Filename.c_str()); + args.push_back("-o"); + args.push_back(PSFilename.c_str()); + args.push_back(0); + + std::cerr << "Running 'dot' program... " << std::flush; + if (sys::Program::ExecuteAndWait(dot, &args[0])) { + std::cerr << "Error viewing graph: 'dot' not in path?\n"; + } else { + std::cerr << "\n"; + + sys::Path gv(LLVM_PATH_GV); + args.clear(); + args.push_back(gv.c_str()); + args.push_back(PSFilename.c_str()); + args.push_back(0); + + sys::Program::ExecuteAndWait(gv, &args[0]); + } + Filename.eraseFromDisk(); + PSFilename.eraseFromDisk(); + return; +#elif HAVE_DOTTY + sys::Path dotty(LLVM_PATH_DOTTY); + std::vector args; + args.push_back(Filename.c_str()); + args.push_back(0); + + std::cerr << "Running 'dotty' program... " << std::flush; + if (sys::Program::ExecuteAndWait(dotty, &args[0])) { + std::cerr << "Error viewing graph: 'dotty' not in path?\n"; + } else { +#ifndef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns + Filename.eraseFromDisk(); +#endif + return; + } +#endif + + Filename.eraseFromDisk(); + TempDir.eraseFromDisk(true); } From reid at x10sys.com Mon Jun 5 10:45:11 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 10:45:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/CFGPrinter.cpp Message-ID: <200606051545.KAA03035@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: CFGPrinter.cpp updated: 1.14 -> 1.15 --- Log message: For PR798: http://llvm.cs.uiuc.edu/PR798 : Add support for Graphviz. Patch contributed by Anton Korobeynikov. --- Diffs of the changes: (+66 -14) CFGPrinter.cpp | 80 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 66 insertions(+), 14 deletions(-) Index: llvm/lib/Analysis/CFGPrinter.cpp diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.14 llvm/lib/Analysis/CFGPrinter.cpp:1.15 --- llvm/lib/Analysis/CFGPrinter.cpp:1.14 Thu Aug 4 09:16:48 2005 +++ llvm/lib/Analysis/CFGPrinter.cpp Mon Jun 5 10:44:46 2006 @@ -24,6 +24,8 @@ #include "llvm/Assembly/Writer.h" #include "llvm/Support/CFG.h" #include "llvm/Support/GraphWriter.h" +#include "llvm/System/Path.h" +#include "llvm/System/Program.h" #include "llvm/Config/config.h" #include #include @@ -139,7 +141,14 @@ /// void Function::viewCFG() const { #ifndef NDEBUG - std::string Filename = "/tmp/cfg." + getName() + ".dot"; + char pathsuff[9]; + + sprintf(pathsuff, "%06u", unsigned(rand())); + + sys::Path TempDir = sys::Path::GetTemporaryDirectory(); + sys::Path Filename = TempDir; + + Filename.appendComponent("cfg" + getName() + "." + pathsuff + ".dot"); std::cerr << "Writing '" << Filename << "'... "; std::ofstream F(Filename.c_str()); @@ -152,34 +161,77 @@ F.close(); std::cerr << "\n"; -#ifdef HAVE_GRAPHVIZ +#if HAVE_GRAPHVIZ + sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); + std::vector args; + args.push_back(Graphviz.c_str()); + args.push_back(Filename.c_str()); + args.push_back(0); + std::cerr << "Running 'Graphviz' program... " << std::flush; - if (system((LLVM_PATH_GRAPHVIZ " " + Filename).c_str())) { + if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; } else { - system(("rm " + Filename).c_str()); + Filename.eraseFromDisk(); return; } -#endif // HAVE_GRAPHVIZ +#elif (HAVE_GV && HAVE_DOT) + sys::Path PSFilename = TempDir; + PSFilename.appendComponent(std::string("cfg.tempgraph") + "." + pathsuff + ".ps"); + + sys::Path dot(LLVM_PATH_DOT); + std::vector args; + args.push_back(dot.c_str()); + args.push_back("-Tps"); + args.push_back("-Nfontname=Courier"); + args.push_back("-Gsize=7.5,10"); + args.push_back(Filename.c_str()); + args.push_back("-o"); + args.push_back(PSFilename.c_str()); + args.push_back(0); -#ifdef HAVE_GV std::cerr << "Running 'dot' program... " << std::flush; - if (system(("dot -Tps -Nfontname=Courier -Gsize=7.5,10 " + Filename - + " > /tmp/cfg.tempgraph.ps").c_str())) { - std::cerr << "Error running dot: 'dot' not in path?\n"; + if (sys::Program::ExecuteAndWait(dot, &args[0])) { + std::cerr << "Error viewing graph: 'dot' not in path?\n"; } else { std::cerr << "\n"; - system("gv /tmp/cfg.tempgraph.ps"); + + sys::Path gv(LLVM_PATH_GV); + args.clear(); + args.push_back(gv.c_str()); + args.push_back(PSFilename.c_str()); + args.push_back(0); + + sys::Program::ExecuteAndWait(gv, &args[0]); } - system(("rm " + Filename + " /tmp/cfg.tempgraph.ps").c_str()); + Filename.eraseFromDisk(); + PSFilename.eraseFromDisk(); return; -#endif // HAVE_GV +#elif HAVE_DOTTY + sys::Path dotty(LLVM_PATH_DOTTY); + std::vector args; + args.push_back(dotty.c_str()); + args.push_back(Filename.c_str()); + args.push_back(0); + + std::cerr << "Running 'dotty' program... " << std::flush; + if (sys::Program::ExecuteAndWait(dotty, &args[0])) { + std::cerr << "Error viewing graph: 'dotty' not in path?\n"; + } else { +#ifndef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns + Filename.eraseFromDisk(); +#endif + return; + } +#endif + #endif // NDEBUG std::cerr << "Function::viewCFG is only available in debug builds on " - << "systems with Graphviz or gv!\n"; + << "systems with Graphviz or gv or dotty!\n"; #ifndef NDEBUG - system(("rm " + Filename).c_str()); + Filename.eraseFromDisk(); + TempDir.eraseFromDisk(true); #endif } From reid at x10sys.com Mon Jun 5 10:45:11 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 10:45:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp Message-ID: <200606051545.KAA03034@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineFunction.cpp updated: 1.92 -> 1.93 --- Log message: For PR798: http://llvm.cs.uiuc.edu/PR798 : Add support for Graphviz. Patch contributed by Anton Korobeynikov. --- Diffs of the changes: (+65 -14) MachineFunction.cpp | 79 ++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 65 insertions(+), 14 deletions(-) Index: llvm/lib/CodeGen/MachineFunction.cpp diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.92 llvm/lib/CodeGen/MachineFunction.cpp:1.93 --- llvm/lib/CodeGen/MachineFunction.cpp:1.92 Tue May 16 00:55:30 2006 +++ llvm/lib/CodeGen/MachineFunction.cpp Mon Jun 5 10:44:46 2006 @@ -27,6 +27,8 @@ #include "llvm/Instructions.h" #include "llvm/Support/LeakDetector.h" #include "llvm/Support/GraphWriter.h" +#include "llvm/System/Path.h" +#include "llvm/System/Program.h" #include "llvm/Config/config.h" #include #include @@ -218,7 +220,13 @@ void MachineFunction::viewCFG() const { #ifndef NDEBUG - std::string Filename = "/tmp/cfg." + getFunction()->getName() + ".dot"; + char pathsuff[9]; + + sprintf(pathsuff, "%06u", unsigned(rand())); + + sys::Path TempDir = sys::Path::GetTemporaryDirectory(); + sys::Path Filename = TempDir; + Filename.appendComponent("mf" + getFunction()->getName() + "." + pathsuff + ".dot"); std::cerr << "Writing '" << Filename << "'... "; std::ofstream F(Filename.c_str()); @@ -231,34 +239,77 @@ F.close(); std::cerr << "\n"; -#ifdef HAVE_GRAPHVIZ +#if HAVE_GRAPHVIZ + sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); + std::vector args; + args.push_back(Graphviz.c_str()); + args.push_back(Filename.c_str()); + args.push_back(0); + std::cerr << "Running 'Graphviz' program... " << std::flush; - if (system((LLVM_PATH_GRAPHVIZ " " + Filename).c_str())) { + if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; } else { - system(("rm " + Filename).c_str()); + Filename.eraseFromDisk(); return; } -#endif // HAVE_GRAPHVIZ - -#ifdef HAVE_GV +#elif (HAVE_GV && HAVE_DOT) + sys::Path PSFilename = TempDir; + PSFilename.appendComponent(std::string("mf.tempgraph") + "." + pathsuff + ".ps"); + + sys::Path dot(LLVM_PATH_DOT); + std::vector args; + args.push_back(dot.c_str()); + args.push_back("-Tps"); + args.push_back("-Nfontname=Courier"); + args.push_back("-Gsize=7.5,10"); + args.push_back(Filename.c_str()); + args.push_back("-o"); + args.push_back(PSFilename.c_str()); + args.push_back(0); + std::cerr << "Running 'dot' program... " << std::flush; - if (system(("dot -Tps -Nfontname=Courier -Gsize=7.5,10 " + Filename - + " > /tmp/cfg.tempgraph.ps").c_str())) { - std::cerr << "Error running dot: 'dot' not in path?\n"; + if (sys::Program::ExecuteAndWait(dot, &args[0])) { + std::cerr << "Error viewing graph: 'dot' not in path?\n"; } else { std::cerr << "\n"; - system("gv /tmp/cfg.tempgraph.ps"); + + sys::Path gv(LLVM_PATH_GV); + args.clear(); + args.push_back(gv.c_str()); + args.push_back(PSFilename.c_str()); + args.push_back(0); + + sys::Program::ExecuteAndWait(gv, &args[0]); } - system(("rm " + Filename + " /tmp/cfg.tempgraph.ps").c_str()); + Filename.eraseFromDisk(); + PSFilename.eraseFromDisk(); return; -#endif // HAVE_GV +#elif HAVE_DOTTY + sys::Path dotty(LLVM_PATH_DOTTY); + std::vector args; + args.push_back(dotty.c_str()); + args.push_back(Filename.c_str()); + args.push_back(0); + + std::cerr << "Running 'dotty' program... " << std::flush; + if (sys::Program::ExecuteAndWait(dotty, &args[0])) { + std::cerr << "Error viewing graph: 'dotty' not in path?\n"; + } else { +#ifndef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns + Filename.eraseFromDisk(); +#endif + return; + } +#endif + #endif // NDEBUG std::cerr << "MachineFunction::viewCFG is only available in debug builds on " << "systems with Graphviz or gv!\n"; #ifndef NDEBUG - system(("rm " + Filename).c_str()); + Filename.eraseFromDisk(); + TempDir.eraseFromDisk(true); #endif } From reid at x10sys.com Mon Jun 5 10:45:11 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 10:45:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.inc Message-ID: <200606051545.KAA03037@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.inc updated: 1.42 -> 1.43 --- Log message: For PR798: http://llvm.cs.uiuc.edu/PR798 : Add support for Graphviz. Patch contributed by Anton Korobeynikov. --- Diffs of the changes: (+8 -7) Path.inc | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) Index: llvm/lib/System/Win32/Path.inc diff -u llvm/lib/System/Win32/Path.inc:1.42 llvm/lib/System/Win32/Path.inc:1.43 --- llvm/lib/System/Win32/Path.inc:1.42 Sat May 6 21:51:51 2006 +++ llvm/lib/System/Win32/Path.inc Mon Jun 5 10:44:46 2006 @@ -222,8 +222,9 @@ BOOL rc = GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi); if (rc) return !(fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); - else if (GetLastError() != ERROR_NOT_FOUND) - ThrowError(std::string(path) + ": Can't get status: "); + else if (GetLastError() != ERROR_FILE_NOT_FOUND) { + ThrowError("isFile(): " + std::string(path) + ": Can't get status: "); + } return false; } @@ -233,8 +234,8 @@ BOOL rc = GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi); if (rc) return fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; - else if (GetLastError() != ERROR_NOT_FOUND) - ThrowError(std::string(path) + ": Can't get status: "); + else if (GetLastError() != ERROR_FILE_NOT_FOUND) + ThrowError("isDirectory(): " + std::string(path) + ": Can't get status: "); return false; } @@ -244,8 +245,8 @@ BOOL rc = GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi); if (rc) return fi.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN; - else if (GetLastError() != ERROR_NOT_FOUND) - ThrowError(std::string(path) + ": Can't get status: "); + else if (GetLastError() != ERROR_FILE_NOT_FOUND) + ThrowError("isHidden(): " + std::string(path) + ": Can't get status: "); return false; } @@ -336,7 +337,7 @@ Path::getStatusInfo(StatusInfo& info) const { WIN32_FILE_ATTRIBUTE_DATA fi; if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi)) - ThrowError(std::string(path) + ": Can't get status: "); + ThrowError("getStatusInfo():" + std::string(path) + ": Can't get status: "); info.fileSize = fi.nFileSizeHigh; info.fileSize <<= 32; From reid at x10sys.com Mon Jun 5 10:54:51 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 10:54:51 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200606051554.KAA03137@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.65 -> 1.66 --- Log message: Some enhancements for gv/graphviz/dot/dotty support and better handling of paths under MingW. --- Diffs of the changes: (+6 -0) config.h.in | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.65 llvm/include/llvm/Config/config.h.in:1.66 --- llvm/include/llvm/Config/config.h.in:1.65 Fri Jun 2 18:13:18 2006 +++ llvm/include/llvm/Config/config.h.in Mon Jun 5 10:54:38 2006 @@ -82,6 +82,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DL_H +/* Define if the dot program is available */ +#undef HAVE_DOT + /* Define if the dotty program is available */ #undef HAVE_DOTTY @@ -425,6 +428,9 @@ /* Define if this is Win32ish platform */ #undef LLVM_ON_WIN32 +/* Define to path to dot program if found or 'echo dot' otherwise */ +#undef LLVM_PATH_DOT + /* Define to path to dotty program if found or 'echo dotty' otherwise */ #undef LLVM_PATH_DOTTY From reid at x10sys.com Mon Jun 5 10:54:52 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 10:54:52 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200606051554.KAA03145@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.232 -> 1.233 --- Log message: Some enhancements for gv/graphviz/dot/dotty support and better handling of paths under MingW. --- Diffs of the changes: (+26 -5) configure.ac | 31 ++++++++++++++++++++++++++----- 1 files changed, 26 insertions(+), 5 deletions(-) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.232 llvm/autoconf/configure.ac:1.233 --- llvm/autoconf/configure.ac:1.232 Fri Jun 2 18:13:18 2006 +++ llvm/autoconf/configure.ac Mon Jun 5 10:54:38 2006 @@ -357,19 +357,41 @@ AC_PATH_PROG(GRAPHVIZ, [Graphviz], [echo Graphviz]) if test "$GRAPHVIZ" != "echo Graphviz" ; then AC_DEFINE([HAVE_GRAPHVIZ],[1],[Define if the Graphviz program is available]) - AC_DEFINE_UNQUOTED([LLVM_PATH_GRAPHVIZ],"$GRAPHVIZ", + dnl If we're targeting for mingw we should emit windows paths, not msys + if test "$llvm_cv_os_type" == "MingW" ; then + GRAPHVIZ=`echo $GRAPHVIZ | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` + fi + AC_DEFINE_UNQUOTED([LLVM_PATH_GRAPHVIZ],"$GRAPHVIZ${EXEEXT}", [Define to path to Graphviz program if found or 'echo Graphviz' otherwise]) fi -AC_PATH_PROG(GV, [gv], [echo gv]) +AC_PATH_PROG(DOT, [dot], [echo dot]) +if test "$DOT" != "echo dot" ; then + AC_DEFINE([HAVE_DOT],[1],[Define if the dot program is available]) + dnl If we're targeting for mingw we should emit windows paths, not msys + if test "$llvm_cv_os_type" == "MingW" ; then + DOT=`echo $DOT | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` + fi + AC_DEFINE_UNQUOTED([LLVM_PATH_DOT],"$DOT${EXEEXT}", + [Define to path to dot program if found or 'echo dot' otherwise]) +fi +AC_PATH_PROGS(GV, [gv gsview32], [echo gv]) if test "$GV" != "echo gv" ; then AC_DEFINE([HAVE_GV],[1],[Define if the gv program is available]) - AC_DEFINE_UNQUOTED([LLVM_PATH_GV],"$GV", + dnl If we're targeting for mingw we should emit windows paths, not msys + if test "$llvm_cv_os_type" == "MingW" ; then + GV=`echo $GV | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` + fi + AC_DEFINE_UNQUOTED([LLVM_PATH_GV],"$GV${EXEEXT}", [Define to path to gv program if found or 'echo gv' otherwise]) fi AC_PATH_PROG(DOTTY, [dotty], [echo dotty]) if test "$DOTTY" != "echo dotty" ; then AC_DEFINE([HAVE_DOTTY],[1],[Define if the dotty program is available]) - AC_DEFINE_UNQUOTED([LLVM_PATH_DOTTY],"$DOTTY", + dnl If we're targeting for mingw we should emit windows paths, not msys + if test "$llvm_cv_os_type" == "MingW" ; then + DOTTY=`echo $DOTTY | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` + fi + AC_DEFINE_UNQUOTED([LLVM_PATH_DOTTY],"$DOTTY${EXEEXT}", [Define to path to dotty program if found or 'echo dotty' otherwise]) fi @@ -390,7 +412,6 @@ dnl nothing. This just lets the build output show that we could have done dnl something if the tool was available. AC_PATH_PROG(BZIP2,[bzip2],[echo "Skipped: bzip2 not found"]) -AC_PATH_PROG(DOT,[dot],[echo "Skipped: dot not found"]) AC_PATH_PROG(DOXYGEN,[doxygen],[echo "Skipped: doxygen not found"]) AC_PATH_PROG(ETAGS,[etags],[echo "Skipped: etags not found"]) AC_PATH_PROG(GROFF,[groff],[echo "Skipped: groff not found"]) From reid at x10sys.com Mon Jun 5 10:54:52 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 10:54:52 -0500 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200606051554.KAA03141@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.235 -> 1.236 --- Log message: Some enhancements for gv/graphviz/dot/dotty support and better handling of paths under MingW. --- Diffs of the changes: (+106 -77) configure | 183 +++++++++++++++++++++++++++++++++++--------------------------- 1 files changed, 106 insertions(+), 77 deletions(-) Index: llvm/configure diff -u llvm/configure:1.235 llvm/configure:1.236 --- llvm/configure:1.235 Fri Jun 2 18:13:18 2006 +++ llvm/configure Mon Jun 5 10:54:38 2006 @@ -476,7 +476,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVM_ON_UNIX LLVM_ON_WIN32 ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CVSBUILD ENABLE_OPTIMIZED DISABLE_ASSERTIONS DEBUG_RUNTIME JIT TARGET_HAS_JIT ENABLE_DOXYGEN ENABLE_THREADS TARGETS_TO_BUILD CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON ifGNUmake LN_S CMP CP DATE FIND GREP MKDIR MV RANLIB ac_ct_RANLIB RM SED TAR GRAPHVIZ GV DOTTY PERL HAVE_PERL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA BZIP2 DOT DOXYGEN ETAGS GROFF GZIP POD2HTML POD2MAN RUNTEST TCLSH ! ZIP EGREP INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL ECHO AR ac_ct_AR STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ETAGSFLAGS LLVMGCC LLVMGXX ALLOCA MMAP_FILE LLVMCC1 LLVMCC1PLUS LLVMGCCDIR LLVMGCC_VERSION LLVMGCC_MAJVERS SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVM_ON_UNIX LLVM_ON_WIN32 ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CVSBUILD ENABLE_OPTIMIZED DISABLE_ASSERTIONS DEBUG_RUNTIME JIT TARGET_HAS_JIT ENABLE_DOXYGEN ENABLE_THREADS TARGETS_TO_BUILD CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON ifGNUmake LN_S CMP CP DATE FIND GREP MKDIR MV RANLIB ac_ct_RANLIB RM SED TAR GRAPHVIZ DOT GV DOTTY PERL HAVE_PERL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA BZIP2 DOXYGEN ETAGS GROFF GZIP POD2HTML POD2MAN RUNTEST TCLSH ! ZIP EGREP INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL ECHO AR ac_ct_AR STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ETAGSFLAGS LLVMGCC LLVMGXX ALLOCA MMAP_FILE LLVMCC1 LLVMCC1PLUS LLVMGCCDIR LLVMGCC_VERSION LLVMGCC_MAJVERS SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -5173,14 +5173,74 @@ #define HAVE_GRAPHVIZ 1 _ACEOF + if test "$llvm_cv_os_type" == "MingW" ; then + GRAPHVIZ=`echo $GRAPHVIZ | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` + fi + +cat >>confdefs.h <<_ACEOF +#define LLVM_PATH_GRAPHVIZ "$GRAPHVIZ${EXEEXT}" +_ACEOF + +fi +# Extract the first word of "dot", so it can be a program name with args. +set dummy dot; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DOT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOT="$DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_DOT" && ac_cv_path_DOT="echo dot" + ;; +esac +fi +DOT=$ac_cv_path_DOT + +if test -n "$DOT"; then + echo "$as_me:$LINENO: result: $DOT" >&5 +echo "${ECHO_T}$DOT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test "$DOT" != "echo dot" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DOT 1 +_ACEOF + + if test "$llvm_cv_os_type" == "MingW" ; then + DOT=`echo $DOT | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` + fi cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_GRAPHVIZ "$GRAPHVIZ" +#define LLVM_PATH_DOT "$DOT${EXEEXT}" _ACEOF fi -# Extract the first word of "gv", so it can be a program name with args. -set dummy gv; ac_word=$2 +for ac_prog in gv gsview32 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GV+set}" = set; then @@ -5205,7 +5265,6 @@ done done - test -z "$ac_cv_path_GV" && ac_cv_path_GV="echo gv" ;; esac fi @@ -5219,15 +5278,22 @@ echo "${ECHO_T}no" >&6 fi + test -n "$GV" && break +done +test -n "$GV" || GV="echo gv" + if test "$GV" != "echo gv" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_GV 1 _ACEOF + if test "$llvm_cv_os_type" == "MingW" ; then + GV=`echo $GV | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` + fi cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_GV "$GV" +#define LLVM_PATH_GV "$GV${EXEEXT}" _ACEOF fi @@ -5277,9 +5343,12 @@ #define HAVE_DOTTY 1 _ACEOF + if test "$llvm_cv_os_type" == "MingW" ; then + DOTTY=`echo $DOTTY | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` + fi cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_DOTTY "$DOTTY" +#define LLVM_PATH_DOTTY "$DOTTY${EXEEXT}" _ACEOF fi @@ -5467,46 +5536,6 @@ echo "${ECHO_T}no" >&6 fi -# Extract the first word of "dot", so it can be a program name with args. -set dummy dot; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_DOT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOT="$DOT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_DOT" && ac_cv_path_DOT="echo "Skipped: dot not found"" - ;; -esac -fi -DOT=$ac_cv_path_DOT - -if test -n "$DOT"; then - echo "$as_me:$LINENO: result: $DOT" >&5 -echo "${ECHO_T}$DOT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -8521,7 +8550,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext + echo '#line 10544 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10997,7 +11026,7 @@ # Provide some information about the compiler. -echo "$as_me:11000:" \ +echo "$as_me:11029:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -12054,11 +12083,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12057: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12086: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12061: \$? = $ac_status" >&5 + echo "$as_me:12090: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12297,11 +12326,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12300: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12329: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12304: \$? = $ac_status" >&5 + echo "$as_me:12333: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12357,11 +12386,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12360: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12389: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12364: \$? = $ac_status" >&5 + echo "$as_me:12393: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14542,7 +14571,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:16865: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16840: \$? = $ac_status" >&5 + echo "$as_me:16869: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16893,11 +16922,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16896: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16925: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16900: \$? = $ac_status" >&5 + echo "$as_me:16929: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18254,7 +18283,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:19221: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19196: \$? = $ac_status" >&5 + echo "$as_me:19225: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -19249,11 +19278,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19252: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19281: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:19256: \$? = $ac_status" >&5 + echo "$as_me:19285: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -21288,11 +21317,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21291: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21320: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21295: \$? = $ac_status" >&5 + echo "$as_me:21324: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -21531,11 +21560,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21534: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21563: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21538: \$? = $ac_status" >&5 + echo "$as_me:21567: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -21591,11 +21620,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21594: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21623: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:21598: \$? = $ac_status" >&5 + echo "$as_me:21627: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -23776,7 +23805,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory llvm/autoconf: configure.ac updated: 1.233 -> 1.234 --- Log message: For PR633: http://llvm.cs.uiuc.edu/PR633 : Add configure checks for setjmp/longjmp for Chris. I can't believe this easy PR has been outstanding for so long. If I don't get to something, please remind me! :) --- Diffs of the changes: (+4 -3) configure.ac | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.233 llvm/autoconf/configure.ac:1.234 --- llvm/autoconf/configure.ac:1.233 Mon Jun 5 10:54:38 2006 +++ llvm/autoconf/configure.ac Mon Jun 5 11:11:07 2006 @@ -562,9 +562,9 @@ AC_HEADER_TIME AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h]) -AC_CHECK_HEADERS([malloc.h signal.h stdint.h unistd.h utime.h windows.h]) -AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h sys/types.h]) -AC_CHECK_HEADERS([malloc/malloc.h]) +AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h unistd.h utime.h]) +AC_CHECK_HEADERS([windows.h sys/mman.h sys/param.h sys/resource.h sys/time.h]) +AC_CHECK_HEADERS([sys/types.h malloc/malloc.h]) if test "$ENABLE_THREADS" -eq 1 ; then AC_CHECK_HEADERS(pthread.h) fi @@ -594,6 +594,7 @@ AC_CHECK_FUNCS([getpagesize getrusage gettimeofday isatty mkdtemp mkstemp ]) AC_CHECK_FUNCS([mktemp realpath sbrk setrlimit strdup strerror strerror_r ]) AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ]) +AC_CHECK_FUNCS([_setjmp _longjmp setjmp longjmp sigsetjmp siglongjmp]) AC_C_PRINTF_A AC_FUNC_ALLOCA AC_FUNC_RAND48 From reid at x10sys.com Mon Jun 5 11:11:21 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 11:11:21 -0500 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200606051611.LAA03843@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.236 -> 1.237 --- Log message: For PR633: http://llvm.cs.uiuc.edu/PR633 : Add configure checks for setjmp/longjmp for Chris. I can't believe this easy PR has been outstanding for so long. If I don't get to something, please remind me! :) --- Diffs of the changes: (+111 -3) configure | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 111 insertions(+), 3 deletions(-) Index: llvm/configure diff -u llvm/configure:1.236 llvm/configure:1.237 --- llvm/configure:1.236 Mon Jun 5 10:54:38 2006 +++ llvm/configure Mon Jun 5 11:11:07 2006 @@ -26903,7 +26903,7 @@ -for ac_header in malloc.h signal.h stdint.h unistd.h utime.h windows.h +for ac_header in malloc.h setjmp.h signal.h stdint.h unistd.h utime.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -27057,7 +27057,7 @@ -for ac_header in sys/mman.h sys/param.h sys/resource.h sys/time.h sys/types.h +for ac_header in windows.h sys/mman.h sys/param.h sys/resource.h sys/time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -27207,7 +27207,8 @@ done -for ac_header in malloc/malloc.h + +for ac_header in sys/types.h malloc/malloc.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -28408,6 +28409,113 @@ fi done + + + + + + +for ac_func in _setjmp _longjmp setjmp longjmp sigsetjmp siglongjmp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + echo "$as_me:$LINENO: checking if printf has the %a format character" >&5 echo $ECHO_N "checking if printf has the %a format character... $ECHO_C" >&6 if test "${llvm_cv_c_printf_a+set}" = set; then From reid at x10sys.com Mon Jun 5 11:11:21 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 11:11:21 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200606051611.LAA03835@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.66 -> 1.67 --- Log message: For PR633: http://llvm.cs.uiuc.edu/PR633 : Add configure checks for setjmp/longjmp for Chris. I can't believe this easy PR has been outstanding for so long. If I don't get to something, please remind me! :) --- Diffs of the changes: (+21 -0) config.h.in | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.66 llvm/include/llvm/Config/config.h.in:1.67 --- llvm/include/llvm/Config/config.h.in:1.66 Mon Jun 5 10:54:38 2006 +++ llvm/include/llvm/Config/config.h.in Mon Jun 5 11:11:07 2006 @@ -194,6 +194,9 @@ the current directory to the dynamic linker search path. */ #undef HAVE_LINK_R +/* Define to 1 if you have the `longjmp' function. */ +#undef HAVE_LONGJMP + /* Define if lt_dlopen() is available on this platform */ #undef HAVE_LT_DLOPEN @@ -285,15 +288,27 @@ /* Define to 1 if you have the `sbrk' function. */ #undef HAVE_SBRK +/* Define to 1 if you have the `setjmp' function. */ +#undef HAVE_SETJMP + +/* Define to 1 if you have the header file. */ +#undef HAVE_SETJMP_H + /* Define to 1 if you have the `setrlimit' function. */ #undef HAVE_SETRLIMIT /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD +/* Define to 1 if you have the `siglongjmp' function. */ +#undef HAVE_SIGLONGJMP + /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H +/* Define to 1 if you have the `sigsetjmp' function. */ +#undef HAVE_SIGSETJMP + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H @@ -398,6 +413,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WINDOWS_H +/* Define to 1 if you have the `_longjmp' function. */ +#undef HAVE__LONGJMP + +/* Define to 1 if you have the `_setjmp' function. */ +#undef HAVE__SETJMP + /* Installation directory for binary executables */ #undef LLVM_BINDIR From reid at x10sys.com Mon Jun 5 11:23:09 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 11:23:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp Message-ID: <200606051623.LAA10202@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: CommandLine.cpp updated: 1.67 -> 1.68 --- Log message: Make it possible to override the standard version printer. Not all tools built with CommandLine.h will want the --version option to report that the tool belongs to LLVM. To override simply pass a void func() to the cl::SetVersionPrinter() function and that void func() will be called when it is time to print the version information. --- Diffs of the changes: (+29 -18) CommandLine.cpp | 47 +++++++++++++++++++++++++++++------------------ 1 files changed, 29 insertions(+), 18 deletions(-) Index: llvm/lib/Support/CommandLine.cpp diff -u llvm/lib/Support/CommandLine.cpp:1.67 llvm/lib/Support/CommandLine.cpp:1.68 --- llvm/lib/Support/CommandLine.cpp:1.67 Fri Apr 28 00:36:25 2006 +++ llvm/lib/Support/CommandLine.cpp Mon Jun 5 11:22:56 2006 @@ -951,24 +951,6 @@ } }; -class VersionPrinter { -public: - void operator=(bool OptionWasSpecified) { - if (OptionWasSpecified) { - std::cout << "Low Level Virtual Machine (" << PACKAGE_NAME << ") " - << PACKAGE_VERSION << " (see http://llvm.org/)"; -#ifndef NDEBUG - std::cout << " ASSERTIONS ENABLED\n"; -#else - std::cout << "\n"; -#endif - getOpts().clear(); // Don't bother making option dtors remove from map. - exit(1); - } - } -}; - - // Define the two HelpPrinter instances that are used to print out help, or // help-hidden... // @@ -983,6 +965,31 @@ HHOp("help-hidden", cl::desc("Display all available options"), cl::location(HiddenPrinter), cl::Hidden, cl::ValueDisallowed); +void (*OverrideVersionPrinter)() = 0; + +class VersionPrinter { +public: + void operator=(bool OptionWasSpecified) { + if (OptionWasSpecified) { + if (OverrideVersionPrinter == 0) { + std::cout << "Low Level Virtual Machine (" << PACKAGE_NAME << ") " + << PACKAGE_VERSION << " (see http://llvm.org/)"; +#ifndef NDEBUG + std::cout << " ASSERTIONS ENABLED\n"; +#else + std::cout << "\n"; +#endif + getOpts().clear(); // Don't bother making option dtors remove from map. + exit(1); + } else { + (*OverrideVersionPrinter)(); + exit(1); + } + } + } +}; + + // Define the --version option that prints out the LLVM version for the tool VersionPrinter VersionPrinterInstance; cl::opt > @@ -1002,3 +1009,7 @@ // to make it look like --help was given, so we assign true. NormalPrinter = true; } + +void cl::SetVersionPrinter(void (*func)()) { + OverrideVersionPrinter = func; +} From reid at x10sys.com Mon Jun 5 11:23:09 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 11:23:09 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CommandLine.h Message-ID: <200606051623.LAA10198@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CommandLine.h updated: 1.53 -> 1.54 --- Log message: Make it possible to override the standard version printer. Not all tools built with CommandLine.h will want the --version option to report that the tool belongs to LLVM. To override simply pass a void func() to the cl::SetVersionPrinter() function and that void func() will be called when it is time to print the version information. --- Diffs of the changes: (+7 -0) CommandLine.h | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/include/llvm/Support/CommandLine.h diff -u llvm/include/llvm/Support/CommandLine.h:1.53 llvm/include/llvm/Support/CommandLine.h:1.54 --- llvm/include/llvm/Support/CommandLine.h:1.53 Fri May 12 14:20:55 2006 +++ llvm/include/llvm/Support/CommandLine.h Mon Jun 5 11:22:56 2006 @@ -48,6 +48,13 @@ void ParseEnvironmentOptions(const char *progName, const char *envvar, const char *Overview = 0); +///===---------------------------------------------------------------------===// +/// SetVersionPrinter - Override the default (LLVM specific) version printer +/// used to print out the version when --version is given +/// on the command line. This gives other systems using the +/// CommandLine utilities to print their own version string. +void SetVersionPrinter(void (*func)()); + //===----------------------------------------------------------------------===// // Flags permitted to be passed to command line arguments // From reid at x10sys.com Mon Jun 5 11:26:18 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 11:26:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Message-ID: <200606051626.LAA10242@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGPrinter.cpp updated: 1.31 -> 1.32 --- Log message: For PR798: http://llvm.cs.uiuc.edu/PR798 : Provide GraphViz support for MingW32. Patch provided by Anton Korobeynikov --- Diffs of the changes: (+56 -13) SelectionDAGPrinter.cpp | 69 ++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 56 insertions(+), 13 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.31 llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.32 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.31 Sun Mar 5 03:38:03 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Mon Jun 5 11:26:06 2006 @@ -20,6 +20,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Support/GraphWriter.h" #include "llvm/System/Path.h" +#include "llvm/System/Program.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Config/config.h" #include @@ -126,9 +127,13 @@ void SelectionDAG::viewGraph() { // This code is only for debugging! #ifndef NDEBUG + char pathsuff[9]; + + sprintf(pathsuff, "%06u", unsigned(rand())); + sys::Path TempDir = sys::Path::GetTemporaryDirectory(); sys::Path Filename = TempDir; - Filename.appendComponent("dag." + getMachineFunction().getFunction()->getName() + ".dot"); + Filename.appendComponent("dag." + getMachineFunction().getFunction()->getName() + "." + pathsuff + ".dot"); std::cerr << "Writing '" << Filename.toString() << "'... "; std::ofstream F(Filename.toString().c_str()); @@ -141,32 +146,70 @@ F.close(); std::cerr << "\n"; -#ifdef HAVE_GRAPHVIZ +#if HAVE_GRAPHVIZ + sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); + std::vector args; + args.push_back(Graphviz.c_str()); + args.push_back(Filename.c_str()); + args.push_back(0); + std::cerr << "Running 'Graphviz' program... " << std::flush; - if (system((LLVM_PATH_GRAPHVIZ " " + Filename.toString()).c_str())) { + if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; } else { - Filename.eraseFromDisk(); + Filename.eraseFromDisk(); return; } -#endif // HAVE_GRAPHVIZ +#elif (HAVE_GV && HAVE_DOT) + sys::Path PSFilename = TempDir; + PSFilename.appendComponent(std::string("dag.tempgraph") + "." + pathsuff + ".ps"); -#ifdef HAVE_GV + sys::Path dot(LLVM_PATH_DOT); + std::vector args; + args.push_back(dot.c_str()); + args.push_back("-Tps"); + args.push_back("-Nfontname=Courier"); + args.push_back("-Gsize=7.5,10"); + args.push_back(Filename.c_str()); + args.push_back("-o"); + args.push_back(PSFilename.c_str()); + args.push_back(0); + std::cerr << "Running 'dot' program... " << std::flush; - sys::Path PSFilename = TempDir; - PSFilename.appendComponent("dag.tempgraph.ps"); - if (system(("dot -Tps -Nfontname=Courier -Gsize=7.5,10 " + Filename.toString() - + " > " + PSFilename.toString()).c_str())) { + if (sys::Program::ExecuteAndWait(dot, &args[0])) { std::cerr << "Error viewing graph: 'dot' not in path?\n"; } else { std::cerr << "\n"; - system((LLVM_PATH_GV " " + PSFilename.toString()).c_str()); - system((LLVM_PATH_GV " "+TempDir.toString()+ "dag.tempgraph.ps").c_str()); + + sys::Path gv(LLVM_PATH_GV); + args.clear(); + args.push_back(gv.c_str()); + args.push_back(PSFilename.c_str()); + args.push_back(0); + + sys::Program::ExecuteAndWait(gv, &args[0]); } Filename.eraseFromDisk(); PSFilename.eraseFromDisk(); return; -#endif // HAVE_GV +#elif HAVE_DOTTY + sys::Path dotty(LLVM_PATH_DOTTY); + std::vector args; + args.push_back(dotty.c_str()); + args.push_back(Filename.c_str()); + args.push_back(0); + + std::cerr << "Running 'dotty' program... " << std::flush; + if (sys::Program::ExecuteAndWait(dotty, &args[0])) { + std::cerr << "Error viewing graph: 'dotty' not in path?\n"; + } else { +#ifndef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns + Filename.eraseFromDisk(); +#endif + return; + } +#endif + #endif // NDEBUG std::cerr << "SelectionDAG::viewGraph is only available in debug builds on " << "systems with Graphviz or gv!\n"; From reid at x10sys.com Mon Jun 5 11:29:19 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 11:29:19 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h Argument.h BasicBlock.h CallingConv.h Constant.h Value.h Message-ID: <200606051629.LAA10293@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: AbstractTypeUser.h updated: 1.26 -> 1.27 Argument.h updated: 1.11 -> 1.12 BasicBlock.h updated: 1.57 -> 1.58 CallingConv.h updated: 1.3 -> 1.4 Constant.h updated: 1.29 -> 1.30 Value.h updated: 1.83 -> 1.84 --- Log message: For PR778: http://llvm.cs.uiuc.edu/PR778 : Move file-scoped documentation to class-scoped so it is more readily accessible. --- Diffs of the changes: (+82 -46) AbstractTypeUser.h | 33 ++++++++++++++++++--------------- Argument.h | 8 ++++++-- BasicBlock.h | 30 +++++++++++++++--------------- CallingConv.h | 6 ++++-- Constant.h | 17 +++++++++++++++++ Value.h | 34 ++++++++++++++++++++++------------ 6 files changed, 82 insertions(+), 46 deletions(-) Index: llvm/include/llvm/AbstractTypeUser.h diff -u llvm/include/llvm/AbstractTypeUser.h:1.26 llvm/include/llvm/AbstractTypeUser.h:1.27 --- llvm/include/llvm/AbstractTypeUser.h:1.26 Sat Nov 12 02:42:30 2005 +++ llvm/include/llvm/AbstractTypeUser.h Mon Jun 5 11:29:06 2006 @@ -7,21 +7,7 @@ // //===----------------------------------------------------------------------===// // -// The AbstractTypeUser class is an interface to be implemented by classes who -// could possible use an abstract type. Abstract types are denoted by the -// isAbstract flag set to true in the Type class. These are classes that -// contain an Opaque type in their structure somehow. -// -// Classes must implement this interface so that they may be notified when an -// abstract type is resolved. Abstract types may be resolved into more concrete -// types through: linking, parsing, and bytecode reading. When this happens, -// all of the users of the type must be updated to reference the new, more -// concrete type. They are notified through the AbstractTypeUser interface. -// -// In addition to this, AbstractTypeUsers must keep the use list of the -// potentially abstract type that they reference up-to-date. To do this in a -// nice, transparent way, the PATypeHandle class is used to hold "Potentially -// Abstract Types", and keep the use list of the abstract types up-to-date. +// This file declares the AbstractTypeUser class. // //===----------------------------------------------------------------------===// @@ -42,6 +28,23 @@ class Type; class DerivedType; +/// The AbstractTypeUser class is an interface to be implemented by classes who +/// could possibly use an abstract type. Abstract types are denoted by the +/// isAbstract flag set to true in the Type class. These are classes that +/// contain an Opaque type in their structure somewhere. +/// +/// Classes must implement this interface so that they may be notified when an +/// abstract type is resolved. Abstract types may be resolved into more +/// concrete types through: linking, parsing, and bytecode reading. When this +/// happens, all of the users of the type must be updated to reference the new, +/// more concrete type. They are notified through the AbstractTypeUser +/// interface. +/// +/// In addition to this, AbstractTypeUsers must keep the use list of the +/// potentially abstract type that they reference up-to-date. To do this in a +/// nice, transparent way, the PATypeHandle class is used to hold "Potentially +/// Abstract Types", and keep the use list of the abstract types up-to-date. +/// @brief LLVM Abstract Type User Representation class AbstractTypeUser { protected: virtual ~AbstractTypeUser(); // Derive from me Index: llvm/include/llvm/Argument.h diff -u llvm/include/llvm/Argument.h:1.11 llvm/include/llvm/Argument.h:1.12 --- llvm/include/llvm/Argument.h:1.11 Thu Apr 21 15:11:51 2005 +++ llvm/include/llvm/Argument.h Mon Jun 5 11:29:06 2006 @@ -7,8 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines the Argument class, which represents an incoming formal -// argument to a Function. +// This file declares the Argument class. // //===----------------------------------------------------------------------===// @@ -23,6 +22,11 @@ template class SymbolTableListTraits; +/// A class to represent an incoming formal argument to a Function. An argument +/// is a very simple Value. It is essentially a named (optional) type. When used +/// in the body of a function, it represents the value of the actual argument +/// the function was called with. +/// @brief LLVM Argument representation class Argument : public Value { // Defined in the Function.cpp file Function *Parent; Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.57 llvm/include/llvm/BasicBlock.h:1.58 --- llvm/include/llvm/BasicBlock.h:1.57 Tue Oct 25 12:59:28 2005 +++ llvm/include/llvm/BasicBlock.h Mon Jun 5 11:29:06 2006 @@ -8,21 +8,7 @@ //===----------------------------------------------------------------------===// // // -// This file contains the declaration of the BasicBlock class, which represents -// a single basic block in the VM. -// -// Note that basic blocks themselves are Value's, because they are referenced -// by instructions like branches and can go in switch tables and stuff... -// -///===---------------------------------------------------------------------===// -// -// Note that well formed basic blocks are formed of a list of instructions -// followed by a single TerminatorInst instruction. TerminatorInst's may not -// occur in the middle of basic blocks, and must terminate the blocks. -// -// This code allows malformed basic blocks to occur, because it may be useful -// in the intermediate stage modification to a program. -// +// This file contains the declaration of the BasicBlock class. //===----------------------------------------------------------------------===// #ifndef LLVM_BASICBLOCK_H @@ -46,6 +32,20 @@ static iplist &getList(BasicBlock *BB); }; +/// This represents a single basic block in LLVM. A basic block is simply a +/// container of instructions that execute sequentially. Basic blocks are Values +/// because they are referenced by instructions such as branches and switch +/// tables. The type of a BasicBlock is "Type::LabelTy" because the basic block +/// represents a label to which a branch can jump. +/// +/// A well formed basic block is formed of a list of non-terminating +/// instructions followed by a single TerminatorInst instruction. +/// TerminatorInst's may not occur in the middle of basic blocks, and must +/// terminate the blocks. The BasicBlock class allows malformed basic blocks to +/// occur because it may be useful in the intermediate stage of constructing or +/// modifying a program. However, the verifier will ensure that basic blocks +/// are "well formed". +/// @brief LLVM Basic Block Representation class BasicBlock : public Value { // Basic blocks are data objects also public: typedef iplist InstListType; Index: llvm/include/llvm/CallingConv.h diff -u llvm/include/llvm/CallingConv.h:1.3 llvm/include/llvm/CallingConv.h:1.4 --- llvm/include/llvm/CallingConv.h:1.3 Fri May 19 16:19:02 2006 +++ llvm/include/llvm/CallingConv.h Mon Jun 5 11:29:06 2006 @@ -7,8 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines a set of enums which specify the assigned numeric values -// for known llvm calling conventions. +// This file defines LLVM's set of calling conventions. // //===----------------------------------------------------------------------===// @@ -21,6 +20,9 @@ /// the well-known calling conventions. /// namespace CallingConv { + /// A set of enums which specify the assigned numeric values for known llvm + /// calling conventions. + /// @brief LLVM Calling Convention Representation enum ID { // C - The default llvm calling convention, compatible with C. This // convention is the only calling convention that supports varargs calls. Index: llvm/include/llvm/Constant.h diff -u llvm/include/llvm/Constant.h:1.29 llvm/include/llvm/Constant.h:1.30 --- llvm/include/llvm/Constant.h:1.29 Fri Mar 10 17:52:03 2006 +++ llvm/include/llvm/Constant.h Mon Jun 5 11:29:06 2006 @@ -18,6 +18,23 @@ namespace llvm { +/// This is an important base class in LLVM. It provides the common facilities +/// of all constant values in an LLVM program. A constant is a value that is +/// immutable at runtime. Functions are constants because their address is +/// immutable. Same with global variables. +/// +/// All constants share the capabilities provided in this class. All constants +/// can have a null value. They can have an operand list. Constants can be +/// simple (integer and floating point values), complex (arrays and structures), +/// or expression based (computations yielding a constant value composed of +/// only certain operators and other constant values). +/// +/// Note that Constants are immutable (once created they never change) +/// and are fully shared by structural equivalence. This means that two +/// structurally equivalent constants will always have the same address. +/// Constant's are created on demand as needed and never deleted: thus clients +/// don't have to worry about the lifetime of the objects. +/// @brief LLVM Constant Representation class Constant : public User { void operator=(const Constant &); // Do not implement Constant(const Constant &); // Do not implement Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.83 llvm/include/llvm/Value.h:1.84 --- llvm/include/llvm/Value.h:1.83 Wed Jan 25 19:54:21 2006 +++ llvm/include/llvm/Value.h Mon Jun 5 11:29:06 2006 @@ -7,9 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines the very important Value class. This is subclassed by a -// bunch of other important classes, like Instruction, Function, Type, etc... -// +// This file declares the Value class. // This file also defines the Use<> template for users of value. // //===----------------------------------------------------------------------===// @@ -38,9 +36,16 @@ // Value Class //===----------------------------------------------------------------------===// -/// Value - The base class of all values computed by a program that may be used -/// as operands to other values. +/// This is a very important LLVM class. It is the base class of all values +/// computed by a program that may be used as operands to other values. Value is +/// the super class of other important classes such as Instruction and Function. +/// All Values have a Type. Type is not a subclass of Value. All types can have +/// a name and they should belong to some Module. Setting the name on the Value +/// automatically update's the module's symbol table. /// +/// Every value has a "use list" that keeps track of which other Values are +/// using this Value. +/// @brief LLVM Value Representation class Value { unsigned short SubclassID; // Subclass identifier (for isa/dyn_cast) protected: @@ -133,13 +138,10 @@ /// void addUse(Use &U) { U.addToList(&UseList); } - /// getValueType - Return an ID for the concrete type of this object. This is - /// used to implement the classof checks. This should not be used for any - /// other purpose, as the values may change as LLVM evolves. Also, note that - /// starting with the InstructionVal value, the value stored is actually the - /// Instruction opcode, so there are more than just these values possible here - /// (and Instruction must be last). - /// + /// An enumeration for keeping track of the concrete subclass of Value that + /// is actually instantiated. Values of this enumeration are kept in the + /// Value classes SubclassID field. They are used for concrete type + /// identification. enum ValueTy { ArgumentVal, // This is an instance of Argument BasicBlockVal, // This is an instance of BasicBlock @@ -163,6 +165,14 @@ ConstantFirstVal = FunctionVal, ConstantLastVal = ConstantPointerNullVal }; + + /// getValueType - Return an ID for the concrete type of this object. This is + /// used to implement the classof checks. This should not be used for any + /// other purpose, as the values may change as LLVM evolves. Also, note that + /// starting with the InstructionVal value, the value stored is actually the + /// Instruction opcode, so there are more than just these values possible here + /// (and Instruction must be last). + /// unsigned getValueType() const { return SubclassID; } From reid at x10sys.com Mon Jun 5 12:30:29 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 12:30:29 -0500 Subject: [llvm-commits] CVS: llvm/docs/CommandLine.html Message-ID: <200606051730.MAA10903@zion.cs.uiuc.edu> Changes in directory llvm/docs: CommandLine.html updated: 1.40 -> 1.41 --- Log message: Document the cl::SetVersionPrinter function. --- Diffs of the changes: (+24 -1) CommandLine.html | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletion(-) Index: llvm/docs/CommandLine.html diff -u llvm/docs/CommandLine.html:1.40 llvm/docs/CommandLine.html:1.41 --- llvm/docs/CommandLine.html:1.40 Mon Mar 13 23:39:39 2006 +++ llvm/docs/CommandLine.html Mon Jun 5 12:30:16 2006 @@ -60,6 +60,8 @@ cl::ParseCommandLineOptions function
  • The cl::ParseEnvironmentOptions function
  • +
  • The cl::SetVersionPrinter + function
  • The cl::opt class
  • The cl::list class
  • The cl::bits class
  • @@ -1507,6 +1509,27 @@ + +
    + +

    The cl::SetVersionPrinter function is designed to be called +directly from main, and before +cl::ParseCommandLineOptions. Its use is optional. It simply arranges +for a function to be called in response to the --version option instead +of having the CommandLine library print out the usual version string +for LLVM. This is useful for programs that are not part of LLVM but wish to use +the CommandLine facilities. Such programs should just define a small +function that takes no arguments and returns void and that prints out +whatever version information is appropriate for the program. Pass the address +of that function to cl::SetVersionPrinter to arrange for it to be +called when the --version option is given by the user.

    + +
    + + @@ -1900,7 +1923,7 @@ Chris Lattner
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/06/05 17:30:16 $ From rafael.espindola at gmail.com Mon Jun 5 17:26:54 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 5 Jun 2006 17:26:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Message-ID: <200606052226.RAA21146@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelDAGToDAG.cpp updated: 1.10 -> 1.11 --- Log message: add R0 to liveout expand "ret null" (implements test/Regression/CodeGen/ARM/ret_void.ll) note that a Flag link is missing between the copy and the branch --- Diffs of the changes: (+13 -3) ARMISelDAGToDAG.cpp | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.10 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.11 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.10 Tue May 30 12:33:19 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon Jun 5 17:26:14 2006 @@ -49,18 +49,28 @@ static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG) { SDOperand Copy; + SDOperand Chain = Op.getOperand(0); switch(Op.getNumOperands()) { default: assert(0 && "Do not know how to return this many arguments!"); abort(); - case 1: - return SDOperand(); // ret void is legal + case 1: { + SDOperand LR = DAG.getRegister(ARM::R14, MVT::i32); + return DAG.getNode(ISD::BRIND, MVT::Other, Chain, LR); + } case 3: - Copy = DAG.getCopyToReg(Op.getOperand(0), ARM::R0, Op.getOperand(1), SDOperand()); + Copy = DAG.getCopyToReg(Chain, ARM::R0, Op.getOperand(1), SDOperand()); + if (DAG.getMachineFunction().liveout_empty()) + DAG.getMachineFunction().addLiveOut(ARM::R0); break; } + SDOperand LR = DAG.getRegister(ARM::R14, MVT::i32); + //bug: the copy and branch should be linked with a flag so that the + //scheduller can't move an instruction that destroys R0 in between them + //return DAG.getNode(ISD::BRIND, MVT::Other, Copy, LR, Copy.getValue(1)); + return DAG.getNode(ISD::BRIND, MVT::Other, Copy, LR); } From reid at x10sys.com Mon Jun 5 19:00:55 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 19:00:55 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/ToolRunner.h Message-ID: <200606060000.TAA21704@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: ToolRunner.h updated: 1.19 -> 1.20 --- Log message: Add the -Xlinker option to bugpoint which allows an option to be passed through to gcc when its being used as a linker. This allows -L and -l (and any other) options to be added so that non-complete bytecode files can be processed with bugpoint. The -Xlinker option can be added as many times as needed. --- Diffs of the changes: (+9 -2) ToolRunner.h | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Support/ToolRunner.h diff -u llvm/include/llvm/Support/ToolRunner.h:1.19 llvm/include/llvm/Support/ToolRunner.h:1.20 --- llvm/include/llvm/Support/ToolRunner.h:1.19 Thu Apr 21 15:44:59 2005 +++ llvm/include/llvm/Support/ToolRunner.h Mon Jun 5 19:00:42 2006 @@ -63,8 +63,9 @@ FileType fileType, const std::string &InputFile, const std::string &OutputFile, - const std::vector &SharedLibs = - std::vector(), unsigned Timeout = 0); + const std::vector &GCCArgs = + std::vector(), + unsigned Timeout = 0); /// MakeSharedObject - This compiles the specified file (which is either a .c /// file or a .s file) into a shared object. @@ -110,6 +111,8 @@ const std::vector &Args, const std::string &InputFile, const std::string &OutputFile, + const std::vector &GCCArgs = + std::vector(), const std::vector &SharedLibs = std::vector(), unsigned Timeout = 0) = 0; @@ -140,6 +143,8 @@ const std::vector &Args, const std::string &InputFile, const std::string &OutputFile, + const std::vector &GCCArgs = + std::vector(), const std::vector &SharedLibs = std::vector(), unsigned Timeout = 0); @@ -177,6 +182,8 @@ const std::vector &Args, const std::string &InputFile, const std::string &OutputFile, + const std::vector &GCCArgs = + std::vector(), const std::vector &SharedLibs = std::vector(), unsigned Timeout = 0); From reid at x10sys.com Mon Jun 5 19:00:56 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 19:00:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/ToolRunner.cpp Message-ID: <200606060000.TAA21708@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: ToolRunner.cpp updated: 1.50 -> 1.51 --- Log message: Add the -Xlinker option to bugpoint which allows an option to be passed through to gcc when its being used as a linker. This allows -L and -l (and any other) options to be added so that non-complete bytecode files can be processed with bugpoint. The -Xlinker option can be added as many times as needed. --- Diffs of the changes: (+31 -9) ToolRunner.cpp | 40 +++++++++++++++++++++++++++++++--------- 1 files changed, 31 insertions(+), 9 deletions(-) Index: llvm/lib/Support/ToolRunner.cpp diff -u llvm/lib/Support/ToolRunner.cpp:1.50 llvm/lib/Support/ToolRunner.cpp:1.51 --- llvm/lib/Support/ToolRunner.cpp:1.50 Fri Feb 3 23:02:27 2006 +++ llvm/lib/Support/ToolRunner.cpp Mon Jun 5 19:00:42 2006 @@ -88,6 +88,7 @@ const std::vector &Args, const std::string &InputFile, const std::string &OutputFile, + const std::vector &GCCArgs, const std::vector &SharedLibs = std::vector(), unsigned Timeout = 0); @@ -98,12 +99,16 @@ const std::vector &Args, const std::string &InputFile, const std::string &OutputFile, + const std::vector &GCCArgs, const std::vector &SharedLibs, unsigned Timeout) { if (!SharedLibs.empty()) throw ToolExecutionError("LLI currently does not support " "loading shared libraries."); + if (!GCCArgs.empty()) + throw ToolExecutionError("LLI currently does not support " + "GCC Arguments."); std::vector LLIArgs; LLIArgs.push_back(LLIPath.c_str()); LLIArgs.push_back("-force-interpreter=true"); @@ -184,6 +189,7 @@ const std::vector &Args, const std::string &InputFile, const std::string &OutputFile, + const std::vector &ArgsForGCC, const std::vector &SharedLibs, unsigned Timeout) { @@ -191,9 +197,12 @@ OutputAsm(Bytecode, OutputAsmFile); FileRemover OutFileRemover(OutputAsmFile); + std::vector GCCArgs(ArgsForGCC); + GCCArgs.insert(GCCArgs.end(),SharedLibs.begin(),SharedLibs.end()); + // Assuming LLC worked, compile the result with GCC and run it. return gcc->ExecuteProgram(OutputAsmFile.toString(), Args, GCC::AsmFile, - InputFile, OutputFile, SharedLibs, Timeout); + InputFile, OutputFile, GCCArgs, Timeout); } /// createLLC - Try to find the LLC executable @@ -234,8 +243,11 @@ const std::vector &Args, const std::string &InputFile, const std::string &OutputFile, + const std::vector &GCCArgs = + std::vector(), const std::vector &SharedLibs = - std::vector(), unsigned Timeout =0); + std::vector(), + unsigned Timeout =0 ); }; } @@ -243,8 +255,11 @@ const std::vector &Args, const std::string &InputFile, const std::string &OutputFile, + const std::vector &GCCArgs, const std::vector &SharedLibs, unsigned Timeout) { + if (!GCCArgs.empty()) + throw ToolExecutionError("JIT does not support GCC Arguments."); // Construct a vector of parameters, incorporating those from the command-line std::vector JITArgs; JITArgs.push_back(LLIPath.c_str()); @@ -329,6 +344,7 @@ const std::vector &Args, const std::string &InputFile, const std::string &OutputFile, + const std::vector &ArgsForGCC, const std::vector &SharedLibs, unsigned Timeout) { sys::Path OutputCFile; @@ -336,8 +352,10 @@ FileRemover CFileRemove(OutputCFile); + std::vector GCCArgs(ArgsForGCC); + GCCArgs.insert(GCCArgs.end(),SharedLibs.begin(),SharedLibs.end()); return gcc->ExecuteProgram(OutputCFile.toString(), Args, GCC::CFile, - InputFile, OutputFile, SharedLibs, Timeout); + InputFile, OutputFile, GCCArgs, Timeout); } /// createCBE - Try to find the 'llc' executable @@ -369,16 +387,12 @@ FileType fileType, const std::string &InputFile, const std::string &OutputFile, - const std::vector &SharedLibs, - unsigned Timeout) { + const std::vector &ArgsForGCC, + unsigned Timeout ) { std::vector GCCArgs; GCCArgs.push_back(GCCPath.c_str()); - // Specify the shared libraries to link in... - for (unsigned i = 0, e = SharedLibs.size(); i != e; ++i) - GCCArgs.push_back(SharedLibs[i].c_str()); - // Specify -x explicitly in case the extension is wonky GCCArgs.push_back("-x"); if (fileType == CFile) { @@ -395,6 +409,14 @@ sys::Path OutputBinary (ProgramFile+".gcc.exe"); OutputBinary.makeUnique(); GCCArgs.push_back(OutputBinary.c_str()); // Output to the right file... + + // Add any arguments intended for GCC. We locate them here because this is + // most likely -L and -l options that need to come before other libraries but + // after the source. Other options won't be sensitive to placement on the + // command line, so this should be safe. + for (unsigned i = 0, e = ArgsForGCC.size(); i != e; ++i) + GCCArgs.push_back(ArgsForGCC[i].c_str()); + GCCArgs.push_back("-lm"); // Hard-code the math library... GCCArgs.push_back("-O2"); // Optimize the program a bit... #if defined (HAVE_LINK_R) From reid at x10sys.com Mon Jun 5 19:00:56 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Jun 2006 19:00:56 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExecutionDriver.cpp Message-ID: <200606060000.TAA21712@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExecutionDriver.cpp updated: 1.58 -> 1.59 --- Log message: Add the -Xlinker option to bugpoint which allows an option to be passed through to gcc when its being used as a linker. This allows -L and -l (and any other) options to be added so that non-complete bytecode files can be processed with bugpoint. The -Xlinker option can be added as many times as needed. --- Diffs of the changes: (+18 -3) ExecutionDriver.cpp | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.58 llvm/tools/bugpoint/ExecutionDriver.cpp:1.59 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.58 Sun Jan 22 16:53:40 2006 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Mon Jun 5 19:00:42 2006 @@ -20,6 +20,7 @@ #include "llvm/Support/SystemUtils.h" #include #include + using namespace llvm; namespace { @@ -66,6 +67,10 @@ TimeoutValue("timeout", cl::init(300), cl::value_desc("seconds"), cl::desc("Number of seconds program is allowed to run before it " "is killed (default is 300s), 0 disables timeout")); + + cl::list + AdditionalLinkerArgs("Xlinker", + cl::desc("Additional arguments to pass to the linker")); } namespace llvm { @@ -218,9 +223,19 @@ if (!SharedObj.empty()) SharedObjs.push_back(SharedObj); - // Actually execute the program! - int RetVal = AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile, - OutputFile, SharedObjs, TimeoutValue); + + // If this is an LLC or CBE run, then the GCC compiler might get run to + // compile the program. If so, we should pass the user's -Xlinker options + // as the GCCArgs. + int RetVal = 0; + if (InterpreterSel == RunLLC || InterpreterSel == RunCBE) + RetVal = AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile, + OutputFile, AdditionalLinkerArgs, SharedObjs, + TimeoutValue); + else + RetVal = AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile, + OutputFile, std::vector(), + SharedObjs, TimeoutValue); if (RetVal == -1) { std::cerr << ""; From resistor at mac.com Mon Jun 5 23:28:42 2006 From: resistor at mac.com (Owen Anderson) Date: Mon, 5 Jun 2006 23:28:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LCSSA.cpp Message-ID: <200606060428.XAA22798@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LCSSA.cpp updated: 1.13 -> 1.14 --- Log message: Stop a memory leak, and update some comments. --- Diffs of the changes: (+10 -10) LCSSA.cpp | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) Index: llvm/lib/Transforms/Scalar/LCSSA.cpp diff -u llvm/lib/Transforms/Scalar/LCSSA.cpp:1.13 llvm/lib/Transforms/Scalar/LCSSA.cpp:1.14 --- llvm/lib/Transforms/Scalar/LCSSA.cpp:1.13 Sat Jun 3 19:55:19 2006 +++ llvm/lib/Transforms/Scalar/LCSSA.cpp Mon Jun 5 23:28:30 2006 @@ -52,7 +52,7 @@ LoopInfo *LI; // Loop information DominatorTree *DT; // Dominator Tree for the current Function... DominanceFrontier *DF; // Current Dominance Frontier - std::vector *LoopBlocks; + std::vector LoopBlocks; virtual bool runOnFunction(Function &F); bool visitSubloop(Loop* L); @@ -76,8 +76,9 @@ Instruction *getValueDominatingBlock(BasicBlock *BB, std::map& PotDoms); - bool inLoopBlocks(BasicBlock* B) { return std::binary_search( - LoopBlocks->begin(), LoopBlocks->end(), B); } + /// inLoop - returns true if the given block is within the current loop + const bool inLoop(BasicBlock* B) { + return std::binary_search(LoopBlocks.begin(), LoopBlocks.end(), B); } }; RegisterOpt X("lcssa", "Loop-Closed SSA Form Pass"); @@ -90,7 +91,6 @@ LI = &getAnalysis(); DF = &getAnalysis(); DT = &getAnalysis(); - LoopBlocks = new std::vector; for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) { changed |= visitSubloop(*I); @@ -104,9 +104,9 @@ visitSubloop(*I); // Speed up queries by creating a sorted list of blocks - LoopBlocks->clear(); - LoopBlocks->insert(LoopBlocks->end(), L->block_begin(), L->block_end()); - std::sort(LoopBlocks->begin(), LoopBlocks->end()); + LoopBlocks.clear(); + LoopBlocks.insert(LoopBlocks.end(), L->block_begin(), L->block_end()); + std::sort(LoopBlocks.begin(), LoopBlocks.end()); SetVector AffectedValues = getLoopValuesUsedOutsideLoop(L); @@ -127,7 +127,7 @@ processInstruction(*I, exitBlocks); } - return true; // FIXME: Should be more intelligent in our return value. + return true; } /// processInstruction - @@ -205,7 +205,7 @@ UI != UE; ++UI) { Instruction* use = cast(*UI); // Don't need to update uses within the loop body. - if (!inLoopBlocks(use->getParent())) + if (!inLoop(use->getParent())) Uses.push_back(use); } @@ -242,7 +242,7 @@ for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI) { BasicBlock *UserBB = cast(*UI)->getParent(); - if (!std::binary_search(LoopBlocks->begin(), LoopBlocks->end(), UserBB)) + if (!std::binary_search(LoopBlocks.begin(), LoopBlocks.end(), UserBB)) { AffectedValues.insert(I); break; From resistor at mac.com Mon Jun 5 23:36:49 2006 From: resistor at mac.com (Owen Anderson) Date: Mon, 5 Jun 2006 23:36:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LCSSA.cpp Message-ID: <200606060436.XAA22835@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LCSSA.cpp updated: 1.14 -> 1.15 --- Log message: Fix some formatting, and use inLoop() when appropriate. --- Diffs of the changes: (+3 -3) LCSSA.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Scalar/LCSSA.cpp diff -u llvm/lib/Transforms/Scalar/LCSSA.cpp:1.14 llvm/lib/Transforms/Scalar/LCSSA.cpp:1.15 --- llvm/lib/Transforms/Scalar/LCSSA.cpp:1.14 Mon Jun 5 23:28:30 2006 +++ llvm/lib/Transforms/Scalar/LCSSA.cpp Mon Jun 5 23:36:36 2006 @@ -78,7 +78,8 @@ /// inLoop - returns true if the given block is within the current loop const bool inLoop(BasicBlock* B) { - return std::binary_search(LoopBlocks.begin(), LoopBlocks.end(), B); } + return std::binary_search(LoopBlocks.begin(), LoopBlocks.end(), B); + } }; RegisterOpt X("lcssa", "Loop-Closed SSA Form Pass"); @@ -242,8 +243,7 @@ for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI) { BasicBlock *UserBB = cast(*UI)->getParent(); - if (!std::binary_search(LoopBlocks.begin(), LoopBlocks.end(), UserBB)) - { + if (!inLoop(UserBB)) { AffectedValues.insert(I); break; } From lattner at cs.uiuc.edu Tue Jun 6 12:43:15 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 12:43:15 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-config/Makefile Message-ID: <200606061743.MAA03135@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-config: Makefile updated: 1.9 -> 1.10 --- Log message: Make the llvm-config library dependency database depend on all of the libraries. --- Diffs of the changes: (+4 -6) Makefile | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) Index: llvm/tools/llvm-config/Makefile diff -u llvm/tools/llvm-config/Makefile:1.9 llvm/tools/llvm-config/Makefile:1.10 --- llvm/tools/llvm-config/Makefile:1.9 Fri Jun 2 14:13:29 2006 +++ llvm/tools/llvm-config/Makefile Tue Jun 6 12:43:03 2006 @@ -27,12 +27,10 @@ SUB_LDFLAGS = FinalLibDeps = $(PROJ_OBJ_DIR)/FinalLibDeps.txt -LibDeps = $(PROJ_OBJ_DIR)/LibDeps.txt -GenLibDeps = $(PROJ_SRC_ROOT)/utils/GenLibDeps.pl -# MANUAL USE ONLY! GenLibDeps.pl is very non-portable, so LibDeps.txt -# should only be re-built manually. No other rule in this file should -# depend on LibDeps.txt. -$(LibDeps): $(GenLibDeps) $(LibDir) +LibDeps = $(PROJ_OBJ_DIR)/LibDeps.txt +GenLibDeps = $(PROJ_SRC_ROOT)/utils/GenLibDeps.pl + +$(LibDeps): $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a $(LibDir)/*.o) $(Echo) "Regenerating LibDeps.txt" $(Verb) $(GenLibDeps) -flat $(LibDir) | sort > $(LibDeps) From lattner at cs.uiuc.edu Tue Jun 6 16:28:58 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 16:28:58 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/IntrinsicsPowerPC.td Message-ID: <200606062128.QAA05379@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: IntrinsicsPowerPC.td updated: 1.24 -> 1.25 --- Log message: Add PowerPC intrinsics to support dcbz[l] --- Diffs of the changes: (+9 -0) IntrinsicsPowerPC.td | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/include/llvm/IntrinsicsPowerPC.td diff -u llvm/include/llvm/IntrinsicsPowerPC.td:1.24 llvm/include/llvm/IntrinsicsPowerPC.td:1.25 --- llvm/include/llvm/IntrinsicsPowerPC.td:1.24 Mon Apr 10 17:02:38 2006 +++ llvm/include/llvm/IntrinsicsPowerPC.td Tue Jun 6 16:28:46 2006 @@ -15,6 +15,15 @@ // Definitions for all PowerPC intrinsics. // +// Non-altivec intrinsics. +let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". + // dcbz instruction. + def int_ppc_dcbz : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>; + // dcbzl (PPC970) instruction. + def int_ppc_dcbzl : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>; +} + + let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.". /// PowerPC_Vec_Intrinsic - Base class for all altivec intrinsics. class PowerPC_Vec_Intrinsic types, From lattner at cs.uiuc.edu Tue Jun 6 16:29:35 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 16:29:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrFormats.td PPCInstrInfo.td Message-ID: <200606062129.QAA05490@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstrFormats.td updated: 1.73 -> 1.74 PPCInstrInfo.td updated: 1.220 -> 1.221 --- Log message: Add PowerPC intrinsics to support dcbz[l] --- Diffs of the changes: (+25 -0) PPCInstrFormats.td | 17 +++++++++++++++++ PPCInstrInfo.td | 8 ++++++++ 2 files changed, 25 insertions(+) Index: llvm/lib/Target/PowerPC/PPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.73 llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.74 --- llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.73 Wed Apr 5 17:27:14 2006 +++ llvm/lib/Target/PowerPC/PPCInstrFormats.td Tue Jun 6 16:29:23 2006 @@ -325,6 +325,23 @@ : XForm_base_r3xo { } +// DCB_Form - Form X instruction, used for dcb* instructions. +class DCB_Form xo, bits<5> immfield, dag OL, string asmstr, + InstrItinClass itin, list pattern> + : I<31, OL, asmstr, itin> { + bits<5> A; + bits<5> B; + + let Pattern = pattern; + + let Inst{6-10} = immfield; + let Inst{11-15} = A; + let Inst{16-20} = B; + let Inst{21-30} = xo; + let Inst{31} = 0; +} + + // DSS_Form - Form X instruction, used for altivec dss* instructions. class DSS_Form xo, dag OL, string asmstr, InstrItinClass itin, list pattern> Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.220 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.221 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.220 Wed May 17 14:00:46 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Jun 6 16:29:23 2006 @@ -318,6 +318,14 @@ [(PPCbctrl)]>; } +// DCB* instructions. +def DCBZ : DCB_Form<1014, 0, (ops memrr:$dst), + "dcbz $dst", LdStDCBF, [(int_ppc_dcbz xoaddr:$dst)]>, + PPC970_DGroup_Single; +def DCBZL : DCB_Form<1014, 1, (ops memrr:$dst), + "dcbzl $dst", LdStDCBF, [(int_ppc_dcbzl xoaddr:$dst)]>, + PPC970_DGroup_Single; + // D-Form instructions. Most instructions that perform an operation on a // register and an immediate are of this type. // From lattner at cs.uiuc.edu Tue Jun 6 16:46:00 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 16:46:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200606062146.QAA05751@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.264 -> 1.265 --- Log message: Now that PR633: http://llvm.cs.uiuc.edu/PR633 is implemented, the CBE can know to emit _setjmp/_longjmp when available. This speeds up hexxagon from 18.61s to 16.61s with the CBE on PPC Mac OS (for reference, LLC is 15.48s and GCC is 23.35s). --- Diffs of the changes: (+6 -0) Writer.cpp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.264 llvm/lib/Target/CBackend/Writer.cpp:1.265 --- llvm/lib/Target/CBackend/Writer.cpp:1.264 Fri Jun 2 13:54:01 2006 +++ llvm/lib/Target/CBackend/Writer.cpp Tue Jun 6 16:45:47 2006 @@ -1779,11 +1779,17 @@ Out << ')'; return; case Intrinsic::setjmp: +#if defined(HAVE__SETJMP) && defined(HAVE__LONGJMP) + Out << "_"; // Use _setjmp on systems that support it! +#endif Out << "setjmp(*(jmp_buf*)"; writeOperand(I.getOperand(1)); Out << ')'; return; case Intrinsic::longjmp: +#if defined(HAVE__SETJMP) && defined(HAVE__LONGJMP) + Out << "_"; // Use _longjmp on systems that support it! +#endif Out << "longjmp(*(jmp_buf*)"; writeOperand(I.getOperand(1)); Out << ", "; From lattner at cs.uiuc.edu Tue Jun 6 17:26:15 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 17:26:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200606062226.RAA06087@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.489 -> 1.490 --- Log message: Fix a bug in a recent patch. This fixes UnitTests/Vector/Altivec/casts.c on PPC/altivec --- Diffs of the changes: (+1 -1) InstructionCombining.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.489 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.490 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.489 Wed May 31 16:14:00 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jun 6 17:26:02 2006 @@ -5169,7 +5169,7 @@ if (((Tmp = dyn_cast(SVI->getOperand(0))) && Tmp->getOperand(0)->getType() == CI.getType()) || ((Tmp = dyn_cast(SVI->getOperand(1))) && - Tmp->getOperand(1)->getType() == CI.getType())) { + Tmp->getOperand(0)->getType() == CI.getType())) { Value *LHS = InsertOperandCastBefore(SVI->getOperand(0), CI.getType(), &CI); Value *RHS = InsertOperandCastBefore(SVI->getOperand(1), From lattner at cs.uiuc.edu Tue Jun 6 17:31:12 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 17:31:12 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp CrashDebugger.cpp ExecutionDriver.cpp ToolRunner.cpp ToolRunner.h bugpoint.cpp Message-ID: <200606062231.RAA06232@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: BugDriver.cpp updated: 1.44 -> 1.45 CrashDebugger.cpp updated: 1.47 -> 1.48 ExecutionDriver.cpp updated: 1.59 -> 1.60 ToolRunner.cpp updated: 1.51 -> 1.52 ToolRunner.h updated: 1.20 -> 1.21 bugpoint.cpp updated: 1.28 -> 1.29 --- Log message: Move ToolRunner.(cpp|h) into the bugpoint directory --- Diffs of the changes: (+8 -9) BugDriver.cpp | 2 +- CrashDebugger.cpp | 2 +- ExecutionDriver.cpp | 2 +- ToolRunner.cpp | 2 +- ToolRunner.h | 7 +++---- bugpoint.cpp | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) Index: llvm/tools/bugpoint/BugDriver.cpp diff -u llvm/tools/bugpoint/BugDriver.cpp:1.44 llvm/tools/bugpoint/BugDriver.cpp:1.45 --- llvm/tools/bugpoint/BugDriver.cpp:1.44 Sun May 14 14:15:56 2006 +++ llvm/tools/bugpoint/BugDriver.cpp Tue Jun 6 17:30:59 2006 @@ -14,12 +14,12 @@ //===----------------------------------------------------------------------===// #include "BugDriver.h" +#include "ToolRunner.h" #include "llvm/Linker.h" #include "llvm/Module.h" #include "llvm/Pass.h" #include "llvm/Assembly/Parser.h" #include "llvm/Bytecode/Reader.h" -#include "llvm/Support/ToolRunner.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileUtilities.h" #include Index: llvm/tools/bugpoint/CrashDebugger.cpp diff -u llvm/tools/bugpoint/CrashDebugger.cpp:1.47 llvm/tools/bugpoint/CrashDebugger.cpp:1.48 --- llvm/tools/bugpoint/CrashDebugger.cpp:1.47 Thu Mar 16 17:16:17 2006 +++ llvm/tools/bugpoint/CrashDebugger.cpp Tue Jun 6 17:30:59 2006 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "BugDriver.h" +#include "ToolRunner.h" #include "ListReducer.h" #include "llvm/Constant.h" #include "llvm/Instructions.h" @@ -23,7 +24,6 @@ #include "llvm/Analysis/Verifier.h" #include "llvm/Bytecode/Writer.h" #include "llvm/Support/CFG.h" -#include "llvm/Support/ToolRunner.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Support/FileUtilities.h" Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.59 llvm/tools/bugpoint/ExecutionDriver.cpp:1.60 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.59 Mon Jun 5 19:00:42 2006 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Tue Jun 6 17:30:59 2006 @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include "BugDriver.h" -#include "llvm/Support/ToolRunner.h" +#include "ToolRunner.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/FileUtilities.h" Index: llvm/tools/bugpoint/ToolRunner.cpp diff -u llvm/tools/bugpoint/ToolRunner.cpp:1.51 llvm/tools/bugpoint/ToolRunner.cpp:1.52 --- llvm/tools/bugpoint/ToolRunner.cpp:1.51 Mon Jun 5 19:00:42 2006 +++ llvm/tools/bugpoint/ToolRunner.cpp Tue Jun 6 17:30:59 2006 @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #define DEBUG_TYPE "toolrunner" -#include "llvm/Support/ToolRunner.h" +#include "ToolRunner.h" #include "llvm/Config/config.h" // for HAVE_LINK_R #include "llvm/System/Program.h" #include "llvm/Support/Debug.h" Index: llvm/tools/bugpoint/ToolRunner.h diff -u llvm/tools/bugpoint/ToolRunner.h:1.20 llvm/tools/bugpoint/ToolRunner.h:1.21 --- llvm/tools/bugpoint/ToolRunner.h:1.20 Mon Jun 5 19:00:42 2006 +++ llvm/tools/bugpoint/ToolRunner.h Tue Jun 6 17:30:59 2006 @@ -1,4 +1,4 @@ -//===-- llvm/Support/ToolRunner.h -------------------------------*- C++ -*-===// +//===-- tools/bugpoint/ToolRunner.h -----------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -14,8 +14,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_TOOLRUNNER_H -#define LLVM_SUPPORT_TOOLRUNNER_H +#ifndef BUGPOINT_TOOLRUNNER_H +#define BUGPOINT_TOOLRUNNER_H #include "llvm/Support/SystemUtils.h" #include @@ -26,7 +26,6 @@ class CBE; class LLC; - /// ToolExecutionError - An instance of this class is thrown by the /// AbstractInterpreter instances if there is an error running a tool (e.g., LLC /// crashes) which prevents execution of the program. Index: llvm/tools/bugpoint/bugpoint.cpp diff -u llvm/tools/bugpoint/bugpoint.cpp:1.28 llvm/tools/bugpoint/bugpoint.cpp:1.29 --- llvm/tools/bugpoint/bugpoint.cpp:1.28 Mon Mar 13 23:54:51 2006 +++ llvm/tools/bugpoint/bugpoint.cpp Tue Jun 6 17:30:59 2006 @@ -14,10 +14,10 @@ //===----------------------------------------------------------------------===// #include "BugDriver.h" +#include "ToolRunner.h" #include "llvm/Analysis/LinkAllAnalyses.h" #include "llvm/Transforms/LinkAllPasses.h" #include "llvm/Support/PassNameParser.h" -#include "llvm/Support/ToolRunner.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/PluginLoader.h" #include "llvm/System/Process.h" From lattner at cs.uiuc.edu Tue Jun 6 17:31:48 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 17:31:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/ToolRunner.cpp Message-ID: <200606062231.RAA06243@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: ToolRunner.cpp (r1.51) removed --- Log message: Move toolrunner out of libsupport into the bugpoint tool --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Tue Jun 6 17:31:49 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 17:31:49 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/ToolRunner.h Message-ID: <200606062231.RAA06247@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: ToolRunner.h (r1.20) removed --- Log message: Move toolrunner out of libsupport into the bugpoint tool --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Tue Jun 6 17:38:41 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 17:38:41 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-config/llvm-config.in.in Message-ID: <200606062238.RAA06325@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-config: llvm-config.in.in updated: 1.15 -> 1.16 --- Log message: Add a new --libfiles option, for getting fully-qualified pathnames to libraries. This can be used for tools that want makefile rules to depend on the libraries (e.g. so the tool is relinked when a library changes). --- Diffs of the changes: (+19 -7) llvm-config.in.in | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) Index: llvm/tools/llvm-config/llvm-config.in.in diff -u llvm/tools/llvm-config/llvm-config.in.in:1.15 llvm/tools/llvm-config/llvm-config.in.in:1.16 --- llvm/tools/llvm-config/llvm-config.in.in:1.15 Fri Jun 2 18:43:27 2006 +++ llvm/tools/llvm-config/llvm-config.in.in Tue Jun 6 17:38:29 2006 @@ -81,6 +81,7 @@ sub usage; sub fix_library_names (@); +sub fix_library_files (@); sub expand_dependecies (@); sub name_map_entries; @@ -90,6 +91,7 @@ my $has_opt = 0; my $want_libs = 0; my $want_libnames = 0; +my $want_libfiles = 0; my $want_components = 0; foreach my $arg (@ARGV) { if ($arg =~ /^-/) { @@ -113,6 +115,8 @@ $has_opt = 1; $want_libs = 1; } elsif ($arg eq "--libnames") { $has_opt = 1; $want_libnames = 1; + } elsif ($arg eq "--libfiles") { + $has_opt = 1; $want_libfiles = 1; } elsif ($arg eq "--components") { $has_opt = 1; print join(' ', name_map_entries), "\n"; } elsif ($arg eq "--targets-built") { @@ -140,14 +144,11 @@ } # Handle any arguments which require building our dependency graph. -if ($want_libs || $want_libnames) { +if ($want_libs || $want_libnames || $want_libfiles) { my @libs = expand_dependecies(@components); - if ($want_libs) { - print join(' ', fix_library_names(@libs)), "\n"; - } - if ($want_libnames) { - print join(' ', @libs), "\n"; - } + print join(' ', fix_library_names(@libs)), "\n" if ($want_libs); + print join(' ', @libs), "\n" if ($want_libnames); + print join(' ', fix_library_files(@libs)), "\n" if ($want_libfiles); } exit 0; @@ -178,6 +179,7 @@ --ldflags Print Linker flags. --libs Libraries needed to link against LLVM components. --libnames Bare library names for in-tree builds. + --libfiles Fully qualified library filenames for makefile depends. --components List of all possible components. --targets-built List of all targets currently built. --build-mode Print build mode of LLVM tree (e.g. Debug or Release). @@ -206,6 +208,16 @@ return @result; } +# Turn the list of libraries into a list of files. +sub fix_library_files(@) { + my @libs = @_; + my @result; + foreach my $lib (@libs) { + # Transform the bare library name into a filename. + push @result, "$LIBDIR/$lib"; + } + return @result; +} #========================================================================== # Library Dependency Analysis From lattner at cs.uiuc.edu Tue Jun 6 17:40:11 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 17:40:11 -0500 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/llvm-config.pod Message-ID: <200606062240.RAA06392@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: llvm-config.pod updated: 1.1 -> 1.2 --- Log message: document --libfiles --- Diffs of the changes: (+6 -0) llvm-config.pod | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/docs/CommandGuide/llvm-config.pod diff -u llvm/docs/CommandGuide/llvm-config.pod:1.1 llvm/docs/CommandGuide/llvm-config.pod:1.2 --- llvm/docs/CommandGuide/llvm-config.pod:1.1 Thu Mar 23 17:22:16 2006 +++ llvm/docs/CommandGuide/llvm-config.pod Tue Jun 6 17:39:59 2006 @@ -69,6 +69,12 @@ without B<-l> or pathnames. Useful for linking against a not-yet-installed copy of LLVM. +=item B<--libfiles> + +Similar to B<--libs>, but print the full path to each library file. This is +useful when creating makefile dependencies, to ensure that a tool is relinked if +any library it uses changes. + =item B<--components> Print all valid component names. From evan.cheng at apple.com Tue Jun 6 18:30:37 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 6 Jun 2006 18:30:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86MachineFunctionInfo.h X86ISelLowering.cpp X86RegisterInfo.cpp Message-ID: <200606062330.SAA06987@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86MachineFunctionInfo.h added (r1.1) X86ISelLowering.cpp updated: 1.226 -> 1.227 X86RegisterInfo.cpp updated: 1.156 -> 1.157 --- Log message: Added X86FunctionInfo subclass of MachineFunction to record whether the function that is being lowered is forced to use FP. Currently this is only true for main() / Cygwin. --- Diffs of the changes: (+41 -7) X86ISelLowering.cpp | 8 ++++++++ X86MachineFunctionInfo.h | 30 ++++++++++++++++++++++++++++++ X86RegisterInfo.cpp | 10 +++------- 3 files changed, 41 insertions(+), 7 deletions(-) Index: llvm/lib/Target/X86/X86MachineFunctionInfo.h diff -c /dev/null llvm/lib/Target/X86/X86MachineFunctionInfo.h:1.1 *** /dev/null Tue Jun 6 18:30:35 2006 --- llvm/lib/Target/X86/X86MachineFunctionInfo.h Tue Jun 6 18:30:24 2006 *************** *** 0 **** --- 1,30 ---- + //====- X86MachineFuctionInfo.h - X86 machine function info -----*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the Evan Cheng and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file declares X86-specific per-machine-function information. + // + //===----------------------------------------------------------------------===// + + #ifndef X86MACHINEFUNCTIONINFO_H + #define X86MACHINEFUNCTIONINFO_H + + #include "llvm/CodeGen/MachineFunction.h" + + namespace llvm { + + class X86FunctionInfo : public MachineFunctionInfo { + bool ForceFramePointer; // Function requires use of frame pointer. + public: + X86FunctionInfo(MachineFunction& MF) : ForceFramePointer(false) {} + bool getForceFramePointer() const { return ForceFramePointer;} + void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; } + }; + } // End llvm namespace + + #endif Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.226 llvm/lib/Target/X86/X86ISelLowering.cpp:1.227 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.226 Thu Jun 1 00:53:27 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Jun 6 18:30:24 2006 @@ -15,6 +15,7 @@ #include "X86.h" #include "X86InstrBuilder.h" #include "X86ISelLowering.h" +#include "X86MachineFunctionInfo.h" #include "X86TargetMachine.h" #include "llvm/CallingConv.h" #include "llvm/Constants.h" @@ -3409,6 +3410,13 @@ SDOperand X86TargetLowering::LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG) { + MachineFunction &MF = DAG.getMachineFunction(); + const Function* Fn = MF.getFunction(); + if (Fn->hasExternalLinkage() && + Fn->getName() == "main" && + Subtarget->TargetType == X86Subtarget::isCygwin) + MF.getInfo()->setForceFramePointer(true); + unsigned CC = cast(Op.getOperand(1))->getValue(); if (CC == CallingConv::Fast && EnableFastCC) return LowerFastCCArguments(Op, DAG); Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.156 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.157 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.156 Fri Jun 2 17:38:37 2006 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Tue Jun 6 18:30:24 2006 @@ -15,8 +15,9 @@ #include "X86.h" #include "X86RegisterInfo.h" #include "X86Subtarget.h" -#include "X86TargetMachine.h" #include "X86InstrBuilder.h" +#include "X86MachineFunctionInfo.h" +#include "X86TargetMachine.h" #include "llvm/Constants.h" #include "llvm/Type.h" #include "llvm/Function.h" @@ -638,14 +639,9 @@ // if frame pointer elimination is disabled. // static bool hasFP(MachineFunction &MF) { - const Function* Fn = MF.getFunction(); - const X86Subtarget* Subtarget = &MF.getTarget().getSubtarget(); - return (NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects() || - (Fn->hasExternalLinkage() && - Fn->getName() == "main" && - Subtarget->TargetType == X86Subtarget::isCygwin)); + MF.getInfo()->getForceFramePointer()); } void X86RegisterInfo:: From lattner at cs.uiuc.edu Tue Jun 6 18:54:27 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 18:54:27 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-config/llvm-config.in.in Message-ID: <200606062354.SAA07141@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-config: llvm-config.in.in updated: 1.16 -> 1.17 --- Log message: Fix a bug in the following scenario. 1. llvm is built with objroot = OBJ and installed. 2. OBJ is deleted or install tree is shipped. 3. llvm-config is run. In this scenario, llvm-config shouldn't emit an error message at #3, it should just know it's not running in the objdir :) --- Diffs of the changes: (+2 -1) llvm-config.in.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/tools/llvm-config/llvm-config.in.in diff -u llvm/tools/llvm-config/llvm-config.in.in:1.16 llvm/tools/llvm-config/llvm-config.in.in:1.17 --- llvm/tools/llvm-config/llvm-config.in.in:1.16 Tue Jun 6 17:38:29 2006 +++ llvm/tools/llvm-config/llvm-config.in.in Tue Jun 6 18:54:15 2006 @@ -63,7 +63,8 @@ chomp($ABS_RUN_DIR); # Compute the absolute object directory build, e.g. "foo/llvm/Debug". -my $ABS_OBJ_ROOT = `cd $LLVM_OBJ_ROOT/$LLVM_BUILDMODE; pwd`; +my $ABS_OBJ_ROOT = "$LLVM_OBJ_ROOT/$LLVM_BUILDMODE"; +$ABS_OBJ_ROOT = `cd $ABS_OBJ_ROOT; pwd` if (-d $ABS_OBJ_ROOT); chomp($ABS_OBJ_ROOT); my $INCLUDEDIR = "$ABS_RUN_DIR/include"; From evan.cheng at apple.com Tue Jun 6 19:05:30 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 6 Jun 2006 19:05:30 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Makefile.multisrc Message-ID: <200606070005.TAA07251@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource: Makefile.multisrc updated: 1.52 -> 1.53 --- Log message: Clean up makefiles. --- Diffs of the changes: (+5 -5) Makefile.multisrc | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-test/MultiSource/Makefile.multisrc diff -u llvm-test/MultiSource/Makefile.multisrc:1.52 llvm-test/MultiSource/Makefile.multisrc:1.53 --- llvm-test/MultiSource/Makefile.multisrc:1.52 Mon Feb 27 16:10:13 2006 +++ llvm-test/MultiSource/Makefile.multisrc Tue Jun 6 19:05:16 2006 @@ -29,16 +29,16 @@ .PRECIOUS: $(LObjects) $(NObjects) Output/%.linked.rll Output/%.o: %.c Output/.dir - -$(CC) $(CPPFLAGS) $(CFLAGS) -O2 $(TARGET_CFLAGS) -c $< -o $@ + -$(CC) $(CPPFLAGS) $(CFLAGS) -O2 $(TARGET_FLAGS) -c $< -o $@ Output/%.o: %.C Output/.dir - -$(CC) $(CPPFLAGS) $(CXXFLAGS) -O2 $(TARGET_CFLAGS) -c $< -o $@ + -$(CC) $(CPPFLAGS) $(CXXFLAGS) -O2 $(TARGET_FLAGS) -c $< -o $@ Output/%.o: %.cpp Output/.dir - -$(CC) $(CPPFLAGS) $(CXXFLAGS) -O2 $(TARGET_CFLAGS) -c $< -o $@ + -$(CC) $(CPPFLAGS) $(CXXFLAGS) -O2 $(TARGET_FLAGS) -c $< -o $@ Output/%.o: %.cc Output/.dir - -$(CC) $(CPPFLAGS) $(CXXFLAGS) -O2 $(TARGET_CFLAGS) -c $< -o $@ + -$(CC) $(CPPFLAGS) $(CXXFLAGS) -O2 $(TARGET_FLAGS) -c $< -o $@ bugpoint-gccas: Output/$(PROG).bugpoint-gccas bugpoint-gccld: Output/$(PROG).bugpoint-gccld @@ -72,4 +72,4 @@ endif Output/%.native: $(NObjects) - -$(CXX) -o $@ $(NObjects) $(LDFLAGS) $(CFLAGS) + -$(CXX) -o $@ $(NObjects) $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS) From evan.cheng at apple.com Tue Jun 6 19:05:30 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 6 Jun 2006 19:05:30 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Vector/Altivec/Makefile Message-ID: <200606070005.TAA07253@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Vector/Altivec: Makefile updated: 1.1 -> 1.2 --- Log message: Clean up makefiles. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/Vector/Altivec/Makefile diff -u llvm-test/SingleSource/UnitTests/Vector/Altivec/Makefile:1.1 llvm-test/SingleSource/UnitTests/Vector/Altivec/Makefile:1.2 --- llvm-test/SingleSource/UnitTests/Vector/Altivec/Makefile:1.1 Sun Mar 26 23:54:05 2006 +++ llvm-test/SingleSource/UnitTests/Vector/Altivec/Makefile Tue Jun 6 19:05:16 2006 @@ -4,5 +4,5 @@ LEVEL = ../../../.. include $(LEVEL)/SingleSource/Makefile.singlesrc -TARGET_CFLAGS += -maltivec +TARGET_FLAGS += -maltivec LCCFLAGS += -maltivec From evan.cheng at apple.com Tue Jun 6 19:05:31 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 6 Jun 2006 19:05:31 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Makefile.singlesrc Message-ID: <200606070005.TAA07259@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource: Makefile.singlesrc updated: 1.29 -> 1.30 --- Log message: Clean up makefiles. --- Diffs of the changes: (+2 -2) Makefile.singlesrc | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-test/SingleSource/Makefile.singlesrc diff -u llvm-test/SingleSource/Makefile.singlesrc:1.29 llvm-test/SingleSource/Makefile.singlesrc:1.30 --- llvm-test/SingleSource/Makefile.singlesrc:1.29 Fri Feb 17 18:02:32 2006 +++ llvm-test/SingleSource/Makefile.singlesrc Tue Jun 6 19:05:16 2006 @@ -35,6 +35,6 @@ # FIXME: LIBS should be specified, not hardcoded to -lm Output/%.native: $(SourceDir)/%.c Output/.dir - -$(CC) $(CFLAGS) -O2 $(TARGET_CFLAGS) $< -lm -o $@ $(LDFLAGS) + -$(CC) $(CFLAGS) -O2 $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) Output/%.native: $(SourceDir)/%.cpp Output/.dir - -$(CXX) $(CXXFLAGS) -O2 $(TARGET_CFLAGS) $< -lm -o $@ $(LDFLAGS) + -$(CXX) $(CXXFLAGS) -O2 $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) From evan.cheng at apple.com Tue Jun 6 19:05:32 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 6 Jun 2006 19:05:32 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Vector/SSE/Makefile Message-ID: <200606070005.TAA07271@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Vector/SSE: Makefile updated: 1.1 -> 1.2 --- Log message: Clean up makefiles. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/Vector/SSE/Makefile diff -u llvm-test/SingleSource/UnitTests/Vector/SSE/Makefile:1.1 llvm-test/SingleSource/UnitTests/Vector/SSE/Makefile:1.2 --- llvm-test/SingleSource/UnitTests/Vector/SSE/Makefile:1.1 Mon Apr 3 19:47:54 2006 +++ llvm-test/SingleSource/UnitTests/Vector/SSE/Makefile Tue Jun 6 19:05:16 2006 @@ -4,5 +4,5 @@ LEVEL = ../../../.. include $(LEVEL)/SingleSource/Makefile.singlesrc -TARGET_CFLAGS += -msse3 +TARGET_FLAGS += -msse3 LCCFLAGS += -msse3 From evan.cheng at apple.com Tue Jun 6 19:05:32 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 6 Jun 2006 19:05:32 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs Makefile.rules Makefile.tests Message-ID: <200606070005.TAA07267@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.213 -> 1.214 Makefile.rules updated: 1.11 -> 1.12 Makefile.tests updated: 1.7 -> 1.8 --- Log message: Clean up makefiles. --- Diffs of the changes: (+19 -16) Makefile.programs | 10 +++------- Makefile.rules | 17 ++++++++++++----- Makefile.tests | 8 ++++---- 3 files changed, 19 insertions(+), 16 deletions(-) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.213 llvm-test/Makefile.programs:1.214 --- llvm-test/Makefile.programs:1.213 Thu May 25 03:38:21 2006 +++ llvm-test/Makefile.programs Tue Jun 6 19:05:16 2006 @@ -203,10 +203,6 @@ LLCBETAOPTION := -enable-sparc-v9-insts endif -ifeq ($(OS),Darwin) -TARGET_CFLAGS := -mdynamic-no-pic -fomit-frame-pointer -endif - # Given a version of the entire program linked together into a single unit of # raw output from the C frontend, optimize it. $(PROGRAMS_TO_TEST:%=Output/%.linked.bc): \ @@ -282,7 +278,7 @@ $(PROGRAMS_TO_TEST:%=Output/%.cbe): \ Output/%.cbe: Output/%.cbe.c - -$(CC) $< $(LDFLAGS) $(CFLAGS) -fno-strict-aliasing -O2 $(TARGET_CFLAGS) -o $@ + -$(CC) $< $(LDFLAGS) $(CFLAGS) -fno-strict-aliasing -O2 $(TARGET_FLAGS) -o $@ # # Compile a linked program to machine code with LLC. @@ -308,11 +304,11 @@ # $(PROGRAMS_TO_TEST:%=Output/%.llc): \ Output/%.llc: Output/%.llc.s - -$(CC) $(CFLAGS) $< $(LLCLIBS) $(LLCASSEMBLERFLAGS) $(LDFLAGS) -o $@ + -$(CC) $(CFLAGS) $< $(LLCLIBS) $(LLCASSEMBLERFLAGS) $(TARGET_FLAGS) $(LDFLAGS) -o $@ $(PROGRAMS_TO_TEST:%=Output/%.llc-beta): \ Output/%.llc-beta: Output/%.llc-beta.s - -$(CC) $(CFLAGS) $< $(LLCLIBS) $(LLCASSEMBLERFLAGS) $(LDFLAGS) -o $@ + -$(CC) $(CFLAGS) $< $(LLCLIBS) $(LLCASSEMBLERFLAGS) $(TARGET_FLAGS) $(LDFLAGS) -o $@ # Index: llvm-test/Makefile.rules diff -u llvm-test/Makefile.rules:1.11 llvm-test/Makefile.rules:1.12 --- llvm-test/Makefile.rules:1.11 Sun Apr 9 15:43:17 2006 +++ llvm-test/Makefile.rules Tue Jun 6 19:05:16 2006 @@ -315,14 +315,21 @@ # Pull in limit macros from stdint.h, even in C++: CPPFLAGS += -D__STDC_LIMIT_MACROS -CompileCommonOpts := CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions +ifeq ($(OS),Darwin) +TARGET_FLAGS := -mdynamic-no-pic -fomit-frame-pointer +endif + +ifdef EXTRA_FLAGS +TARGET_FLAGS += $(EXTRA_FLAGS) +endif + # # Compile commands with libtool. # -Compile := $(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts) -CompileC := $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(CompileCommonOpts) +Compile := $(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) +CompileC := $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) # Compile a cpp file, don't link... CompileG := $(Compile) -g -D_DEBUG @@ -782,11 +789,11 @@ $(PROJ_OBJ_DIR)/BytecodeObj/%.bc: %.cpp $(PROJ_OBJ_DIR)/BytecodeObj/.dir $(LCC1XX) @${ECHO} "Compiling `basename $<` to bytecode" - $(VERB) $(LLVMGXX) $(CompileCommonOpts) $(CPPFLAGS) -c $< -o $@ + $(VERB) $(LLVMGXX) $(CPPFLAGS) -c $< -o $@ $(PROJ_OBJ_DIR)/BytecodeObj/%.bc: %.c $(PROJ_OBJ_DIR)/BytecodeObj/.dir $(LCC1) @${ECHO} "Compiling `basename $<` to bytecode" - $(VERB) $(LLVMGCC) $(CompileCommonOpts) $(CPPFLAGS) -c $< -o $@ + $(VERB) $(LLVMGCC) $(CPPFLAGS) -c $< -o $@ $(PROJ_OBJ_DIR)/BytecodeObj/%.bc: %.ll $(PROJ_OBJ_DIR)/BytecodeObj/.dir $(LLVMAS) @${ECHO} "Compiling `basename $<` to bytecode" Index: llvm-test/Makefile.tests diff -u llvm-test/Makefile.tests:1.7 llvm-test/Makefile.tests:1.8 --- llvm-test/Makefile.tests:1.7 Mon Feb 27 16:09:31 2006 +++ llvm-test/Makefile.tests Tue Jun 6 19:05:16 2006 @@ -50,19 +50,19 @@ # Compile from X.c to Output/X.ll Output/%.ll: %.c $(LCC1) Output/.dir $(INCLUDES) - -$(LLVMGCC) $(CPPFLAGS) $(LCCFLAGS) -S $< -o $@ -emit-llvm + -$(LLVMGCC) $(CPPFLAGS) $(LCCFLAGS) $(TARGET_FLAGS) -S $< -o $@ -emit-llvm # Compile from X.cpp to Output/X.ll Output/%.ll: %.cpp $(LCC1XX) Output/.dir $(INCLUDES) - -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) -S $< -o $@ -emit-llvm + -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -S $< -o $@ -emit-llvm # Compile from X.cc to Output/X.ll Output/%.ll: %.cc $(LCC1XX) Output/.dir $(INCLUDES) - -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) -S $< -o $@ -emit-llvm + -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -S $< -o $@ -emit-llvm # Compile from X.C to Output/X.ll Output/%.ll: %.C $(LCC1XX) Output/.dir $(INCLUDES) - -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) -S $< -o $@ -emit-llvm + -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -S $< -o $@ -emit-llvm # LLVM Assemble from Output/X.ll to Output/X.bc. Output/X.ll must have come # from GCC output, so use GCCAS. From lattner at cs.uiuc.edu Tue Jun 6 19:43:30 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 6 Jun 2006 19:43:30 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-config/llvm-config.in.in Message-ID: <200606070043.TAA07449@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-config: llvm-config.in.in updated: 1.17 -> 1.18 --- Log message: Remove useless noop argument --- Diffs of the changes: (+0 -2) llvm-config.in.in | 2 -- 1 files changed, 2 deletions(-) Index: llvm/tools/llvm-config/llvm-config.in.in diff -u llvm/tools/llvm-config/llvm-config.in.in:1.17 llvm/tools/llvm-config/llvm-config.in.in:1.18 --- llvm/tools/llvm-config/llvm-config.in.in:1.17 Tue Jun 6 18:54:15 2006 +++ llvm/tools/llvm-config/llvm-config.in.in Tue Jun 6 19:43:18 2006 @@ -98,8 +98,6 @@ if ($arg =~ /^-/) { if ($arg eq "--version") { $has_opt = 1; print "$VERSION\n"; - } elsif ($arg eq "--use-current-dir-as-prefix") { - # NOOP, remove! } elsif ($arg eq "--prefix") { $has_opt = 1; print "$PREFIX\n"; } elsif ($arg eq "--bindir") { From evan.cheng at apple.com Wed Jun 7 00:28:19 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 7 Jun 2006 00:28:19 -0500 Subject: [llvm-commits] CVS: llvm/utils/NightlyTest.pl Message-ID: <200606070528.AAA08695@zion.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTest.pl updated: 1.107 -> 1.108 --- Log message: Add -extraflags FLAGS to pass extra compilation options. --- Diffs of the changes: (+6 -1) NightlyTest.pl | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/utils/NightlyTest.pl diff -u llvm/utils/NightlyTest.pl:1.107 llvm/utils/NightlyTest.pl:1.108 --- llvm/utils/NightlyTest.pl:1.107 Fri Apr 14 08:53:56 2006 +++ llvm/utils/NightlyTest.pl Wed Jun 7 00:28:07 2006 @@ -43,6 +43,8 @@ # override the default. # -ldflags Next argument specifies that linker options that override # the default. +# -extraflags Next argument specifies extra options that are passed to +# compile the tests. # # ---------------- Options to configure llvm-test ---------------------------- # -spec2000path Path to the benchspec directory in the SPEC 2000 distro @@ -312,7 +314,7 @@ $CONFIGUREARGS .= " --with-f2c=$ARGV[0]"; shift; next; } if (/^-with-externals/) { - $CONFIGUREARGS .= "--with-externals=$ARGV[0]"; shift; next + $CONFIGUREARGS .= " --with-externals=$ARGV[0]"; shift; next } if (/^-gnuplotscript$/) { $PlotScriptFilename = $ARGV[0]; shift; next; } if (/^-templatefile$/) { $Template = $ARGV[0]; shift; next; } @@ -332,6 +334,9 @@ if (/^-ldflags/) { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'"; shift; next; } + if (/^-extraflags/) { + $PROGTESTOPTS .= " EXTRA_FLAGS=\'$ARGV[0]\'"; shift; next; + } if (/^-noexternals$/) { $NOEXTERNALS = 1; next; } if (/^-nodejagnu$/) { $NODEJAGNU = 1; next; } if (/^-spec2000path$/) { From evan.cheng at apple.com Wed Jun 7 13:57:48 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 7 Jun 2006 13:57:48 -0500 Subject: [llvm-commits] CVS: llvm-test/TimedExec.sh RunSafely.sh Message-ID: <200606071857.NAA22133@zion.cs.uiuc.edu> Changes in directory llvm-test: TimedExec.sh added (r1.1) RunSafely.sh updated: 1.19 -> 1.20 --- Log message: Fork a watch dog process that sleeps for a specified period of time and then wakes up and kill the parent process. This works for targets where ulimit -t is not reliable. --- Diffs of the changes: (+45 -1) RunSafely.sh | 8 +++++++- TimedExec.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) Index: llvm-test/TimedExec.sh diff -c /dev/null llvm-test/TimedExec.sh:1.1 *** /dev/null Wed Jun 7 13:57:46 2006 --- llvm-test/TimedExec.sh Wed Jun 7 13:57:36 2006 *************** *** 0 **** --- 1,38 ---- + #!/bin/sh + # + # Program: TimedExec.sh + # + # Synopsis: This script is a watchdog wrapper. It runs the specified program + # but times out if it does not complete in the allocated time frame. + # Syntax: ./TimedExec.sh + # + + if [ $# -lt 2 ]; then + echo "./TimedExec.sh " + exit 1 + fi + + PARENT="" + if [ "$1" == "-p" ]; then + PARENT=$2; shift; shift; + fi + + TIMEOUT=$1 + PROGRAM=$2 + shift + + if [ -z "$PARENT" ]; then + # Start a watchdog process + $0 -p $$ $TIMEOUT $PROGRAM $* & + WATCHDOG="$!" + exec "$@" + # I am done first. kill the watch dog. + kill $WATCHDOG && (sleep 2; kill -1 $WATCHDOG) && (sleep 2; kill -9 $WATCHDOG) + else + # Sleep for a specified time then wake up to kill the parent process. + exec > /dev/null 2>&1 + sleep $TIMEOUT + kill $PARENT && (sleep 2; kill -1 $PARENT) && (sleep 2; kill -9 $PARENT) + fi + + exit 0 Index: llvm-test/RunSafely.sh diff -u llvm-test/RunSafely.sh:1.19 llvm-test/RunSafely.sh:1.20 --- llvm-test/RunSafely.sh:1.19 Tue Aug 2 17:04:00 2005 +++ llvm-test/RunSafely.sh Wed Jun 7 13:57:36 2006 @@ -13,6 +13,12 @@ # # Syntax: ./RunSafely.sh # +if [ $# -lt 4 ]; then + echo "./RunSafely.sh " + exit 1 +fi + +DIR=${0%%`basename $0`} ULIMIT=$1 INFILE=$2 OUTFILE=$3 @@ -51,7 +57,7 @@ # we tell time to launch a shell which in turn executes $PROGRAM with the # necessary I/O redirection. # -( time -p sh -c "$PROGRAM $* > $OUTFILE 2>&1 < $INFILE" ) 2>&1 | awk -- '\ +( time -p sh -c "${DIR}TimedExec.sh $ULIMIT $PROGRAM $* > $OUTFILE 2>&1 < $INFILE" ) 2>&1 | awk -- '\ BEGIN { cpu = 0.0; } /^user/ { cpu += $2; print } /^sys/ { cpu += $2; print } From reid at x10sys.com Wed Jun 7 15:00:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 15:00:34 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/LinkAllVMCore.h IntrinsicInst.h PassSupport.h Message-ID: <200606072000.PAA22636@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: LinkAllVMCore.h added (r1.1) IntrinsicInst.h updated: 1.15 -> 1.16 PassSupport.h updated: 1.22 -> 1.23 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : Break the "IncludeFile" mechanism into its own header file and adjust other files accordingly. Use this facility for the IntrinsicInst problem which was the subject of PR800: http://llvm.cs.uiuc.edu/PR800 . More to follow on this. --- Diffs of the changes: (+67 -11) IntrinsicInst.h | 7 ++++++ LinkAllVMCore.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PassSupport.h | 12 ----------- 3 files changed, 67 insertions(+), 11 deletions(-) Index: llvm/include/llvm/LinkAllVMCore.h diff -c /dev/null llvm/include/llvm/LinkAllVMCore.h:1.1 *** /dev/null Wed Jun 7 15:00:29 2006 --- llvm/include/llvm/LinkAllVMCore.h Wed Jun 7 15:00:19 2006 *************** *** 0 **** --- 1,59 ---- + //===- LinkAllVMCore.h - Reference All VMCore Code --------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This header file pulls in all analysis passes for tools like analyze and + // bugpoint that need this functionality. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_LINKALLVMCORE_H + #define LLVM_LINKALLVMCORE_H + + #include + #include + #include + #include + #include + #include + #include + + namespace { + struct ForceVMCoreLinking { + ForceVMCoreLinking() { + // We must reference the passes in such a way that compilers will not + // delete it all as dead code, even with whole program optimization, + // yet is effectively a NO-OP. As the compiler isn't smart enough + // to know that getenv() never returns -1, this will do the job. + if (std::getenv("bar") != (char*) -1) + return; + + (void)new llvm::LocalDataStructures(); + (void)new llvm::BUDataStructures(); + (void)new llvm::TDDataStructures(); + (void)new llvm::CompleteBUDataStructures(); + (void)new llvm::EquivClassGraphs(); + (void)llvm::createDataStructureStatsPass(); + (void)llvm::createDataStructureGraphCheckerPass(); + (void)llvm::createProfileLoaderPass(); + (void)llvm::createNoProfileInfoPass(); + (void)llvm::createInstCountPass(); + (void)new llvm::IntervalPartition(); + (void)new llvm::ImmediateDominators(); + (void)new llvm::PostDominatorSet(); + (void)new llvm::FindUsedTypes(); + (void)new llvm::ScalarEvolution(); + (void)new llvm::CallTargetFinder(); + ((llvm::Function*)0)->viewCFGOnly(); + llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0); + X.add((llvm::Value*)0, 0); // for -print-alias-sets + } + } ForceVMCoreLinking; + } + + #endif Index: llvm/include/llvm/IntrinsicInst.h diff -u llvm/include/llvm/IntrinsicInst.h:1.15 llvm/include/llvm/IntrinsicInst.h:1.16 --- llvm/include/llvm/IntrinsicInst.h:1.15 Mon Mar 27 17:30:18 2006 +++ llvm/include/llvm/IntrinsicInst.h Wed Jun 7 15:00:19 2006 @@ -28,6 +28,7 @@ #include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" +#include "llvm/Support/IncludeFile.h" namespace llvm { /// IntrinsicInst - A useful wrapper class for inspecting calls to intrinsic @@ -312,6 +313,12 @@ return isa(V) && classof(cast(V)); } }; + +// A hack to ensure that the IntrinsicInst.cpp file gets added as a dependency +// of any file that +extern char LinkIntrinsicInstStub; +static IncludeFile LinkIntrinsicInst(&LinkIntrinsicInstStub); + } #endif Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.22 llvm/include/llvm/PassSupport.h:1.23 --- llvm/include/llvm/PassSupport.h:1.22 Sun Jan 22 19:01:04 2006 +++ llvm/include/llvm/PassSupport.h Wed Jun 7 15:00:19 2006 @@ -21,6 +21,7 @@ #ifndef LLVM_PASS_SUPPORT_H #define LLVM_PASS_SUPPORT_H +#include "llvm/Support/IncludeFile.h" // No need to include Pass.h, we are being included by it! namespace llvm { @@ -367,17 +368,6 @@ virtual void passEnumerate(const PassInfo *P) {} }; - -//===--------------------------------------------------------------------------- -/// IncludeFile class - This class is used as a hack to make sure that the -/// implementation of a header file is included into a tool that uses the -/// header. This is solely to overcome problems linking .a files and not -/// getting the implementation of passes we need. -/// -struct IncludeFile { - IncludeFile(void *); -}; - } // End llvm namespace #endif From reid at x10sys.com Wed Jun 7 15:00:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 15:00:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/IntrinsicInst.cpp Pass.cpp Message-ID: <200606072000.PAA22646@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: IntrinsicInst.cpp updated: 1.4 -> 1.5 Pass.cpp updated: 1.68 -> 1.69 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : Break the "IncludeFile" mechanism into its own header file and adjust other files accordingly. Use this facility for the IntrinsicInst problem which was the subject of PR800: http://llvm.cs.uiuc.edu/PR800 . More to follow on this. --- Diffs of the changes: (+4 -3) IntrinsicInst.cpp | 4 ++++ Pass.cpp | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/VMCore/IntrinsicInst.cpp diff -u llvm/lib/VMCore/IntrinsicInst.cpp:1.4 llvm/lib/VMCore/IntrinsicInst.cpp:1.5 --- llvm/lib/VMCore/IntrinsicInst.cpp:1.4 Sun Mar 26 16:46:27 2006 +++ llvm/lib/VMCore/IntrinsicInst.cpp Wed Jun 7 15:00:19 2006 @@ -71,3 +71,7 @@ } //===----------------------------------------------------------------------===// +/// LinkIntrinsicInstStub -- This is a hack to make sure that programs that +/// #include IntrinsicInst.h also link this file. See Support/IncludeFile.h +/// for further details. +char llvm::LinkIntrinsicInstStub; Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.68 llvm/lib/VMCore/Pass.cpp:1.69 --- llvm/lib/VMCore/Pass.cpp:1.68 Sun Jan 22 19:01:04 2006 +++ llvm/lib/VMCore/Pass.cpp Wed Jun 7 15:00:19 2006 @@ -23,9 +23,6 @@ #include using namespace llvm; -// IncludeFile - Stub function used to help linking out. -IncludeFile::IncludeFile(void*) {} - //===----------------------------------------------------------------------===// // AnalysisID Class Implementation // From reid at x10sys.com Wed Jun 7 15:00:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 15:00:34 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasAnalysis.h Message-ID: <200606072000.PAA22640@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasAnalysis.h updated: 1.24 -> 1.25 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : Break the "IncludeFile" mechanism into its own header file and adjust other files accordingly. Use this facility for the IntrinsicInst problem which was the subject of PR800: http://llvm.cs.uiuc.edu/PR800 . More to follow on this. --- Diffs of the changes: (+3 -1) AliasAnalysis.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/AliasAnalysis.h diff -u llvm/include/llvm/Analysis/AliasAnalysis.h:1.24 llvm/include/llvm/Analysis/AliasAnalysis.h:1.25 --- llvm/include/llvm/Analysis/AliasAnalysis.h:1.24 Thu Jun 1 02:02:51 2006 +++ llvm/include/llvm/Analysis/AliasAnalysis.h Wed Jun 7 15:00:19 2006 @@ -31,7 +31,7 @@ #define LLVM_ANALYSIS_ALIAS_ANALYSIS_H #include "llvm/Support/CallSite.h" -#include "llvm/Pass.h" // Need this for IncludeFile +#include "llvm/Support/IncludeFile.h" namespace llvm { @@ -39,6 +39,8 @@ class StoreInst; class VAArgInst; class TargetData; +class Pass; +class AnalysisUsage; class AliasAnalysis { protected: From reid at x10sys.com Wed Jun 7 15:00:35 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 15:00:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp Message-ID: <200606072000.PAA22654@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysis.cpp updated: 1.27 -> 1.28 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : Break the "IncludeFile" mechanism into its own header file and adjust other files accordingly. Use this facility for the IntrinsicInst problem which was the subject of PR800: http://llvm.cs.uiuc.edu/PR800 . More to follow on this. --- Diffs of the changes: (+1 -0) AliasAnalysis.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Analysis/AliasAnalysis.cpp diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.27 llvm/lib/Analysis/AliasAnalysis.cpp:1.28 --- llvm/lib/Analysis/AliasAnalysis.cpp:1.27 Thu Jun 1 02:02:51 2006 +++ llvm/lib/Analysis/AliasAnalysis.cpp Wed Jun 7 15:00:19 2006 @@ -25,6 +25,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Pass.h" #include "llvm/BasicBlock.h" #include "llvm/Instructions.h" #include "llvm/Type.h" From reid at x10sys.com Wed Jun 7 15:00:35 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 15:00:35 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/IncludeFile.h Message-ID: <200606072000.PAA22650@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: IncludeFile.h added (r1.1) --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : Break the "IncludeFile" mechanism into its own header file and adjust other files accordingly. Use this facility for the IntrinsicInst problem which was the subject of PR800: http://llvm.cs.uiuc.edu/PR800 . More to follow on this. --- Diffs of the changes: (+40 -0) IncludeFile.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+) Index: llvm/include/llvm/Support/IncludeFile.h diff -c /dev/null llvm/include/llvm/Support/IncludeFile.h:1.1 *** /dev/null Wed Jun 7 15:00:29 2006 --- llvm/include/llvm/Support/IncludeFile.h Wed Jun 7 15:00:19 2006 *************** *** 0 **** --- 1,40 ---- + //===- llvm/Support/IncludeFile.h - Ensure Linking Of Library ---*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the IncludeFile class. + // + //===----------------------------------------------------------------------===// + + /// This class is used as a facility to make sure that the implementation of a + /// header file is included into a tool that uses the header. This is solely + /// to overcome problems linking .a files and not getting the implementation + /// of compilation units we need. This is commonly an issue with the various + /// Passes but also occurs elsewhere in LLVM. We like to use .a files because + /// they link faster and provide the smallest executables. However, sometimes + /// those executables are too small, if the program doesn't reference something + /// that might be needed, especially by a loaded share object. This little class + /// helps to resolve that problem. The basic strategy is to use this class in + /// a header file and pass the address of a variable to the constructor. If the + /// variable is defined in the header file's corresponding .cpp file then all + /// tools/libraries that #include the header file will require the .cpp as well. + /// For example:
    + /// extern int LinkMyCodeStub;
    + /// static IncludeFile LinkMyModule(&LinkMyCodeStub);
    + /// @brief Class to ensure linking of corresponding object file. + + #ifndef LLVM_SUPPORT_INCLUDEFILE_H + #define LLVM_SUPPORT_INCLUDEFILE_H + + namespace llvm { + struct IncludeFile { + IncludeFile(void *); + }; + } + + #endif From reid at x10sys.com Wed Jun 7 15:00:35 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 15:00:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/IncludeFile.cpp Message-ID: <200606072000.PAA22658@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: IncludeFile.cpp added (r1.1) --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : Break the "IncludeFile" mechanism into its own header file and adjust other files accordingly. Use this facility for the IntrinsicInst problem which was the subject of PR800: http://llvm.cs.uiuc.edu/PR800 . More to follow on this. --- Diffs of the changes: (+20 -0) IncludeFile.cpp | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+) Index: llvm/lib/Support/IncludeFile.cpp diff -c /dev/null llvm/lib/Support/IncludeFile.cpp:1.1 *** /dev/null Wed Jun 7 15:00:29 2006 --- llvm/lib/Support/IncludeFile.cpp Wed Jun 7 15:00:19 2006 *************** *** 0 **** --- 1,20 ---- + //===- lib/Support/IncludeFile.cpp - Ensure Linking Of Implementation -----===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the IncludeFile constructor. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Support/IncludeFile.h" + + using namespace llvm; + + // This constructor is used to ensure linking of other modules. See the + // llvm/Support/IncludeFile.h header for details. + IncludeFile::IncludeFile(void*) {} From evan.cheng at apple.com Wed Jun 7 15:11:45 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 7 Jun 2006 15:11:45 -0500 Subject: [llvm-commits] CVS: llvm-test/RunSafely.sh Message-ID: <200606072011.PAA22737@zion.cs.uiuc.edu> Changes in directory llvm-test: RunSafely.sh updated: 1.20 -> 1.21 --- Log message: Only use the watchdog script for Darwin. --- Diffs of the changes: (+10 -1) RunSafely.sh | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletion(-) Index: llvm-test/RunSafely.sh diff -u llvm-test/RunSafely.sh:1.20 llvm-test/RunSafely.sh:1.21 --- llvm-test/RunSafely.sh:1.20 Wed Jun 7 13:57:36 2006 +++ llvm-test/RunSafely.sh Wed Jun 7 15:11:31 2006 @@ -57,12 +57,21 @@ # we tell time to launch a shell which in turn executes $PROGRAM with the # necessary I/O redirection. # -( time -p sh -c "${DIR}TimedExec.sh $ULIMIT $PROGRAM $* > $OUTFILE 2>&1 < $INFILE" ) 2>&1 | awk -- '\ +if [ $SYSTEM == Darwin ]; then + ( time -p sh -c "${DIR}TimedExec.sh $ULIMIT $PROGRAM $* > $OUTFILE 2>&1 < $INFILE" ) 2>&1 | awk -- '\ BEGIN { cpu = 0.0; } /^user/ { cpu += $2; print } /^sys/ { cpu += $2; print } !/^user/ && !/^sys/ { print } END { printf("program %f\n", cpu); }' > $OUTFILE.time +else + ( time -p sh -c "$PROGRAM $* > $OUTFILE 2>&1 < $INFILE" ) 2>&1 | awk -- '\ +BEGIN { cpu = 0.0; } +/^user/ { cpu += $2; print } +/^sys/ { cpu += $2; print } +!/^user/ && !/^sys/ { print } +END { printf("program %f\n", cpu); }' > $OUTFILE.time +fi if test $? -eq 0 then From evan.cheng at apple.com Wed Jun 7 15:15:09 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 7 Jun 2006 15:15:09 -0500 Subject: [llvm-commits] CVS: llvm-test/TimedExec.sh Message-ID: <200606072015.PAA22759@zion.cs.uiuc.edu> Changes in directory llvm-test: TimedExec.sh updated: 1.1 -> 1.2 --- Log message: The watchdog process should wakes up every sec to check if the parent has completed. --- Diffs of the changes: (+10 -4) TimedExec.sh | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) Index: llvm-test/TimedExec.sh diff -u llvm-test/TimedExec.sh:1.1 llvm-test/TimedExec.sh:1.2 --- llvm-test/TimedExec.sh:1.1 Wed Jun 7 13:57:36 2006 +++ llvm-test/TimedExec.sh Wed Jun 7 15:14:57 2006 @@ -24,14 +24,20 @@ if [ -z "$PARENT" ]; then # Start a watchdog process $0 -p $$ $TIMEOUT $PROGRAM $* & - WATCHDOG="$!" exec "$@" - # I am done first. kill the watch dog. - kill $WATCHDOG && (sleep 2; kill -1 $WATCHDOG) && (sleep 2; kill -9 $WATCHDOG) else # Sleep for a specified time then wake up to kill the parent process. exec > /dev/null 2>&1 - sleep $TIMEOUT + SEC=0 + while [ $SEC -lt $TIMEOUT ]; do + sleep 1 + # Check if parent has completed. + kill -s INFO $PATENT 2>/dev/null + if [ $? -eq 1 ]; then + exit 0 + fi + SEC=$(($SEC + 1)) + done kill $PARENT && (sleep 2; kill -1 $PARENT) && (sleep 2; kill -9 $PARENT) fi From reid at x10sys.com Wed Jun 7 15:35:59 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 15:35:59 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/IncludeFile.h Message-ID: <200606072035.PAA22880@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: IncludeFile.h updated: 1.1 -> 1.2 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : This change was suggested by Chris so that we can select an alternate (or even no-op) implementation of the link assurance. I'm committing this for your review, Chris. If the names and definitions are okay, I'll adjust all the .h and .cpp files in a later patch. --- Diffs of the changes: (+31 -8) IncludeFile.h | 39 +++++++++++++++++++++++++++++++-------- 1 files changed, 31 insertions(+), 8 deletions(-) Index: llvm/include/llvm/Support/IncludeFile.h diff -u llvm/include/llvm/Support/IncludeFile.h:1.1 llvm/include/llvm/Support/IncludeFile.h:1.2 --- llvm/include/llvm/Support/IncludeFile.h:1.1 Wed Jun 7 15:00:19 2006 +++ llvm/include/llvm/Support/IncludeFile.h Wed Jun 7 15:35:46 2006 @@ -7,12 +7,39 @@ // //===----------------------------------------------------------------------===// // -// This file defines the IncludeFile class. +// This file defines the FORCE_DEFINING_FILE_TO_BE_LINKED and DEFINE_FILE_FOR +// macros. // //===----------------------------------------------------------------------===// -/// This class is used as a facility to make sure that the implementation of a -/// header file is included into a tool that uses the header. This is solely +#ifndef LLVM_SUPPORT_INCLUDEFILE_H +#define LLVM_SUPPORT_INCLUDEFILE_H + +/// This macro is the public interface that IncludeFile.h exports. This gives +/// us the option to implement the "link the definition" capability in any +/// manner that we choose. All header files that depend on a specific .cpp +/// file being linked at run time should use this macro instead of the +/// IncludeFile class directly. +/// +/// For example, foo.h would use:
    +/// FORCE_DEFINING_FILE_TO_BE_LINKED(foo)
    +/// +/// And, foo.cp would use:
    +/// DEFINING_FILE_FOR(foo)
    +#define FORCE_DEFINING_FILE_TO_BE_LINKED(name) \ + extern char name ## LinkVar; \ + static IncludeFile name ## LinkObj ( &name ## LinkVar ) + +/// This macro is the counterpart to FORCE_DEFINING_FILE_TO_BE_LINKED. It should +/// be used in a .cpp file to define the name referenced in a header file that +/// will cause linkage of the .cpp file. It should only be used at extern level. +#define DEFINING_FILE_FOR(name) char name + +namespace llvm { + +/// This class is used in the implementation of FORCE_DEFINING_FILE_TO_BE_LINKED +/// macro to make sure that the implementation of a header file is included +/// into a tool that uses the header. This is solely /// to overcome problems linking .a files and not getting the implementation /// of compilation units we need. This is commonly an issue with the various /// Passes but also occurs elsewhere in LLVM. We like to use .a files because @@ -27,14 +54,10 @@ /// extern int LinkMyCodeStub;
    /// static IncludeFile LinkMyModule(&LinkMyCodeStub);
    /// @brief Class to ensure linking of corresponding object file. - -#ifndef LLVM_SUPPORT_INCLUDEFILE_H -#define LLVM_SUPPORT_INCLUDEFILE_H - -namespace llvm { struct IncludeFile { IncludeFile(void *); }; + } #endif From evan.cheng at apple.com Wed Jun 7 16:19:46 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 7 Jun 2006 16:19:46 -0500 Subject: [llvm-commits] CVS: llvm-test/TimedExec.sh Message-ID: <200606072119.QAA23210@zion.cs.uiuc.edu> Changes in directory llvm-test: TimedExec.sh updated: 1.2 -> 1.3 --- Log message: Typo --- Diffs of the changes: (+1 -1) TimedExec.sh | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/TimedExec.sh diff -u llvm-test/TimedExec.sh:1.2 llvm-test/TimedExec.sh:1.3 --- llvm-test/TimedExec.sh:1.2 Wed Jun 7 15:14:57 2006 +++ llvm-test/TimedExec.sh Wed Jun 7 16:19:34 2006 @@ -32,7 +32,7 @@ while [ $SEC -lt $TIMEOUT ]; do sleep 1 # Check if parent has completed. - kill -s INFO $PATENT 2>/dev/null + kill -s INFO $PARENT 2>/dev/null if [ $? -eq 1 ]; then exit 0 fi From reid at x10sys.com Wed Jun 7 16:24:23 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 16:24:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnroll.cpp Message-ID: <200606072124.QAA23276@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnroll.cpp updated: 1.19 -> 1.20 --- Log message: Fix a spello in a comment. --- Diffs of the changes: (+1 -1) LoopUnroll.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.19 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.20 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.19 Sun Jan 22 17:32:06 2006 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Wed Jun 7 16:24:10 2006 @@ -213,7 +213,7 @@ // We don't want to reprocess entries with PHI nodes in them. For this // reason, we look at each operand of each user exactly once, performing the - // stubstitution exactly once. + // substitution exactly once. for (std::set::iterator UI = Users.begin(), E = Users.end(); UI != E; ++UI) { Instruction *I = cast(*UI); From reid at x10sys.com Wed Jun 7 17:00:40 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 17:00:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp IntrinsicInst.cpp Message-ID: <200606072200.RAA23630@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Dominators.cpp updated: 1.70 -> 1.71 IntrinsicInst.cpp updated: 1.5 -> 1.6 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Fix the macros in IncludeFile.h to put everything in the llvm namespace 2. Replace the previous explicit mechanism in all the .h and .cpp files with the macros in IncludeFile.h This gets us a consistent mechanism throughout LLVM for ensuring linkage. Next step is to make sure its used in enough places. --- Diffs of the changes: (+4 -6) Dominators.cpp | 4 ++-- IntrinsicInst.cpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.70 llvm/lib/VMCore/Dominators.cpp:1.71 --- llvm/lib/VMCore/Dominators.cpp:1.70 Thu Jun 1 02:02:51 2006 +++ llvm/lib/VMCore/Dominators.cpp Wed Jun 7 17:00:26 2006 @@ -304,8 +304,6 @@ return false; } -int DominatorSet::stub; - namespace llvm { static std::ostream &operator<<(std::ostream &o, const std::set &BBs) { @@ -933,3 +931,5 @@ } o << "\n"; } + +DEFINING_FILE_FOR(DominatorSet) Index: llvm/lib/VMCore/IntrinsicInst.cpp diff -u llvm/lib/VMCore/IntrinsicInst.cpp:1.5 llvm/lib/VMCore/IntrinsicInst.cpp:1.6 --- llvm/lib/VMCore/IntrinsicInst.cpp:1.5 Wed Jun 7 15:00:19 2006 +++ llvm/lib/VMCore/IntrinsicInst.cpp Wed Jun 7 17:00:26 2006 @@ -71,7 +71,5 @@ } //===----------------------------------------------------------------------===// -/// LinkIntrinsicInstStub -- This is a hack to make sure that programs that -/// #include IntrinsicInst.h also link this file. See Support/IncludeFile.h -/// for further details. -char llvm::LinkIntrinsicInstStub; +/// Ensure that users of IntrinsicInst.h will link with this module. +DEFINING_FILE_FOR(IntrinsicInst) From reid at x10sys.com Wed Jun 7 17:00:42 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 17:00:42 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/IntrinsicInst.h Message-ID: <200606072200.RAA23638@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: IntrinsicInst.h updated: 1.16 -> 1.17 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Fix the macros in IncludeFile.h to put everything in the llvm namespace 2. Replace the previous explicit mechanism in all the .h and .cpp files with the macros in IncludeFile.h This gets us a consistent mechanism throughout LLVM for ensuring linkage. Next step is to make sure its used in enough places. --- Diffs of the changes: (+4 -5) IntrinsicInst.h | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) Index: llvm/include/llvm/IntrinsicInst.h diff -u llvm/include/llvm/IntrinsicInst.h:1.16 llvm/include/llvm/IntrinsicInst.h:1.17 --- llvm/include/llvm/IntrinsicInst.h:1.16 Wed Jun 7 15:00:19 2006 +++ llvm/include/llvm/IntrinsicInst.h Wed Jun 7 17:00:25 2006 @@ -314,11 +314,10 @@ } }; -// A hack to ensure that the IntrinsicInst.cpp file gets added as a dependency -// of any file that -extern char LinkIntrinsicInstStub; -static IncludeFile LinkIntrinsicInst(&LinkIntrinsicInstStub); - } +// Ensure that the IntrinsicInst.cpp file gets added as a dependency of any +// file that includes this header +FORCE_DEFINING_FILE_TO_BE_LINKED(IntrinsicInst) + #endif From reid at x10sys.com Wed Jun 7 17:00:42 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 17:00:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp BasicAliasAnalysis.cpp LoopInfo.cpp PostDominators.cpp ValueNumbering.cpp Message-ID: <200606072200.RAA23650@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysis.cpp updated: 1.28 -> 1.29 BasicAliasAnalysis.cpp updated: 1.80 -> 1.81 LoopInfo.cpp updated: 1.69 -> 1.70 PostDominators.cpp updated: 1.56 -> 1.57 ValueNumbering.cpp updated: 1.18 -> 1.19 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Fix the macros in IncludeFile.h to put everything in the llvm namespace 2. Replace the previous explicit mechanism in all the .h and .cpp files with the macros in IncludeFile.h This gets us a consistent mechanism throughout LLVM for ensuring linkage. Next step is to make sure its used in enough places. --- Diffs of the changes: (+11 -14) AliasAnalysis.cpp | 6 +----- BasicAliasAnalysis.cpp | 6 +++--- LoopInfo.cpp | 5 +++-- PostDominators.cpp | 5 ++--- ValueNumbering.cpp | 3 ++- 5 files changed, 11 insertions(+), 14 deletions(-) Index: llvm/lib/Analysis/AliasAnalysis.cpp diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.28 llvm/lib/Analysis/AliasAnalysis.cpp:1.29 --- llvm/lib/Analysis/AliasAnalysis.cpp:1.28 Wed Jun 7 15:00:19 2006 +++ llvm/lib/Analysis/AliasAnalysis.cpp Wed Jun 7 17:00:26 2006 @@ -188,8 +188,4 @@ // be pulled in if the AliasAnalysis classes are pulled in. Otherwise we run // the risk of AliasAnalysis being used, but the default implementation not // being linked into the tool that uses it. -// -namespace llvm { - extern int BasicAAStub; -} -static IncludeFile INCLUDE_BASICAA_CPP((void*)&BasicAAStub); +DEFINING_FILE_FOR(AliasAnalysis) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.80 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.81 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.80 Thu Jun 1 02:02:51 2006 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Wed Jun 7 17:00:26 2006 @@ -26,9 +26,6 @@ #include using namespace llvm; -// Make sure that anything that uses AliasAnalysis pulls in this file... -int llvm::BasicAAStub; - namespace { /// NoAA - This class implements the -no-aa pass, which always returns "I /// don't know" for alias queries. NoAA is unlike other alias analysis @@ -846,3 +843,6 @@ return UnknownModRefBehavior; } + +// Make sure that anything that uses AliasAnalysis pulls in this file... +DEFINING_FILE_FOR(BasicAliasAnalysis) Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.69 llvm/lib/Analysis/LoopInfo.cpp:1.70 --- llvm/lib/Analysis/LoopInfo.cpp:1.69 Thu Jun 1 02:02:51 2006 +++ llvm/lib/Analysis/LoopInfo.cpp Wed Jun 7 17:00:26 2006 @@ -86,8 +86,6 @@ //===----------------------------------------------------------------------===// // LoopInfo implementation // -int LoopInfo::stub; - bool LoopInfo::runOnFunction(Function &) { releaseMemory(); Calculate(getAnalysis()); // Update @@ -557,3 +555,6 @@ void Loop::removeBlockFromLoop(BasicBlock *BB) { RemoveFromVector(Blocks, BB); } + +// Ensure this file gets linked when LoopInfo.h is used. +DEFINING_FILE_FOR(LoopInfo) Index: llvm/lib/Analysis/PostDominators.cpp diff -u llvm/lib/Analysis/PostDominators.cpp:1.56 llvm/lib/Analysis/PostDominators.cpp:1.57 --- llvm/lib/Analysis/PostDominators.cpp:1.56 Thu Jun 1 02:02:51 2006 +++ llvm/lib/Analysis/PostDominators.cpp Wed Jun 7 17:00:26 2006 @@ -359,6 +359,5 @@ return S; } -// stub - a dummy function to make linking work ok. -int PostDominanceFrontier::stub; - +// Ensure that this .cpp file gets linked when PostDominators.h is used. +DEFINING_FILE_FOR(PostDominanceFrontier) Index: llvm/lib/Analysis/ValueNumbering.cpp diff -u llvm/lib/Analysis/ValueNumbering.cpp:1.18 llvm/lib/Analysis/ValueNumbering.cpp:1.19 --- llvm/lib/Analysis/ValueNumbering.cpp:1.18 Thu Jun 1 02:02:51 2006 +++ llvm/lib/Analysis/ValueNumbering.cpp Wed Jun 7 17:00:26 2006 @@ -239,4 +239,5 @@ } -int llvm::BasicValueNumberingStub; // to ensure linkage of this file +// Ensure that users of ValueNumbering.h will link with this file +DEFINING_FILE_FOR(BasicValueNumbering) From reid at x10sys.com Wed Jun 7 17:00:42 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 17:00:42 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/IncludeFile.h Message-ID: <200606072200.RAA23634@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: IncludeFile.h updated: 1.2 -> 1.3 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Fix the macros in IncludeFile.h to put everything in the llvm namespace 2. Replace the previous explicit mechanism in all the .h and .cpp files with the macros in IncludeFile.h This gets us a consistent mechanism throughout LLVM for ensuring linkage. Next step is to make sure its used in enough places. --- Diffs of the changes: (+5 -3) IncludeFile.h | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Support/IncludeFile.h diff -u llvm/include/llvm/Support/IncludeFile.h:1.2 llvm/include/llvm/Support/IncludeFile.h:1.3 --- llvm/include/llvm/Support/IncludeFile.h:1.2 Wed Jun 7 15:35:46 2006 +++ llvm/include/llvm/Support/IncludeFile.h Wed Jun 7 17:00:26 2006 @@ -27,13 +27,15 @@ /// And, foo.cp would use:
    /// DEFINING_FILE_FOR(foo)
    #define FORCE_DEFINING_FILE_TO_BE_LINKED(name) \ - extern char name ## LinkVar; \ - static IncludeFile name ## LinkObj ( &name ## LinkVar ) + namespace llvm { \ + extern char name ## LinkVar; \ + static IncludeFile name ## LinkObj ( &name ## LinkVar ); \ + } /// This macro is the counterpart to FORCE_DEFINING_FILE_TO_BE_LINKED. It should /// be used in a .cpp file to define the name referenced in a header file that /// will cause linkage of the .cpp file. It should only be used at extern level. -#define DEFINING_FILE_FOR(name) char name +#define DEFINING_FILE_FOR(name) namespace llvm { char name ## LinkVar; } namespace llvm { From reid at x10sys.com Wed Jun 7 17:00:42 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 17:00:42 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasAnalysis.h CallGraph.h Dominators.h FindUsedTypes.h LoopInfo.h PostDominators.h ValueNumbering.h Message-ID: <200606072200.RAA23672@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasAnalysis.h updated: 1.25 -> 1.26 CallGraph.h updated: 1.48 -> 1.49 Dominators.h updated: 1.57 -> 1.58 FindUsedTypes.h updated: 1.27 -> 1.28 LoopInfo.h updated: 1.53 -> 1.54 PostDominators.h updated: 1.13 -> 1.14 ValueNumbering.h updated: 1.9 -> 1.10 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Fix the macros in IncludeFile.h to put everything in the llvm namespace 2. Replace the previous explicit mechanism in all the .h and .cpp files with the macros in IncludeFile.h This gets us a consistent mechanism throughout LLVM for ensuring linkage. Next step is to make sure its used in enough places. --- Diffs of the changes: (+22 -38) AliasAnalysis.h | 9 ++++----- CallGraph.h | 10 +++------- Dominators.h | 6 +++--- FindUsedTypes.h | 10 +++------- LoopInfo.h | 8 +++----- PostDominators.h | 10 +++------- ValueNumbering.h | 7 +++---- 7 files changed, 22 insertions(+), 38 deletions(-) Index: llvm/include/llvm/Analysis/AliasAnalysis.h diff -u llvm/include/llvm/Analysis/AliasAnalysis.h:1.25 llvm/include/llvm/Analysis/AliasAnalysis.h:1.26 --- llvm/include/llvm/Analysis/AliasAnalysis.h:1.25 Wed Jun 7 15:00:19 2006 +++ llvm/include/llvm/Analysis/AliasAnalysis.h Wed Jun 7 17:00:25 2006 @@ -318,14 +318,13 @@ } }; +} // End llvm namespace + // Because of the way .a files work, we must force the BasicAA implementation to // be pulled in if the AliasAnalysis header is included. Otherwise we run // the risk of AliasAnalysis being used, but the default implementation not // being linked into the tool that uses it. -// -extern int BasicAAStub; -static IncludeFile HDR_INCLUDE_BASICAA_CPP(&BasicAAStub); - -} // End llvm namespace +FORCE_DEFINING_FILE_TO_BE_LINKED(AliasAnalysis) +FORCE_DEFINING_FILE_TO_BE_LINKED(BasicAliasAnalysis) #endif Index: llvm/include/llvm/Analysis/CallGraph.h diff -u llvm/include/llvm/Analysis/CallGraph.h:1.48 llvm/include/llvm/Analysis/CallGraph.h:1.49 --- llvm/include/llvm/Analysis/CallGraph.h:1.48 Thu Jun 1 12:17:46 2006 +++ llvm/include/llvm/Analysis/CallGraph.h Wed Jun 7 17:00:25 2006 @@ -287,13 +287,9 @@ static nodes_iterator nodes_end (const CallGraph *CG) { return CG->end(); } }; -// Make sure that any clients of this file link in CallGraph.cpp -static IncludeFile -CALLGRAPH_INCLUDE_FILE(&CallGraph::stub); - -extern int BasicCallGraphStub; -static IncludeFile HDR_INCLUDE_CALLGRAPH_CPP(&BasicCallGraphStub); - } // End llvm namespace +// Make sure that any clients of this file link in CallGraph.cpp +FORCE_DEFINING_FILE_TO_BE_LINKED(CallGraph) + #endif Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.57 llvm/include/llvm/Analysis/Dominators.h:1.58 --- llvm/include/llvm/Analysis/Dominators.h:1.57 Thu Jun 1 02:02:51 2006 +++ llvm/include/llvm/Analysis/Dominators.h Wed Jun 7 17:00:25 2006 @@ -652,9 +652,9 @@ }; -// Make sure that any clients of this file link in Dominators.cpp -static IncludeFile -DOMINATORS_INCLUDE_FILE(&DominatorSet::stub); } // End llvm namespace +// Make sure that any clients of this file link in Dominators.cpp +FORCE_DEFINING_FILE_TO_BE_LINKED(DominatorSet) + #endif Index: llvm/include/llvm/Analysis/FindUsedTypes.h diff -u llvm/include/llvm/Analysis/FindUsedTypes.h:1.27 llvm/include/llvm/Analysis/FindUsedTypes.h:1.28 --- llvm/include/llvm/Analysis/FindUsedTypes.h:1.27 Thu Jun 1 02:02:51 2006 +++ llvm/include/llvm/Analysis/FindUsedTypes.h Wed Jun 7 17:00:25 2006 @@ -53,15 +53,11 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); } - - // stub - dummy function, just ignore it - static int stub; }; -// Make sure that any clients of this file link in PostDominators.cpp -static IncludeFile -FIND_USED_TYPES_INCLUDE_FILE(&FindUsedTypes::stub); - } // End llvm namespace +// Make sure that any clients of this file link in PostDominators.cpp +FORCE_DEFINING_FILE_TO_BE_LINKED(FindUsedTypes) + #endif Index: llvm/include/llvm/Analysis/LoopInfo.h diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.53 llvm/include/llvm/Analysis/LoopInfo.h:1.54 --- llvm/include/llvm/Analysis/LoopInfo.h:1.53 Thu Jun 1 02:02:51 2006 +++ llvm/include/llvm/Analysis/LoopInfo.h Wed Jun 7 17:00:25 2006 @@ -295,7 +295,6 @@ /// BasicBlocks to loops. void removeBlock(BasicBlock *BB); - static int stub; // Noop private: void Calculate(ETForest &EF); Loop *ConsiderForLoop(BasicBlock *BB, ETForest &EF); @@ -304,10 +303,6 @@ }; -// Make sure that any clients of this file link in LoopInfo.cpp -static IncludeFile -LOOP_INFO_INCLUDE_FILE(&LoopInfo::stub); - // Allow clients to walk the list of nested loops... template <> struct GraphTraits { typedef const Loop NodeType; @@ -337,4 +332,7 @@ } // End llvm namespace +// Make sure that any clients of this file link in LoopInfo.cpp +FORCE_DEFINING_FILE_TO_BE_LINKED(LoopInfo) + #endif Index: llvm/include/llvm/Analysis/PostDominators.h diff -u llvm/include/llvm/Analysis/PostDominators.h:1.13 llvm/include/llvm/Analysis/PostDominators.h:1.14 --- llvm/include/llvm/Analysis/PostDominators.h:1.13 Thu Jun 1 02:02:51 2006 +++ llvm/include/llvm/Analysis/PostDominators.h Wed Jun 7 17:00:25 2006 @@ -128,18 +128,14 @@ AU.addRequired(); } - // stub - dummy function, just ignore it - static int stub; - private: const DomSetType &calculate(const PostDominatorTree &DT, const DominatorTree::Node *Node); }; -// Make sure that any clients of this file link in PostDominators.cpp -static IncludeFile -POST_DOMINATOR_INCLUDE_FILE(&PostDominanceFrontier::stub); - } // End llvm namespace +// Make sure that any clients of this file link in PostDominators.cpp +FORCE_DEFINING_FILE_TO_BE_LINKED(PostDominanceFrontier) + #endif Index: llvm/include/llvm/Analysis/ValueNumbering.h diff -u llvm/include/llvm/Analysis/ValueNumbering.h:1.9 llvm/include/llvm/Analysis/ValueNumbering.h:1.10 --- llvm/include/llvm/Analysis/ValueNumbering.h:1.9 Thu Jun 1 02:02:51 2006 +++ llvm/include/llvm/Analysis/ValueNumbering.h Wed Jun 7 17:00:25 2006 @@ -65,10 +65,9 @@ } }; -extern int BasicValueNumberingStub; -static IncludeFile -HDR_INCLUDE_VALUENUMBERING_CPP(&BasicValueNumberingStub); - } // End llvm namespace +// Force any file including this header to get the implementation as well +FORCE_DEFINING_FILE_TO_BE_LINKED(BasicValueNumbering) + #endif From reid at x10sys.com Wed Jun 7 17:00:42 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 17:00:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp FindUsedTypes.cpp Message-ID: <200606072200.RAA23656@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraph.cpp updated: 1.53 -> 1.54 FindUsedTypes.cpp updated: 1.35 -> 1.36 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Fix the macros in IncludeFile.h to put everything in the llvm namespace 2. Replace the previous explicit mechanism in all the .h and .cpp files with the macros in IncludeFile.h This gets us a consistent mechanism throughout LLVM for ensuring linkage. Next step is to make sure its used in enough places. --- Diffs of the changes: (+6 -9) CallGraph.cpp | 9 +++------ FindUsedTypes.cpp | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.53 llvm/lib/Analysis/IPA/CallGraph.cpp:1.54 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.53 Thu Jun 1 12:17:37 2006 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Wed Jun 7 17:00:26 2006 @@ -19,8 +19,6 @@ #include using namespace llvm; -int llvm::BasicCallGraphStub; - static bool isOnlyADirectCall(Function *F, CallSite CS) { if (!CS.getInstruction()) return false; for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I) @@ -256,10 +254,6 @@ return CGN = new CallGraphNode(const_cast(F)); } - - -int CallGraph::stub; // to ensure linkage of this file. - void CallGraphNode::print(std::ostream &OS) const { if (Function *F = getFunction()) OS << "Call graph node for function: '" << F->getName() <<"'\n"; @@ -297,3 +291,6 @@ --i; --e; } } + +// Enuse that users of CallGraph.h also link with this file +DEFINING_FILE_FOR(CallGraph) Index: llvm/lib/Analysis/IPA/FindUsedTypes.cpp diff -u llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.35 llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.36 --- llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.35 Thu Jun 1 02:02:51 2006 +++ llvm/lib/Analysis/IPA/FindUsedTypes.cpp Wed Jun 7 17:00:26 2006 @@ -24,9 +24,6 @@ static RegisterAnalysis X("printusedtypes", "Find Used Types"); -// stub to help linkage -int FindUsedTypes::stub; // to ensure linkage of this file - // IncorporateType - Incorporate one type and all of its subtypes into the // collection of used types. // @@ -104,3 +101,6 @@ E = UsedTypes.end(); I != E; ++I) o << " " << **I << "\n"; } + +// Ensure that this file gets linked in when FindUsedTypes.h is used. +DEFINING_FILE_FOR(FindUsedTypes) From reid at x10sys.com Wed Jun 7 17:09:51 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 17:09:51 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/LinkAllVMCore.h Message-ID: <200606072209.RAA23742@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: LinkAllVMCore.h updated: 1.1 -> 1.2 --- Log message: Previous version of this file wasn't supposed to be committed. This version attempts to get all of libVMCore.a through the least number of declarations. --- Diffs of the changes: (+12 -30) LinkAllVMCore.h | 42 ++++++++++++------------------------------ 1 files changed, 12 insertions(+), 30 deletions(-) Index: llvm/include/llvm/LinkAllVMCore.h diff -u llvm/include/llvm/LinkAllVMCore.h:1.1 llvm/include/llvm/LinkAllVMCore.h:1.2 --- llvm/include/llvm/LinkAllVMCore.h:1.1 Wed Jun 7 15:00:19 2006 +++ llvm/include/llvm/LinkAllVMCore.h Wed Jun 7 17:09:38 2006 @@ -7,51 +7,33 @@ // //===----------------------------------------------------------------------===// // -// This header file pulls in all analysis passes for tools like analyze and -// bugpoint that need this functionality. +// This header file pulls in all the object modules of the VMCore library so +// that tools like llc, opt, and lli can ensure they are linked with all symbols +// from libVMCore.a It should only be used from a tool's main program. // //===----------------------------------------------------------------------===// #ifndef LLVM_LINKALLVMCORE_H #define LLVM_LINKALLVMCORE_H -#include -#include -#include -#include -#include -#include -#include +#include "llvm/Support/IncludeFile.h" +#include "llvm/Module.h" +#include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" +#include "llvm/Analysis/Verifier.h" namespace { struct ForceVMCoreLinking { ForceVMCoreLinking() { - // We must reference the passes in such a way that compilers will not + // We must reference VMCore in such a way that compilers will not // delete it all as dead code, even with whole program optimization, // yet is effectively a NO-OP. As the compiler isn't smart enough // to know that getenv() never returns -1, this will do the job. if (std::getenv("bar") != (char*) -1) return; - - (void)new llvm::LocalDataStructures(); - (void)new llvm::BUDataStructures(); - (void)new llvm::TDDataStructures(); - (void)new llvm::CompleteBUDataStructures(); - (void)new llvm::EquivClassGraphs(); - (void)llvm::createDataStructureStatsPass(); - (void)llvm::createDataStructureGraphCheckerPass(); - (void)llvm::createProfileLoaderPass(); - (void)llvm::createNoProfileInfoPass(); - (void)llvm::createInstCountPass(); - (void)new llvm::IntervalPartition(); - (void)new llvm::ImmediateDominators(); - (void)new llvm::PostDominatorSet(); - (void)new llvm::FindUsedTypes(); - (void)new llvm::ScalarEvolution(); - (void)new llvm::CallTargetFinder(); - ((llvm::Function*)0)->viewCFGOnly(); - llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0); - X.add((llvm::Value*)0, 0); // for -print-alias-sets + (void)new llvm::Module(""); + (void)new llvm::UnreachableInst(); + (void) llvm::createVerifierPass(); } } ForceVMCoreLinking; } From lattner at cs.uiuc.edu Wed Jun 7 17:20:15 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 7 Jun 2006 17:20:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/SlotCalculator.cpp Message-ID: <200606072220.RAA23870@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: SlotCalculator.cpp updated: 1.73 -> 1.74 --- Log message: Fix a bug where the types for inlineasm nodes were not properly entered into the compaction table for a function. This broke compilation of hexxagon on darwin/x86 with recent changes. --- Diffs of the changes: (+2 -2) SlotCalculator.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Bytecode/Writer/SlotCalculator.cpp diff -u llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.73 llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.74 --- llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.73 Wed Jan 25 17:08:15 2006 +++ llvm/lib/Bytecode/Writer/SlotCalculator.cpp Wed Jun 7 17:20:03 2006 @@ -275,7 +275,7 @@ SC_DEBUG("begin processFunction!\n"); // If we emitted all of the function constants, build a compaction table. - if ( ModuleContainsAllFunctionConstants) + if (ModuleContainsAllFunctionConstants) buildCompactionTable(F); // Update the ModuleLevel entries to be accurate. @@ -465,7 +465,7 @@ for (const_inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) { getOrCreateCompactionTableSlot(I->getType()); for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op) - if (isa(I->getOperand(op))) + if (isa(I->getOperand(op)) || isa(I->getOperand(op))) getOrCreateCompactionTableSlot(I->getOperand(op)); } From lattner at cs.uiuc.edu Wed Jun 7 17:47:56 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 7 Jun 2006 17:47:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/InlineAsm.cpp Message-ID: <200606072247.RAA24182@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: InlineAsm.cpp updated: 1.9 -> 1.10 --- Log message: Add a virtual dtor to the InlineAsm class so that the principle method of the class can be defined in InlineAsm.cpp --- Diffs of the changes: (+6 -0) InlineAsm.cpp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/lib/VMCore/InlineAsm.cpp diff -u llvm/lib/VMCore/InlineAsm.cpp:1.9 llvm/lib/VMCore/InlineAsm.cpp:1.10 --- llvm/lib/VMCore/InlineAsm.cpp:1.9 Thu Feb 23 17:36:53 2006 +++ llvm/lib/VMCore/InlineAsm.cpp Wed Jun 7 17:47:44 2006 @@ -17,6 +17,12 @@ #include using namespace llvm; +// Implement the first virtual method in this class in this file so the +// InlineAsm vtable is emitted here. +InlineAsm::~InlineAsm() { +} + + // NOTE: when memoizing the function type, we have to be careful to handle the // case when the type gets refined. From lattner at cs.uiuc.edu Wed Jun 7 17:47:56 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 7 Jun 2006 17:47:56 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/InlineAsm.h Message-ID: <200606072247.RAA24186@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: InlineAsm.h updated: 1.10 -> 1.11 --- Log message: Add a virtual dtor to the InlineAsm class so that the principle method of the class can be defined in InlineAsm.cpp --- Diffs of the changes: (+1 -0) InlineAsm.h | 1 + 1 files changed, 1 insertion(+) Index: llvm/include/llvm/InlineAsm.h diff -u llvm/include/llvm/InlineAsm.h:1.10 llvm/include/llvm/InlineAsm.h:1.11 --- llvm/include/llvm/InlineAsm.h:1.10 Thu Feb 23 17:36:23 2006 +++ llvm/include/llvm/InlineAsm.h Wed Jun 7 17:47:44 2006 @@ -35,6 +35,7 @@ InlineAsm(const FunctionType *Ty, const std::string &AsmString, const std::string &Constraints, bool hasSideEffects); + ~InlineAsm(); public: /// InlineAsm::get - Return the the specified uniqued inline asm string. From reid at x10sys.com Wed Jun 7 18:03:29 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:03:29 -0500 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200606072303.SAA24313@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.133 -> 1.134 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o 2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage 3. Make each of the tools with --load options include LinkAllVMCore.h This should be the last set of changes for this bug and 800. --- Diffs of the changes: (+1 -0) llc.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.133 llvm/tools/llc/llc.cpp:1.134 --- llvm/tools/llc/llc.cpp:1.133 Fri May 12 01:33:48 2006 +++ llvm/tools/llc/llc.cpp Wed Jun 7 18:03:13 2006 @@ -28,6 +28,7 @@ #include "llvm/Analysis/Verifier.h" #include "llvm/System/Signals.h" #include "llvm/Config/config.h" +#include "llvm/LinkAllVMCore.h" #include #include #include From reid at x10sys.com Wed Jun 7 18:03:31 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:03:31 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/llvm-db.cpp Message-ID: <200606072303.SAA24332@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: llvm-db.cpp updated: 1.10 -> 1.11 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o 2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage 3. Make each of the tools with --load options include LinkAllVMCore.h This should be the last set of changes for this bug and 800. --- Diffs of the changes: (+1 -0) llvm-db.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/tools/llvm-db/llvm-db.cpp diff -u llvm/tools/llvm-db/llvm-db.cpp:1.10 llvm/tools/llvm-db/llvm-db.cpp:1.11 --- llvm/tools/llvm-db/llvm-db.cpp:1.10 Tue Apr 18 00:26:10 2006 +++ llvm/tools/llvm-db/llvm-db.cpp Wed Jun 7 18:03:13 2006 @@ -16,6 +16,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/PluginLoader.h" #include "llvm/System/Signals.h" +#include "llvm/LinkAllVMCore.h" #include using namespace llvm; From reid at x10sys.com Wed Jun 7 18:03:30 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:03:30 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200606072303.SAA24324@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.108 -> 1.109 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o 2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage 3. Make each of the tools with --load options include LinkAllVMCore.h This should be the last set of changes for this bug and 800. --- Diffs of the changes: (+1 -0) opt.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.108 llvm/tools/opt/opt.cpp:1.109 --- llvm/tools/opt/opt.cpp:1.108 Fri May 12 01:33:49 2006 +++ llvm/tools/opt/opt.cpp Wed Jun 7 18:03:13 2006 @@ -25,6 +25,7 @@ #include "llvm/Support/PluginLoader.h" #include "llvm/Support/SystemUtils.h" #include "llvm/Transforms/LinkAllPasses.h" +#include "llvm/LinkAllVMCore.h" #include #include #include From reid at x10sys.com Wed Jun 7 18:03:31 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:03:31 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Mangler.h Message-ID: <200606072303.SAA24342@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Mangler.h updated: 1.19 -> 1.20 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o 2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage 3. Make each of the tools with --load options include LinkAllVMCore.h This should be the last set of changes for this bug and 800. --- Diffs of the changes: (+4 -0) Mangler.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/Support/Mangler.h diff -u llvm/include/llvm/Support/Mangler.h:1.19 llvm/include/llvm/Support/Mangler.h:1.20 --- llvm/include/llvm/Support/Mangler.h:1.19 Thu Nov 10 15:39:12 2005 +++ llvm/include/llvm/Support/Mangler.h Wed Jun 7 18:03:13 2006 @@ -14,6 +14,7 @@ #ifndef LLVM_SUPPORT_MANGLER_H #define LLVM_SUPPORT_MANGLER_H +#include "llvm/Support/IncludeFile.h" #include #include #include @@ -103,4 +104,7 @@ } // End llvm namespace +// Force the Mangler.cpp file to be linked when this header is #included +FORCE_DEFINING_FILE_TO_BE_LINKED(Mangler) + #endif // LLVM_SUPPORT_MANGLER_H From reid at x10sys.com Wed Jun 7 18:03:30 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:03:30 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/InlineAsm.h LinkAllVMCore.h Message-ID: <200606072303.SAA24320@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: InlineAsm.h updated: 1.11 -> 1.12 LinkAllVMCore.h updated: 1.2 -> 1.3 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o 2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage 3. Make each of the tools with --load options include LinkAllVMCore.h This should be the last set of changes for this bug and 800. --- Diffs of the changes: (+7 -1) InlineAsm.h | 6 +++++- LinkAllVMCore.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/include/llvm/InlineAsm.h diff -u llvm/include/llvm/InlineAsm.h:1.11 llvm/include/llvm/InlineAsm.h:1.12 --- llvm/include/llvm/InlineAsm.h:1.11 Wed Jun 7 17:47:44 2006 +++ llvm/include/llvm/InlineAsm.h Wed Jun 7 18:03:13 2006 @@ -17,6 +17,7 @@ #define LLVM_INLINEASM_H #include "llvm/Value.h" +#include "llvm/Support/IncludeFile.h" #include namespace llvm { @@ -35,7 +36,7 @@ InlineAsm(const FunctionType *Ty, const std::string &AsmString, const std::string &Constraints, bool hasSideEffects); - ~InlineAsm(); + virtual ~InlineAsm(); public: /// InlineAsm::get - Return the the specified uniqued inline asm string. @@ -128,4 +129,7 @@ } // End llvm namespace +// Make sure the InlineAsm.cpp file is linked when this one is #included. +FORCE_DEFINING_FILE_TO_BE_LINKED(InlineAsm) + #endif Index: llvm/include/llvm/LinkAllVMCore.h diff -u llvm/include/llvm/LinkAllVMCore.h:1.2 llvm/include/llvm/LinkAllVMCore.h:1.3 --- llvm/include/llvm/LinkAllVMCore.h:1.2 Wed Jun 7 17:09:38 2006 +++ llvm/include/llvm/LinkAllVMCore.h Wed Jun 7 18:03:13 2006 @@ -17,9 +17,11 @@ #define LLVM_LINKALLVMCORE_H #include "llvm/Support/IncludeFile.h" +#include "llvm/Support/Mangler.h" #include "llvm/Module.h" #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" +#include "llvm/InlineAsm.h" #include "llvm/Analysis/Verifier.h" namespace { From reid at x10sys.com Wed Jun 7 18:03:31 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:03:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/InlineAsm.cpp Mangler.cpp Message-ID: <200606072303.SAA24330@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: InlineAsm.cpp updated: 1.10 -> 1.11 Mangler.cpp updated: 1.27 -> 1.28 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o 2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage 3. Make each of the tools with --load options include LinkAllVMCore.h This should be the last set of changes for this bug and 800. --- Diffs of the changes: (+5 -0) InlineAsm.cpp | 2 ++ Mangler.cpp | 3 +++ 2 files changed, 5 insertions(+) Index: llvm/lib/VMCore/InlineAsm.cpp diff -u llvm/lib/VMCore/InlineAsm.cpp:1.10 llvm/lib/VMCore/InlineAsm.cpp:1.11 --- llvm/lib/VMCore/InlineAsm.cpp:1.10 Wed Jun 7 17:47:44 2006 +++ llvm/lib/VMCore/InlineAsm.cpp Wed Jun 7 18:03:13 2006 @@ -208,3 +208,5 @@ if (Ty->getNumParams() != NumInputs) return false; return true; } + +DEFINING_FILE_FOR(InlineAsm) Index: llvm/lib/VMCore/Mangler.cpp diff -u llvm/lib/VMCore/Mangler.cpp:1.27 llvm/lib/VMCore/Mangler.cpp:1.28 --- llvm/lib/VMCore/Mangler.cpp:1.27 Mon Feb 13 15:43:26 2006 +++ llvm/lib/VMCore/Mangler.cpp Wed Jun 7 18:03:13 2006 @@ -200,3 +200,6 @@ for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) InsertName(I, Names); } + +// Cause this file to be linked in when Support/Mangler.h is #included +DEFINING_FILE_FOR(Mangler) From reid at x10sys.com Wed Jun 7 18:03:31 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:03:31 -0500 Subject: [llvm-commits] CVS: llvm/tools/analyze/analyze.cpp Message-ID: <200606072303.SAA24338@zion.cs.uiuc.edu> Changes in directory llvm/tools/analyze: analyze.cpp updated: 1.66 -> 1.67 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o 2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage 3. Make each of the tools with --load options include LinkAllVMCore.h This should be the last set of changes for this bug and 800. --- Diffs of the changes: (+1 -0) analyze.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/tools/analyze/analyze.cpp diff -u llvm/tools/analyze/analyze.cpp:1.66 llvm/tools/analyze/analyze.cpp:1.67 --- llvm/tools/analyze/analyze.cpp:1.66 Thu Mar 2 20:12:04 2006 +++ llvm/tools/analyze/analyze.cpp Wed Jun 7 18:03:13 2006 @@ -27,6 +27,7 @@ #include "llvm/System/Signals.h" #include "llvm/Support/PluginLoader.h" #include "llvm/Support/Timer.h" +#include "llvm/LinkAllVMCore.h" #include using namespace llvm; From reid at x10sys.com Wed Jun 7 18:03:31 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:03:31 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200606072303.SAA24346@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.31 -> 1.32 --- Log message: For PR780: http://llvm.cs.uiuc.edu/PR780 : 1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o 2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage 3. Make each of the tools with --load options include LinkAllVMCore.h This should be the last set of changes for this bug and 800. --- Diffs of the changes: (+19 -1) llvm-ld.cpp | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletion(-) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.31 llvm/tools/llvm-ld/llvm-ld.cpp:1.32 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.31 Sun May 14 13:38:13 2006 +++ llvm/tools/llvm-ld/llvm-ld.cpp Wed Jun 7 18:03:13 2006 @@ -20,6 +20,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/LinkAllVMCore.h" #include "llvm/Linker.h" #include "llvm/System/Program.h" #include "llvm/Module.h" @@ -77,9 +78,12 @@ cl::desc("Disable writing of compressed bytecode files")); static cl::list PostLinkOpts("post-link-opts", - cl::value_desc("path to post-link optimization programs"), + cl::value_desc("path"), cl::desc("Run one or more optimization programs after linking")); +static cl::list XLinker("Xlinker", cl::value_desc("option"), + cl::desc("Pass options to the system linker")); + // Compatibility options that are ignored but supported by LD static cl::opt CO3("soname", cl::Hidden, cl::desc("Compatibility option: ignored")); @@ -93,6 +97,7 @@ static cl::opt CO6("h", cl::Hidden, cl::desc("Compatibility option: ignored")); + /// This is just for convenience so it doesn't have to be passed around /// everywhere. static std::string progname; @@ -303,12 +308,25 @@ args.push_back(OutputFilename.c_str()); args.push_back(InputFilename.c_str()); + // Add in the library paths + for (unsigned index = 0; index < LibPaths.size(); index++) { + args.push_back("-L"); + args.push_back(LibPaths[index].c_str()); + } + + // Add the requested options + for (unsigned index = 0; index < XLinker.size(); index++) { + args.push_back(XLinker[index].c_str()); + args.push_back(Libraries[index].c_str()); + } + // Add in the libraries to link. for (unsigned index = 0; index < Libraries.size(); index++) if (Libraries[index] != "crtend") { args.push_back("-l"); args.push_back(Libraries[index].c_str()); } + args.push_back(0); // Run the compiler to assembly and link together the program. From reid at x10sys.com Wed Jun 7 18:07:02 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:07:02 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/bugpoint.cpp Message-ID: <200606072307.SAA24379@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: bugpoint.cpp updated: 1.29 -> 1.30 --- Log message: Make sure this tool links in all of libVMCore.a because it can --load shared objects. --- Diffs of the changes: (+1 -0) bugpoint.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/tools/bugpoint/bugpoint.cpp diff -u llvm/tools/bugpoint/bugpoint.cpp:1.29 llvm/tools/bugpoint/bugpoint.cpp:1.30 --- llvm/tools/bugpoint/bugpoint.cpp:1.29 Tue Jun 6 17:30:59 2006 +++ llvm/tools/bugpoint/bugpoint.cpp Wed Jun 7 18:06:50 2006 @@ -22,6 +22,7 @@ #include "llvm/Support/PluginLoader.h" #include "llvm/System/Process.h" #include "llvm/System/Signals.h" +#include "llvm/LinkAllVMCore.h" using namespace llvm; // AsChild - Specifies that this invocation of bugpoint is being generated From reid at x10sys.com Wed Jun 7 18:08:03 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:08:03 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/Optimize.cpp Message-ID: <200606072308.SAA24398@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: Optimize.cpp updated: 1.7 -> 1.8 --- Log message: Shorten a value description so --help out isn't so wide. --- Diffs of the changes: (+1 -1) Optimize.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llvm-ld/Optimize.cpp diff -u llvm/tools/llvm-ld/Optimize.cpp:1.7 llvm/tools/llvm-ld/Optimize.cpp:1.8 --- llvm/tools/llvm-ld/Optimize.cpp:1.7 Fri Jun 2 17:11:06 2006 +++ llvm/tools/llvm-ld/Optimize.cpp Wed Jun 7 18:07:51 2006 @@ -73,7 +73,7 @@ cl::desc("Alias for -disable-internalize")); static cl::list LoadableModules("load", - cl::value_desc("path to loadable optimization module"), + cl::value_desc("path"), cl::desc("Load an optimization module and run it")); // A utility function that adds a pass to the pass manager but will also add From reid at x10sys.com Wed Jun 7 18:18:47 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:18:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Program.inc Message-ID: <200606072318.SAA24472@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Program.inc updated: 1.16 -> 1.17 --- Log message: For PR787: http://llvm.cs.uiuc.edu/PR787 : Provide new llvm::sys::Program facilities for converting the stdout and stdin to binary mode. There is no standard way to do this and the available mechanisms are platform specific. Adjust the bytecode reader and writer to use these methods when their input is stdin or output is stdout. THis avoids the problem with \n writing CRLF to a bytecode file on windows. Patch Contributed by Michael Smith. --- Diffs of the changes: (+8 -0) Program.inc | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/lib/System/Unix/Program.inc diff -u llvm/lib/System/Unix/Program.inc:1.16 llvm/lib/System/Unix/Program.inc:1.17 --- llvm/lib/System/Unix/Program.inc:1.16 Thu Dec 22 14:00:16 2005 +++ llvm/lib/System/Unix/Program.inc Wed Jun 7 18:18:33 2006 @@ -227,4 +227,12 @@ } +void Program::ChangeStdinToBinary(){ + // Do nothing, as Unix doesn't differentiate between text and binary. +} + +void Program::ChangeStdoutToBinary(){ + // Do nothing, as Unix doesn't differentiate between text and binary. +} + } From reid at x10sys.com Wed Jun 7 18:18:48 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:18:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Program.inc Message-ID: <200606072318.SAA24476@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Program.inc updated: 1.15 -> 1.16 --- Log message: For PR787: http://llvm.cs.uiuc.edu/PR787 : Provide new llvm::sys::Program facilities for converting the stdout and stdin to binary mode. There is no standard way to do this and the available mechanisms are platform specific. Adjust the bytecode reader and writer to use these methods when their input is stdin or output is stdout. THis avoids the problem with \n writing CRLF to a bytecode file on windows. Patch Contributed by Michael Smith. --- Diffs of the changes: (+14 -0) Program.inc | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm/lib/System/Win32/Program.inc diff -u llvm/lib/System/Win32/Program.inc:1.15 llvm/lib/System/Win32/Program.inc:1.16 --- llvm/lib/System/Win32/Program.inc:1.15 Thu Jul 7 21:48:42 2005 +++ llvm/lib/System/Win32/Program.inc Wed Jun 7 18:18:34 2006 @@ -12,8 +12,10 @@ //===----------------------------------------------------------------------===// #include "Win32.h" +#include #include #include +#include //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only Win32 specific code @@ -218,4 +220,16 @@ return status; } +void Program::ChangeStdinToBinary(){ + int result = _setmode( _fileno(stdin), _O_BINARY ); + if( result == -1 ) + throw std::string("Cannot set input mode on stdin to binary."); +} + +void Program::ChangeStdoutToBinary(){ + int result = _setmode( _fileno(stdout), _O_BINARY ); + if( result == -1 ) + throw std::string("Cannot set output mode on stdout to binary."); +} + } From reid at x10sys.com Wed Jun 7 18:18:49 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:18:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Message-ID: <200606072318.SAA24480@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReaderWrappers.cpp updated: 1.53 -> 1.54 --- Log message: For PR787: http://llvm.cs.uiuc.edu/PR787 : Provide new llvm::sys::Program facilities for converting the stdout and stdin to binary mode. There is no standard way to do this and the available mechanisms are platform specific. Adjust the bytecode reader and writer to use these methods when their input is stdin or output is stdout. THis avoids the problem with \n writing CRLF to a bytecode file on windows. Patch Contributed by Michael Smith. --- Diffs of the changes: (+2 -0) ReaderWrappers.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.53 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.54 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.53 Mon Dec 26 08:23:22 2005 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Wed Jun 7 18:18:33 2006 @@ -19,6 +19,7 @@ #include "llvm/Instructions.h" #include "llvm/ADT/StringExtras.h" #include "llvm/System/MappedFile.h" +#include "llvm/System/Program.h" #include #include #include @@ -132,6 +133,7 @@ BytecodeStdinReader::BytecodeStdinReader( BytecodeHandler* H ) : BytecodeReader(H) { + sys::Program::ChangeStdinToBinary(); char Buffer[4096*4]; // Read in all of the data from stdin, we cannot mmap stdin... From reid at x10sys.com Wed Jun 7 18:18:49 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:18:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200606072318.SAA24484@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.121 -> 1.122 --- Log message: For PR787: http://llvm.cs.uiuc.edu/PR787 : Provide new llvm::sys::Program facilities for converting the stdout and stdin to binary mode. There is no standard way to do this and the available mechanisms are platform specific. Adjust the bytecode reader and writer to use these methods when their input is stdin or output is stdout. THis avoids the problem with \n writing CRLF to a bytecode file on windows. Patch Contributed by Michael Smith. --- Diffs of the changes: (+6 -0) Writer.cpp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.121 llvm/lib/Bytecode/Writer/Writer.cpp:1.122 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.121 Fri May 26 13:42:34 2006 +++ llvm/lib/Bytecode/Writer/Writer.cpp Wed Jun 7 18:18:33 2006 @@ -29,6 +29,7 @@ #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/Compressor.h" #include "llvm/Support/MathExtras.h" +#include "llvm/System/Program.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/Statistic.h" #include @@ -1217,6 +1218,11 @@ bool compress ) { assert(M && "You can't write a null module!!"); + // Make sure that std::cout is put into binary mode for systems + // that care. + if (&Out == std::cout) + sys::Program::ChangeStdoutToBinary(); + // Create a vector of unsigned char for the bytecode output. We // reserve 256KBytes of space in the vector so that we avoid doing // lots of little allocations. 256KBytes is sufficient for a large From reid at x10sys.com Wed Jun 7 18:18:49 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 7 Jun 2006 18:18:49 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Program.h Message-ID: <200606072318.SAA24488@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Program.h updated: 1.9 -> 1.10 --- Log message: For PR787: http://llvm.cs.uiuc.edu/PR787 : Provide new llvm::sys::Program facilities for converting the stdout and stdin to binary mode. There is no standard way to do this and the available mechanisms are platform specific. Adjust the bytecode reader and writer to use these methods when their input is stdin or output is stdout. THis avoids the problem with \n writing CRLF to a bytecode file on windows. Patch Contributed by Michael Smith. --- Diffs of the changes: (+4 -0) Program.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/System/Program.h diff -u llvm/include/llvm/System/Program.h:1.9 llvm/include/llvm/System/Program.h:1.10 --- llvm/include/llvm/System/Program.h:1.9 Fri May 19 14:07:54 2006 +++ llvm/include/llvm/System/Program.h Wed Jun 7 18:18:33 2006 @@ -74,6 +74,10 @@ ///< this function will wait until the child finishes or forever if ///< it doesn't. ); + // These methods change the specified standard stream (stdin or stdout) to + // binary mode. + static void ChangeStdinToBinary(); + static void ChangeStdoutToBinary(); }; } } From lattner at cs.uiuc.edu Wed Jun 7 19:25:56 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 7 Jun 2006 19:25:56 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/llvm-db.cpp Message-ID: <200606080025.TAA24879@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: llvm-db.cpp updated: 1.11 -> 1.12 --- Log message: This no longer needs plugins, this it doesn't need all of VMCore. --- Diffs of the changes: (+0 -2) llvm-db.cpp | 2 -- 1 files changed, 2 deletions(-) Index: llvm/tools/llvm-db/llvm-db.cpp diff -u llvm/tools/llvm-db/llvm-db.cpp:1.11 llvm/tools/llvm-db/llvm-db.cpp:1.12 --- llvm/tools/llvm-db/llvm-db.cpp:1.11 Wed Jun 7 18:03:13 2006 +++ llvm/tools/llvm-db/llvm-db.cpp Wed Jun 7 19:25:44 2006 @@ -14,9 +14,7 @@ #include "CLIDebugger.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/PluginLoader.h" #include "llvm/System/Signals.h" -#include "llvm/LinkAllVMCore.h" #include using namespace llvm; From ghost at cs.msu.su Thu Jun 8 10:46:43 2006 From: ghost at cs.msu.su (Vladimir Prus) Date: Thu, 8 Jun 2006 10:46:43 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/BasicBlock.h Message-ID: <200606081546.KAA07066@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: BasicBlock.h updated: 1.58 -> 1.59 --- Log message: New method BasicBlock::getFirstNonPHI. --- Diffs of the changes: (+8 -1) BasicBlock.h | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.58 llvm/include/llvm/BasicBlock.h:1.59 --- llvm/include/llvm/BasicBlock.h:1.58 Mon Jun 5 11:29:06 2006 +++ llvm/include/llvm/BasicBlock.h Thu Jun 8 10:46:17 2006 @@ -91,7 +91,14 @@ /// TerminatorInst *getTerminator(); const TerminatorInst *const getTerminator() const; - + + /// Returns a pointer to the first instructon in this block that is not a + /// PHINode instruction. When adding instruction to the beginning of the + /// basic block, they should be added before the returned value, not before + /// the first instruction, which might be PHI. + /// Returns 0 is there's no non-PHI instruction. + Instruction* getFirstNonPHI(); + /// removeFromParent - This method unlinks 'this' from the containing /// function, but does not delete it. /// From ghost at cs.msu.su Thu Jun 8 10:46:43 2006 From: ghost at cs.msu.su (Vladimir Prus) Date: Thu, 8 Jun 2006 10:46:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp Message-ID: <200606081546.KAA07065@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: BasicBlock.cpp updated: 1.68 -> 1.69 --- Log message: New method BasicBlock::getFirstNonPHI. --- Diffs of the changes: (+11 -0) BasicBlock.cpp | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/lib/VMCore/BasicBlock.cpp diff -u llvm/lib/VMCore/BasicBlock.cpp:1.68 llvm/lib/VMCore/BasicBlock.cpp:1.69 --- llvm/lib/VMCore/BasicBlock.cpp:1.68 Fri Aug 12 17:14:06 2005 +++ llvm/lib/VMCore/BasicBlock.cpp Thu Jun 8 10:46:18 2006 @@ -121,6 +121,17 @@ return dyn_cast(&InstList.back()); } +Instruction* BasicBlock::getFirstNonPHI() +{ + BasicBlock::iterator i = begin(), e = end(); + // All valid basic blocks should have a terminator, + // which is not a PHINode. If we have invalid basic + // block we'll get assert when dereferencing past-the-end + // iterator. + while (isa(i)) ++i; + return &*i; +} + void BasicBlock::dropAllReferences() { for(iterator I = begin(), E = end(); I != E; ++I) I->dropAllReferences(); From jlaskey at apple.com Thu Jun 8 10:52:38 2006 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 8 Jun 2006 12:52:38 -0300 Subject: [llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp In-Reply-To: <200606081546.KAA07065@zion.cs.uiuc.edu> References: <200606081546.KAA07065@zion.cs.uiuc.edu> Message-ID: Vladimir, The e = end() is no longer needed. Cheers, -- Jim On Jun 8, 2006, at 12:46 PM, Vladimir Prus wrote: > +Instruction* BasicBlock::getFirstNonPHI() > +{ > + BasicBlock::iterator i = begin(), e = end(); > + // All valid basic blocks should have a terminator, > + // which is not a PHINode. If we have invalid basic > + // block we'll get assert when dereferencing past-the-end > + // iterator. > + while (isa(i)) ++i; > + return &*i; > +} > + -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20060608/0e906f44/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20060608/0e906f44/attachment.bin From ghost at cs.msu.su Thu Jun 8 11:03:25 2006 From: ghost at cs.msu.su (Vladimir Prus) Date: Thu, 8 Jun 2006 11:03:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp Message-ID: <200606081603.LAA07207@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: BasicBlock.cpp updated: 1.69 -> 1.70 --- Log message: Remove dead code. --- Diffs of the changes: (+1 -1) BasicBlock.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/BasicBlock.cpp diff -u llvm/lib/VMCore/BasicBlock.cpp:1.69 llvm/lib/VMCore/BasicBlock.cpp:1.70 --- llvm/lib/VMCore/BasicBlock.cpp:1.69 Thu Jun 8 10:46:18 2006 +++ llvm/lib/VMCore/BasicBlock.cpp Thu Jun 8 11:03:13 2006 @@ -123,7 +123,7 @@ Instruction* BasicBlock::getFirstNonPHI() { - BasicBlock::iterator i = begin(), e = end(); + BasicBlock::iterator i = begin(); // All valid basic blocks should have a terminator, // which is not a PHINode. If we have invalid basic // block we'll get assert when dereferencing past-the-end From reid at x10sys.com Thu Jun 8 12:00:21 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 8 Jun 2006 12:00:21 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200606081700.MAA07561@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.28 -> 1.29 --- Log message: For PR804: http://llvm.org/PR804 : Change the file size field of StatusInfo to be uint64_t instead of size_t so that we know it is always 64 bits. This prevents some overflow on systems where size_t is 32 bits when it ought to be 64. --- Diffs of the changes: (+1 -1) Path.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.28 llvm/include/llvm/System/Path.h:1.29 --- llvm/include/llvm/System/Path.h:1.28 Wed Feb 22 10:23:43 2006 +++ llvm/include/llvm/System/Path.h Thu Jun 8 12:00:08 2006 @@ -67,7 +67,7 @@ struct StatusInfo { StatusInfo() : fileSize(0), modTime(0,0), mode(0777), user(999), group(999), isDir(false) { } - size_t fileSize; ///< Size of the file in bytes + uint64_t fileSize; ///< Size of the file in bytes TimeValue modTime; ///< Time of file's modification uint32_t mode; ///< Mode of the file, if applicable uint32_t user; ///< User ID of owner, if applicable From reid at x10sys.com Thu Jun 8 12:00:21 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 8 Jun 2006 12:00:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.inc Message-ID: <200606081700.MAA07563@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.inc updated: 1.43 -> 1.44 --- Log message: For PR804: http://llvm.org/PR804 : Change the file size field of StatusInfo to be uint64_t instead of size_t so that we know it is always 64 bits. This prevents some overflow on systems where size_t is 32 bits when it ought to be 64. --- Diffs of the changes: (+1 -1) Path.inc | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/System/Win32/Path.inc diff -u llvm/lib/System/Win32/Path.inc:1.43 llvm/lib/System/Win32/Path.inc:1.44 --- llvm/lib/System/Win32/Path.inc:1.43 Mon Jun 5 10:44:46 2006 +++ llvm/lib/System/Win32/Path.inc Thu Jun 8 12:00:08 2006 @@ -340,7 +340,7 @@ ThrowError("getStatusInfo():" + std::string(path) + ": Can't get status: "); info.fileSize = fi.nFileSizeHigh; - info.fileSize <<= 32; + info.fileSize <<= sizeof(fi.nFileSizeHigh)*8; info.fileSize += fi.nFileSizeLow; info.mode = fi.dwFileAttributes & FILE_ATTRIBUTE_READONLY ? 0555 : 0777; From lattner at cs.uiuc.edu Thu Jun 8 13:00:59 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 8 Jun 2006 13:00:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp Message-ID: <200606081800.NAA07930@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.78 -> 1.79 --- Log message: Fix an assert-on-inline-inline-asm bug. --- Diffs of the changes: (+18 -12) AsmPrinter.cpp | 30 ++++++++++++++++++------------ 1 files changed, 18 insertions(+), 12 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.78 llvm/lib/CodeGen/AsmPrinter.cpp:1.79 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.78 Fri May 12 12:50:35 2006 +++ llvm/lib/CodeGen/AsmPrinter.cpp Thu Jun 8 13:00:47 2006 @@ -656,24 +656,30 @@ // operand! if (CurVariant == -1 || CurVariant == AsmPrinterVariant) { unsigned OpNo = 1; - + + bool Error = false; + // Scan to find the machine operand number for the operand. for (; Val; --Val) { + if (OpNo >= MI->getNumOperands()) break; unsigned OpFlags = MI->getOperand(OpNo).getImmedValue(); OpNo += (OpFlags >> 3) + 1; } - - unsigned OpFlags = MI->getOperand(OpNo).getImmedValue(); - ++OpNo; // Skip over the ID number. - - bool Error; - AsmPrinter *AP = const_cast(this); - if ((OpFlags & 7) == 4 /*ADDR MODE*/) { - Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant, - Modifier[0] ? Modifier : 0); + + if (OpNo >= MI->getNumOperands()) { + Error = true; } else { - Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant, - Modifier[0] ? Modifier : 0); + unsigned OpFlags = MI->getOperand(OpNo).getImmedValue(); + ++OpNo; // Skip over the ID number. + + AsmPrinter *AP = const_cast(this); + if ((OpFlags & 7) == 4 /*ADDR MODE*/) { + Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant, + Modifier[0] ? Modifier : 0); + } else { + Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant, + Modifier[0] ? Modifier : 0); + } } if (Error) { std::cerr << "Invalid operand found in inline asm: '" From lattner at cs.uiuc.edu Thu Jun 8 13:04:02 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 8 Jun 2006 13:04:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200606081804.NAA08035@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.73 -> 1.74 --- Log message: Add support for "m" inline asm constraints. --- Diffs of the changes: (+29 -1) X86ISelDAGToDAG.cpp | 30 +++++++++++++++++++++++++++++- 1 files changed, 29 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.73 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.74 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.73 Fri Jun 2 17:38:37 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Thu Jun 8 13:03:49 2006 @@ -128,7 +128,13 @@ bool TryFoldLoad(SDOperand P, SDOperand N, SDOperand &Base, SDOperand &Scale, SDOperand &Index, SDOperand &Disp); - + /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for + /// inline asm expressions. + virtual bool SelectInlineAsmMemoryOperand(const SDOperand &Op, + char ConstraintCode, + std::vector &OutOps, + SelectionDAG &DAG); + void EmitSpecialCodeForMain(MachineBasicBlock *BB, MachineFrameInfo *MFI); inline void getAddressOperands(X86ISelAddressMode &AM, SDOperand &Base, @@ -876,6 +882,28 @@ #endif } +bool X86DAGToDAGISel:: +SelectInlineAsmMemoryOperand(const SDOperand &Op, char ConstraintCode, + std::vector &OutOps, SelectionDAG &DAG){ + SDOperand Op0, Op1, Op2, Op3; + switch (ConstraintCode) { + case 'o': // offsetable ?? + case 'v': // not offsetable ?? + default: return true; + case 'm': // memory + if (!SelectAddr(Op, Op0, Op1, Op2, Op3)) + return true; + break; + } + + OutOps.resize(4); + Select(OutOps[0], Op0); + Select(OutOps[1], Op1); + Select(OutOps[2], Op2); + Select(OutOps[3], Op3); + return false; +} + /// createX86ISelDag - This pass converts a legalized DAG into a /// X86-specific DAG, ready for instruction scheduling. /// From reid at x10sys.com Thu Jun 8 13:08:57 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 8 Jun 2006 13:08:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.inc Message-ID: <200606081808.NAA08096@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.inc updated: 1.44 -> 1.45 --- Log message: Squelch a warning about signed/unsigned. --- Diffs of the changes: (+1 -1) Path.inc | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/System/Win32/Path.inc diff -u llvm/lib/System/Win32/Path.inc:1.44 llvm/lib/System/Win32/Path.inc:1.45 --- llvm/lib/System/Win32/Path.inc:1.44 Thu Jun 8 12:00:08 2006 +++ llvm/lib/System/Win32/Path.inc Thu Jun 8 13:08:43 2006 @@ -121,7 +121,7 @@ // Append a subdirectory passed on our process id so multiple LLVMs don't // step on each other's toes. - sprintf(pathname, "LLVM_%u", GetCurrentProcessId()); + sprintf(pathname, "LLVM_%u", unsigned(GetCurrentProcessId())); result.appendComponent(pathname); // If there's a directory left over from a previous LLVM execution that From lattner at cs.uiuc.edu Thu Jun 8 13:20:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 8 Jun 2006 13:20:25 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/inline-asm.ll Message-ID: <200606081820.NAA08249@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: inline-asm.ll added (r1.1) --- Log message: New testcase, using "AX" as i32. --- Diffs of the changes: (+8 -0) inline-asm.ll | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/test/Regression/CodeGen/X86/inline-asm.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/inline-asm.ll:1.1 *** /dev/null Thu Jun 8 13:20:23 2006 --- llvm/test/Regression/CodeGen/X86/inline-asm.ll Thu Jun 8 13:20:13 2006 *************** *** 0 **** --- 1,8 ---- + ; RUN: llvm-as < %s | llc -march=x86 + + int %test1() { + ; Dest is AX, dest type = i32. + %tmp4 = call int asm sideeffect "FROB %0", "={ax}"() + ret int %tmp4 + } + From lattner at cs.uiuc.edu Thu Jun 8 13:23:00 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 8 Jun 2006 13:23:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200606081823.NAA08287@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.253 -> 1.254 --- Log message: Fix Regression/CodeGen/X86/inline-asm.ll, a case where inline asm causes implement extension of a register. --- Diffs of the changes: (+13 -6) SelectionDAGISel.cpp | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.253 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.254 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.253 Fri May 26 18:13:20 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jun 8 13:22:48 2006 @@ -1780,15 +1780,19 @@ return DAG.getNode(ISD::BUILD_PAIR, ValueVT, Hi, Val); } - // Otherwise, if the return value was promoted, truncate it to the + // Otherwise, if the return value was promoted or extended, truncate it to the // appropriate type. if (RegVT == ValueVT) return Val; - if (MVT::isInteger(RegVT)) - return DAG.getNode(ISD::TRUNCATE, ValueVT, Val); - else + if (MVT::isInteger(RegVT)) { + if (ValueVT < RegVT) + return DAG.getNode(ISD::TRUNCATE, ValueVT, Val); + else + return DAG.getNode(ISD::ANY_EXTEND, ValueVT, Val); + } else { return DAG.getNode(ISD::FP_ROUND, ValueVT, Val); + } } /// getCopyToRegs - Emit a series of CopyToReg nodes that copies the @@ -1895,14 +1899,17 @@ if (PhysReg.first) { if (VT == MVT::Other) ValueVT = *PhysReg.second->vt_begin(); - RegVT = VT; + + // Get the actual register value type. This is important, because the user + // may have asked for (e.g.) the AX register in i32 type. We need to + // remember that AX is actually i16 to get the right extension. + RegVT = *PhysReg.second->vt_begin(); // This is a explicit reference to a physical register. Regs.push_back(PhysReg.first); // If this is an expanded reference, add the rest of the regs to Regs. if (NumRegs != 1) { - RegVT = *PhysReg.second->vt_begin(); TargetRegisterClass::iterator I = PhysReg.second->begin(); TargetRegisterClass::iterator E = PhysReg.second->end(); for (; *I != PhysReg.first; ++I) From lattner at cs.uiuc.edu Thu Jun 8 13:27:00 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 8 Jun 2006 13:27:00 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/inline-asm.ll Message-ID: <200606081827.NAA08382@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: inline-asm.ll updated: 1.1 -> 1.2 --- Log message: Add new testcase --- Diffs of the changes: (+7 -1) inline-asm.ll | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/X86/inline-asm.ll diff -u llvm/test/Regression/CodeGen/X86/inline-asm.ll:1.1 llvm/test/Regression/CodeGen/X86/inline-asm.ll:1.2 --- llvm/test/Regression/CodeGen/X86/inline-asm.ll:1.1 Thu Jun 8 13:20:13 2006 +++ llvm/test/Regression/CodeGen/X86/inline-asm.ll Thu Jun 8 13:26:48 2006 @@ -2,7 +2,13 @@ int %test1() { ; Dest is AX, dest type = i32. - %tmp4 = call int asm sideeffect "FROB %0", "={ax}"() + %tmp4 = call int asm sideeffect "FROB $0", "={ax}"() ret int %tmp4 } +void %test2(int %V) { + ; input is AX, in type = i32. + call void asm sideeffect "FROB $0", "{ax}"(int %V) + ret void +} + From lattner at cs.uiuc.edu Thu Jun 8 13:27:23 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 8 Jun 2006 13:27:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200606081827.NAA08392@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.254 -> 1.255 --- Log message: Fix X86/inline-asm.ll:test2, a case where an input value was implicitly truncated. --- Diffs of the changes: (+6 -3) SelectionDAGISel.cpp | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.254 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.255 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.254 Thu Jun 8 13:22:48 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jun 8 13:27:11 2006 @@ -1804,9 +1804,12 @@ // If there is a single register and the types differ, this must be // a promotion. if (RegVT != ValueVT) { - if (MVT::isInteger(RegVT)) - Val = DAG.getNode(ISD::ANY_EXTEND, RegVT, Val); - else + if (MVT::isInteger(RegVT)) { + if (RegVT < ValueVT) + Val = DAG.getNode(ISD::TRUNCATE, RegVT, Val); + else + Val = DAG.getNode(ISD::ANY_EXTEND, RegVT, Val); + } else Val = DAG.getNode(ISD::FP_EXTEND, RegVT, Val); } Chain = DAG.getCopyToReg(Chain, Regs[0], Val, Flag); From resistor at mac.com Thu Jun 8 15:03:06 2006 From: resistor at mac.com (Owen Anderson) Date: Thu, 8 Jun 2006 15:03:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LCSSA.cpp Message-ID: <200606082003.PAA09117@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LCSSA.cpp updated: 1.15 -> 1.16 --- Log message: Update some comments, and expose LCSSAID in preparation for having other passes require LCSSA. --- Diffs of the changes: (+8 -1) LCSSA.cpp | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Utils/LCSSA.cpp diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.15 llvm/lib/Transforms/Utils/LCSSA.cpp:1.16 --- llvm/lib/Transforms/Utils/LCSSA.cpp:1.15 Mon Jun 5 23:36:36 2006 +++ llvm/lib/Transforms/Utils/LCSSA.cpp Thu Jun 8 15:02:53 2006 @@ -86,7 +86,9 @@ } FunctionPass *llvm::createLCSSAPass() { return new LCSSA(); } +const PassInfo *llvm::LCSSAID = X.getPassInfo(); +/// runOnFunction - Process all loops in the function, inner-most out. bool LCSSA::runOnFunction(Function &F) { bool changed = false; LI = &getAnalysis(); @@ -100,6 +102,8 @@ return changed; } +/// visitSubloop - Recursively process all subloops, and then process the given +/// loop if it has live-out values. bool LCSSA::visitSubloop(Loop* L) { for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I) visitSubloop(*I); @@ -131,7 +135,8 @@ return true; } -/// processInstruction - +/// processInstruction - Given a live-out instruction, insert LCSSA Phi nodes, +/// eliminate all out-of-loop uses. void LCSSA::processInstruction(Instruction* Instr, const std::vector& exitBlocks) { @@ -252,6 +257,8 @@ return AffectedValues; } +/// getValueDominatingBlock - Return the value within the potential dominators +/// map that dominates the given block. Instruction *LCSSA::getValueDominatingBlock(BasicBlock *BB, std::map& PotDoms) { DominatorTree::Node* bbNode = DT->getNode(BB); From resistor at mac.com Thu Jun 8 15:03:05 2006 From: resistor at mac.com (Owen Anderson) Date: Thu, 8 Jun 2006 15:03:05 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Scalar.h Message-ID: <200606082003.PAA09113@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: Scalar.h updated: 1.65 -> 1.66 --- Log message: Update some comments, and expose LCSSAID in preparation for having other passes require LCSSA. --- Diffs of the changes: (+1 -0) Scalar.h | 1 + 1 files changed, 1 insertion(+) Index: llvm/include/llvm/Transforms/Scalar.h diff -u llvm/include/llvm/Transforms/Scalar.h:1.65 llvm/include/llvm/Transforms/Scalar.h:1.66 --- llvm/include/llvm/Transforms/Scalar.h:1.65 Fri May 26 08:58:26 2006 +++ llvm/include/llvm/Transforms/Scalar.h Thu Jun 8 15:02:53 2006 @@ -306,6 +306,7 @@ // This pass inserts phi nodes at loop boundaries to simplify other loop // optimizations. FunctionPass *createLCSSAPass(); +extern const PassInfo *LCSSAID; } // End llvm namespace From evan.cheng at apple.com Thu Jun 8 19:12:54 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 8 Jun 2006 19:12:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200606090012.TAA10977@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.83 -> 1.84 --- Log message: RewriteExpr, either the new PHI node of induction variable or the post-increment value, should be first cast to the appropriated type (to the type of the common expr). Otherwise, the rewrite of a use based on (common + iv) may end up with an incorrect type. --- Diffs of the changes: (+3 -0) LoopStrengthReduce.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.83 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.84 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.83 Wed Apr 12 14:28:15 2006 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Thu Jun 8 19:12:42 2006 @@ -1074,6 +1074,9 @@ if (L->contains(User.Inst->getParent())) User.Inst->moveBefore(LatchBlock->getTerminator()); } + if (RewriteOp->getType() != ReplacedTy) + RewriteOp = SCEVExpander::InsertCastOfTo(RewriteOp, ReplacedTy); + SCEVHandle RewriteExpr = SCEVUnknown::get(RewriteOp); // Clear the SCEVExpander's expression map so that we are guaranteed From evan.cheng at apple.com Fri Jun 9 01:24:54 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 9 Jun 2006 01:24:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200606090624.BAA12142@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.227 -> 1.228 --- Log message: Minor compilation speed improvement. --- Diffs of the changes: (+2 -2) X86ISelLowering.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.227 llvm/lib/Target/X86/X86ISelLowering.cpp:1.228 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.227 Tue Jun 6 18:30:24 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Fri Jun 9 01:24:42 2006 @@ -3413,8 +3413,8 @@ MachineFunction &MF = DAG.getMachineFunction(); const Function* Fn = MF.getFunction(); if (Fn->hasExternalLinkage() && - Fn->getName() == "main" && - Subtarget->TargetType == X86Subtarget::isCygwin) + Subtarget->TargetType == X86Subtarget::isCygwin && + Fn->getName() == "main") MF.getInfo()->setForceFramePointer(true); unsigned CC = cast(Op.getOperand(1))->getValue(); From evan.cheng at apple.com Fri Jun 9 01:25:22 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 9 Jun 2006 01:25:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86MachineFunctionInfo.h Message-ID: <200606090625.BAA12157@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86MachineFunctionInfo.h updated: 1.1 -> 1.2 --- Log message: Comments to appease sabre. --- Diffs of the changes: (+7 -1) X86MachineFunctionInfo.h | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86MachineFunctionInfo.h diff -u llvm/lib/Target/X86/X86MachineFunctionInfo.h:1.1 llvm/lib/Target/X86/X86MachineFunctionInfo.h:1.2 --- llvm/lib/Target/X86/X86MachineFunctionInfo.h:1.1 Tue Jun 6 18:30:24 2006 +++ llvm/lib/Target/X86/X86MachineFunctionInfo.h Fri Jun 9 01:25:10 2006 @@ -18,8 +18,14 @@ namespace llvm { +/// X86FunctionInfo - This class is derived from MachineFunction private +/// X86 target-specific information for each MachineFunction. class X86FunctionInfo : public MachineFunctionInfo { - bool ForceFramePointer; // Function requires use of frame pointer. + // ForceFramePointer - True if the function is required to use of frame + // pointer for reasons other than it containing dynamic allocation or + // that FP eliminatation is turned off. For example, Cygwin main function + // contains stack pointer re-alignment code which requires FP. + bool ForceFramePointer; public: X86FunctionInfo(MachineFunction& MF) : ForceFramePointer(false) {} bool getForceFramePointer() const { return ForceFramePointer;} From resistor at mac.com Fri Jun 9 13:33:44 2006 From: resistor at mac.com (Owen Anderson) Date: Fri, 9 Jun 2006 13:33:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LCSSA.cpp Message-ID: <200606091833.NAA03800@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LCSSA.cpp updated: 1.16 -> 1.17 --- Log message: Make Loop able to verify that it is in LCSSA-form, and have the LCSSA pass assert on this. --- Diffs of the changes: (+3 -1) LCSSA.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Utils/LCSSA.cpp diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.16 llvm/lib/Transforms/Utils/LCSSA.cpp:1.17 --- llvm/lib/Transforms/Utils/LCSSA.cpp:1.16 Thu Jun 8 15:02:53 2006 +++ llvm/lib/Transforms/Utils/LCSSA.cpp Fri Jun 9 13:33:30 2006 @@ -98,7 +98,7 @@ for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) { changed |= visitSubloop(*I); } - + return changed; } @@ -132,6 +132,8 @@ processInstruction(*I, exitBlocks); } + assert(L->isLCSSAForm()); + return true; } From resistor at mac.com Fri Jun 9 13:33:44 2006 From: resistor at mac.com (Owen Anderson) Date: Fri, 9 Jun 2006 13:33:44 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/LoopInfo.h Message-ID: <200606091833.NAA03808@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: LoopInfo.h updated: 1.54 -> 1.55 --- Log message: Make Loop able to verify that it is in LCSSA-form, and have the LCSSA pass assert on this. --- Diffs of the changes: (+4 -1) LoopInfo.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/LoopInfo.h diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.54 llvm/include/llvm/Analysis/LoopInfo.h:1.55 --- llvm/include/llvm/Analysis/LoopInfo.h:1.54 Wed Jun 7 17:00:25 2006 +++ llvm/include/llvm/Analysis/LoopInfo.h Fri Jun 9 13:33:30 2006 @@ -98,7 +98,7 @@ /// isLoopInvariant - Return true if the specified value is loop invariant /// bool isLoopInvariant(Value *V) const; - + //===--------------------------------------------------------------------===// // APIs for simple analysis of the loop. // @@ -147,6 +147,9 @@ /// Value *getTripCount() const; + /// isLCSSAForm - Return true if the Loop is in LCSSA form + bool isLCSSAForm() const; + //===--------------------------------------------------------------------===// // APIs for updating loop information after changing the CFG // From resistor at mac.com Fri Jun 9 13:33:44 2006 From: resistor at mac.com (Owen Anderson) Date: Fri, 9 Jun 2006 13:33:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/LoopInfo.cpp Message-ID: <200606091833.NAA03804@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: LoopInfo.cpp updated: 1.70 -> 1.71 --- Log message: Make Loop able to verify that it is in LCSSA-form, and have the LCSSA pass assert on this. --- Diffs of the changes: (+16 -0) LoopInfo.cpp | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.70 llvm/lib/Analysis/LoopInfo.cpp:1.71 --- llvm/lib/Analysis/LoopInfo.cpp:1.70 Wed Jun 7 17:00:26 2006 +++ llvm/lib/Analysis/LoopInfo.cpp Fri Jun 9 13:33:30 2006 @@ -479,6 +479,22 @@ return 0; } +/// isLCSSAForm - Return true if the Loop is in LCSSA form +bool Loop::isLCSSAForm() const { + for (Loop::block_iterator BB = block_begin(), E = block_end(); + BB != E; ++BB) { + for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ++I) + for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; + ++UI) { + BasicBlock *UserBB = cast(*UI)->getParent(); + if (!isa(*UI) && !contains(UserBB)) { + return false; + } + } + } + + return true; +} //===-------------------------------------------------------------------===// // APIs for updating loop information after changing the CFG From resistor at mac.com Fri Jun 9 13:40:44 2006 From: resistor at mac.com (Owen Anderson) Date: Fri, 9 Jun 2006 13:40:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Message-ID: <200606091840.NAA03848@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnswitch.cpp updated: 1.36 -> 1.37 --- Log message: Add LCSSA as a requirement for LoopUnswitch, and assert that LoopUnswitch preserves LCSSA. --- Diffs of the changes: (+4 -0) LoopUnswitch.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.36 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.37 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.36 Fri Mar 24 01:14:00 2006 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Fri Jun 9 13:40:32 2006 @@ -73,6 +73,8 @@ AU.addPreservedID(LoopSimplifyID); AU.addRequired(); AU.addPreserved(); + AU.addRequiredID(LCSSAID); + AU.addPreservedID(LCSSAID); } private: @@ -199,6 +201,8 @@ } } + assert(L->isLCSSAForm()); + return Changed; } From evan.cheng at apple.com Fri Jun 9 15:43:23 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 9 Jun 2006 15:43:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Program.inc Message-ID: <200606092043.PAA04362@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Program.inc updated: 1.17 -> 1.18 --- Log message: Don't pull in environ, not always safe. Global variables are bad anyway. Use execve when explicit environment variables ptr is available. Otherwise just use execv. --- Diffs of the changes: (+4 -8) Program.inc | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) Index: llvm/lib/System/Unix/Program.inc diff -u llvm/lib/System/Unix/Program.inc:1.17 llvm/lib/System/Unix/Program.inc:1.18 --- llvm/lib/System/Unix/Program.inc:1.17 Wed Jun 7 18:18:33 2006 +++ llvm/lib/System/Unix/Program.inc Fri Jun 9 15:43:11 2006 @@ -29,8 +29,6 @@ #include #endif -extern char** environ; - namespace llvm { using namespace sys; @@ -147,13 +145,11 @@ } } - // Set up the environment - char** env = environ; - if (envp != 0) - env = (char**) envp; - // Execute! - execve (path.c_str(), (char** const)args, env); + if (envp != 0) + execve (path.c_str(), (char** const)args, (char**)envp); + else + execv (path.c_str(), (char** const)args); // If the execve() failed, we should exit and let the parent pick up // our non-zero exit status. exit (errno); From lattner at cs.uiuc.edu Fri Jun 9 16:32:06 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 9 Jun 2006 16:32:06 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ToolRunner.cpp Message-ID: <200606092132.QAA04741@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ToolRunner.cpp updated: 1.52 -> 1.53 --- Log message: After telling GCC to type of the input file with -x asm/-x c, switch back to -x none, to not foul up autodetection of .a file or .dylibs. --- Diffs of the changes: (+2 -0) ToolRunner.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/tools/bugpoint/ToolRunner.cpp diff -u llvm/tools/bugpoint/ToolRunner.cpp:1.52 llvm/tools/bugpoint/ToolRunner.cpp:1.53 --- llvm/tools/bugpoint/ToolRunner.cpp:1.52 Tue Jun 6 17:30:59 2006 +++ llvm/tools/bugpoint/ToolRunner.cpp Fri Jun 9 16:31:53 2006 @@ -405,6 +405,8 @@ #endif } GCCArgs.push_back(ProgramFile.c_str()); // Specify the input filename... + GCCArgs.push_back("-x"); + GCCArgs.push_back("none"); GCCArgs.push_back("-o"); sys::Path OutputBinary (ProgramFile+".gcc.exe"); OutputBinary.makeUnique(); From lattner at cs.uiuc.edu Fri Jun 9 16:47:37 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 9 Jun 2006 16:47:37 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs Message-ID: <200606092147.QAA04905@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.214 -> 1.215 --- Log message: llvmgcc4 uses -regalloc=local at -O0. As it turns out, it's massively buggy, we should fix it, and fixing it requires testing it. --- Diffs of the changes: (+1 -1) Makefile.programs | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.214 llvm-test/Makefile.programs:1.215 --- llvm-test/Makefile.programs:1.214 Tue Jun 6 19:05:16 2006 +++ llvm-test/Makefile.programs Fri Jun 9 16:47:24 2006 @@ -187,7 +187,7 @@ endif#DISABLE_DIFFS ifeq ($(ARCH),PowerPC) -LLCBETAOPTION := -sched=list-td +LLCBETAOPTION := -regalloc=local endif ifeq ($(ARCH),Alpha) LLCBETAOPTION := -sched=list-td From lattner at cs.uiuc.edu Fri Jun 9 18:59:56 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 9 Jun 2006 18:59:56 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200606092359.SAA05817@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.207 -> 1.208 --- Log message: Wrap to 80 cols --- Diffs of the changes: (+5 -4) DAGISelEmitter.cpp | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.207 llvm/utils/TableGen/DAGISelEmitter.cpp:1.208 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.207 Thu May 25 15:16:55 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Fri Jun 9 18:59:44 2006 @@ -2748,7 +2748,8 @@ emitCode(" Result = SDOperand(ResNode, N.ResNo-1);"); } emitCode("else"); - emitCode(" Result = SDOperand(" + ChainName + ".Val, " + ChainName + ".ResNo);"); + emitCode(" Result = SDOperand(" + ChainName + ".Val, " + + ChainName + ".ResNo);"); } else { emitCode("Result = SDOperand(ResNode, N.ResNo);"); } @@ -2780,8 +2781,8 @@ if (NodeHasInFlag || HasImpInputs) Code += ", InFlag"; emitCode(Code + ");"); - emitCode(" SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, N.ResNo, " - "ResNode, 0);"); + emitCode(" SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, N.ResNo" + ", ResNode, 0);"); emitCode(" Result = SDOperand(ResNode, 0);"); emitCode("}"); } @@ -3544,7 +3545,7 @@ << "E = From.Val->use_end(); UI != E; ++UI) {\n"; OS << " SDNode *Use = *UI;\n"; OS << " std::vector Ops;\n"; - OS << " for (unsigned i = 0, e = Use->getNumOperands(); i != e; ++i) {\n"; + OS << " for (unsigned i = 0, e = Use->getNumOperands(); i != e; ++i){\n"; OS << " SDOperand O = Use->getOperand(i);\n"; OS << " if (O.Val == From.Val)\n"; OS << " Ops.push_back(To);\n"; From lattner at cs.uiuc.edu Fri Jun 9 20:14:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 9 Jun 2006 20:14:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.td PPCISelLowering.cpp Message-ID: <200606100114.UAA06170@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstrInfo.td updated: 1.221 -> 1.222 PPCISelLowering.cpp updated: 1.186 -> 1.187 --- Log message: Fix a problem exposed by the local allocator. CALL instructions are not marked as using incoming argument registers, so the local allocator would clobber them between their set and use. To fix this, we give the call instructions a variable number of uses in the CALL MachineInstr itself, so live variables understands the live ranges of these register arguments. --- Diffs of the changes: (+22 -18) PPCISelLowering.cpp | 32 ++++++++++++++++++-------------- PPCInstrInfo.td | 8 ++++---- 2 files changed, 22 insertions(+), 18 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.221 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.222 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.221 Tue Jun 6 16:29:23 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Fri Jun 9 20:14:28 2006 @@ -71,7 +71,7 @@ def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PPCCallSeq,[SDNPHasChain]>; def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PPCCallSeq,[SDNPHasChain]>; -def SDT_PPCCall : SDTypeProfile<0, 1, [SDTCisVT<0, i32>]>; +def SDT_PPCCall : SDTypeProfile<0, -1, [SDTCisVT<0, i32>]>; def PPCcall : SDNode<"PPCISD::CALL", SDT_PPCCall, [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>; def PPCmtctr : SDNode<"PPCISD::MTCTR", SDT_PPCCall, @@ -310,11 +310,11 @@ LR,CTR, CR0,CR1,CR5,CR6,CR7] in { // Convenient aliases for call instructions - def BL : IForm<18, 0, 1, (ops calltarget:$func), + def BL : IForm<18, 0, 1, (ops calltarget:$func, variable_ops), "bl $func", BrB, []>; // See Pat patterns below. - def BLA : IForm<18, 1, 1, (ops aaddr:$func), + def BLA : IForm<18, 1, 1, (ops aaddr:$func, variable_ops), "bla $func", BrB, [(PPCcall imm:$func)]>; - def BCTRL : XLForm_2_ext<19, 528, 20, 0, 1, (ops), "bctrl", BrB, + def BCTRL : XLForm_2_ext<19, 528, 20, 0, 1, (ops variable_ops), "bctrl", BrB, [(PPCbctrl)]>; } Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.186 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.187 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.186 Tue May 30 16:21:04 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Fri Jun 9 20:14:28 2006 @@ -1041,6 +1041,11 @@ } std::vector NodeTys; + NodeTys.push_back(MVT::Other); // Returns a chain + NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use. + + std::vector Ops; + unsigned CallOpc = PPCISD::CALL; // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol @@ -1055,11 +1060,8 @@ else { // Otherwise, this is an indirect call. We have to use a MTCTR/BCTRL pair // to do the call, we can't use PPCISD::CALL. - std::vector Ops; Ops.push_back(Chain); Ops.push_back(Callee); - NodeTys.push_back(MVT::Other); - NodeTys.push_back(MVT::Flag); if (InFlag.Val) Ops.push_back(InFlag); @@ -1075,25 +1077,27 @@ NodeTys.push_back(MVT::Flag); Ops.clear(); Ops.push_back(Chain); - Ops.push_back(InFlag); - Chain = DAG.getNode(PPCISD::BCTRL, NodeTys, Ops); - InFlag = Chain.getValue(1); + CallOpc = PPCISD::BCTRL; Callee.Val = 0; } - // Create the PPCISD::CALL node itself. + // If this is a direct call, pass the chain and the callee. if (Callee.Val) { - NodeTys.push_back(MVT::Other); // Returns a chain - NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use. - std::vector Ops; Ops.push_back(Chain); Ops.push_back(Callee); - if (InFlag.Val) - Ops.push_back(InFlag); - Chain = DAG.getNode(PPCISD::CALL, NodeTys, Ops); - InFlag = Chain.getValue(1); } + // Add argument registers to the end of the list so that they are known live + // into the call. + for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) + Ops.push_back(DAG.getRegister(RegsToPass[i].first, + RegsToPass[i].second.getValueType())); + + if (InFlag.Val) + Ops.push_back(InFlag); + Chain = DAG.getNode(CallOpc, NodeTys, Ops); + InFlag = Chain.getValue(1); + std::vector ResultVals; NodeTys.clear(); From lattner at cs.uiuc.edu Fri Jun 9 20:15:14 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 9 Jun 2006 20:15:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Message-ID: <200606100115.UAA06213@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.191 -> 1.192 --- Log message: Work around a nasty tblgen bug where it doesn't add operands for varargs nodes correctly. --- Diffs of the changes: (+157 -0) PPCISelDAGToDAG.cpp | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 157 insertions(+) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.191 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.192 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.191 Thu May 25 13:06:16 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Fri Jun 9 20:15:02 2006 @@ -152,6 +152,8 @@ private: SDOperand SelectSETCC(SDOperand Op); + void MySelect_PPCbctrl(SDOperand &Result, SDOperand N); + void MySelect_PPCcall(SDOperand &Result, SDOperand N); }; } @@ -1093,6 +1095,7 @@ return; } case ISD::BRIND: { + // FIXME: Should custom lower this. SDOperand Chain, Target; Select(Chain, N->getOperand(0)); Select(Target,N->getOperand(1)); @@ -1101,12 +1104,166 @@ Result = CurDAG->SelectNodeTo(N, PPC::BCTR, MVT::Other, Chain); return; } + // FIXME: These are manually selected because tblgen isn't handling varargs + // nodes correctly. + case PPCISD::BCTRL: MySelect_PPCbctrl(Result, Op); return; + case PPCISD::CALL: MySelect_PPCcall(Result, Op); return; } SelectCode(Result, Op); } +// FIXME: This is manually selected because tblgen isn't handling varargs nodes +// correctly. +void PPCDAGToDAGISel::MySelect_PPCbctrl(SDOperand &Result, SDOperand N) { + SDOperand Chain(0, 0); + SDOperand InFlag(0, 0); + SDNode *ResNode; + + bool hasFlag = + N.getOperand(N.getNumOperands()-1).getValueType() == MVT::Flag; + + std::vector Ops; + // Push varargs arguments, including optional flag. + for (unsigned i = 1, e = N.getNumOperands()-hasFlag; i != e; ++i) { + Select(Chain, N.getOperand(i)); + Ops.push_back(Chain); + } + + Select(Chain, N.getOperand(0)); + Ops.push_back(Chain); + + if (hasFlag) { + Select(Chain, N.getOperand(N.getNumOperands()-1)); + Ops.push_back(Chain); + } + + ResNode = CurDAG->getTargetNode(PPC::BCTRL, MVT::Other, MVT::Flag, Ops); + Chain = SDOperand(ResNode, 0); + InFlag = SDOperand(ResNode, 1); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 0, Chain.Val, + Chain.ResNo); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 1, InFlag.Val, + InFlag.ResNo); + Result = SDOperand(ResNode, N.ResNo); + return; +} + +// FIXME: This is manually selected because tblgen isn't handling varargs nodes +// correctly. +void PPCDAGToDAGISel::MySelect_PPCcall(SDOperand &Result, SDOperand N) { + SDOperand Chain(0, 0); + SDOperand InFlag(0, 0); + SDOperand N1(0, 0); + SDOperand Tmp0(0, 0); + SDNode *ResNode; + Chain = N.getOperand(0); + N1 = N.getOperand(1); + + // Pattern: (PPCcall:void (imm:i32):$func) + // Emits: (BLA:void (imm:i32):$func) + // Pattern complexity = 4 cost = 1 + if (N1.getOpcode() == ISD::Constant) { + unsigned Tmp0C = (unsigned)cast(N1)->getValue(); + + std::vector Ops; + Ops.push_back(CurDAG->getTargetConstant(Tmp0C, MVT::i32)); + + bool hasFlag = + N.getOperand(N.getNumOperands()-1).getValueType() == MVT::Flag; + + // Push varargs arguments, not including optional flag. + for (unsigned i = 2, e = N.getNumOperands()-hasFlag; i != e; ++i) { + Select(Chain, N.getOperand(i)); + Ops.push_back(Chain); + } + Select(Chain, N.getOperand(0)); + Ops.push_back(Chain); + if (hasFlag) { + Select(Chain, N.getOperand(N.getNumOperands()-1)); + Ops.push_back(Chain); + } + ResNode = CurDAG->getTargetNode(PPC::BLA, MVT::Other, MVT::Flag, Ops); + + Chain = SDOperand(ResNode, 0); + InFlag = SDOperand(ResNode, 1); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 0, Chain.Val, Chain.ResNo); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 1, InFlag.Val, InFlag.ResNo); + Result = SDOperand(ResNode, N.ResNo); + return; + } + + // Pattern: (PPCcall:void (tglobaladdr:i32):$dst) + // Emits: (BL:void (tglobaladdr:i32):$dst) + // Pattern complexity = 4 cost = 1 + if (N1.getOpcode() == ISD::TargetGlobalAddress) { + std::vector Ops; + Ops.push_back(N1); + + bool hasFlag = + N.getOperand(N.getNumOperands()-1).getValueType() == MVT::Flag; + + // Push varargs arguments, not including optional flag. + for (unsigned i = 2, e = N.getNumOperands()-hasFlag; i != e; ++i) { + Select(Chain, N.getOperand(i)); + Ops.push_back(Chain); + } + Select(Chain, N.getOperand(0)); + Ops.push_back(Chain); + if (hasFlag) { + Select(Chain, N.getOperand(N.getNumOperands()-1)); + Ops.push_back(Chain); + } + + ResNode = CurDAG->getTargetNode(PPC::BL, MVT::Other, MVT::Flag, Ops); + + Chain = SDOperand(ResNode, 0); + InFlag = SDOperand(ResNode, 1); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 0, Chain.Val, Chain.ResNo); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 1, InFlag.Val, InFlag.ResNo); + Result = SDOperand(ResNode, N.ResNo); + return; + } + + // Pattern: (PPCcall:void (texternalsym:i32):$dst) + // Emits: (BL:void (texternalsym:i32):$dst) + // Pattern complexity = 4 cost = 1 + if (N1.getOpcode() == ISD::TargetExternalSymbol) { + std::vector Ops; + Ops.push_back(N1); + + bool hasFlag = + N.getOperand(N.getNumOperands()-1).getValueType() == MVT::Flag; + + // Push varargs arguments, not including optional flag. + for (unsigned i = 2, e = N.getNumOperands()-hasFlag; i != e; ++i) { + Select(Chain, N.getOperand(i)); + Ops.push_back(Chain); + } + Select(Chain, N.getOperand(0)); + Ops.push_back(Chain); + if (hasFlag) { + Select(Chain, N.getOperand(N.getNumOperands()-1)); + Ops.push_back(Chain); + } + + ResNode = CurDAG->getTargetNode(PPC::BL, MVT::Other, MVT::Flag, Ops); + + Chain = SDOperand(ResNode, 0); + InFlag = SDOperand(ResNode, 1); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 0, Chain.Val, Chain.ResNo); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 1, InFlag.Val, InFlag.ResNo); + Result = SDOperand(ResNode, N.ResNo); + return; + } + std::cerr << "Cannot yet select: "; + N.Val->dump(CurDAG); + std::cerr << '\n'; + abort(); +} + + /// createPPCISelDag - This pass converts a legalized DAG into a /// PowerPC-specific DAG, ready for instruction scheduling. /// From lattner at cs.uiuc.edu Fri Jun 9 23:16:59 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 9 Jun 2006 23:16:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200606100416.XAA07366@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.153 -> 1.154 --- Log message: Add a missing assertion that would have helped out Reid --- Diffs of the changes: (+2 -0) Constants.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.153 llvm/lib/VMCore/Constants.cpp:1.154 --- llvm/lib/VMCore/Constants.cpp:1.153 Tue May 30 13:15:07 2006 +++ llvm/lib/VMCore/Constants.cpp Fri Jun 9 23:16:23 2006 @@ -863,6 +863,8 @@ static char getValType(ConstantAggregateZero *CPZ) { return 0; } Constant *ConstantAggregateZero::get(const Type *Ty) { + assert((isa(Ty) || isa(Ty) || isa(Ty)) && + "Cannot create an aggregate zero of non-aggregate type!"); return AggZeroConstants.getOrCreate(Ty, 0); } From evan.cheng at apple.com Sun Jun 11 04:33:40 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 11 Jun 2006 04:33:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/LoopInfo.cpp Message-ID: <200606110933.EAA05990@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: LoopInfo.cpp updated: 1.71 -> 1.72 --- Log message: Back out Owen's 6/9 changes. They broke MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others). --- Diffs of the changes: (+0 -16) LoopInfo.cpp | 16 ---------------- 1 files changed, 16 deletions(-) Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.71 llvm/lib/Analysis/LoopInfo.cpp:1.72 --- llvm/lib/Analysis/LoopInfo.cpp:1.71 Fri Jun 9 13:33:30 2006 +++ llvm/lib/Analysis/LoopInfo.cpp Sun Jun 11 04:32:57 2006 @@ -479,22 +479,6 @@ return 0; } -/// isLCSSAForm - Return true if the Loop is in LCSSA form -bool Loop::isLCSSAForm() const { - for (Loop::block_iterator BB = block_begin(), E = block_end(); - BB != E; ++BB) { - for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ++I) - for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; - ++UI) { - BasicBlock *UserBB = cast(*UI)->getParent(); - if (!isa(*UI) && !contains(UserBB)) { - return false; - } - } - } - - return true; -} //===-------------------------------------------------------------------===// // APIs for updating loop information after changing the CFG From evan.cheng at apple.com Sun Jun 11 04:33:40 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 11 Jun 2006 04:33:40 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/LoopInfo.h Message-ID: <200606110933.EAA05991@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: LoopInfo.h updated: 1.55 -> 1.56 --- Log message: Back out Owen's 6/9 changes. They broke MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others). --- Diffs of the changes: (+1 -4) LoopInfo.h | 5 +---- 1 files changed, 1 insertion(+), 4 deletions(-) Index: llvm/include/llvm/Analysis/LoopInfo.h diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.55 llvm/include/llvm/Analysis/LoopInfo.h:1.56 --- llvm/include/llvm/Analysis/LoopInfo.h:1.55 Fri Jun 9 13:33:30 2006 +++ llvm/include/llvm/Analysis/LoopInfo.h Sun Jun 11 04:32:54 2006 @@ -98,7 +98,7 @@ /// isLoopInvariant - Return true if the specified value is loop invariant /// bool isLoopInvariant(Value *V) const; - + //===--------------------------------------------------------------------===// // APIs for simple analysis of the loop. // @@ -147,9 +147,6 @@ /// Value *getTripCount() const; - /// isLCSSAForm - Return true if the Loop is in LCSSA form - bool isLCSSAForm() const; - //===--------------------------------------------------------------------===// // APIs for updating loop information after changing the CFG // From evan.cheng at apple.com Sun Jun 11 04:33:40 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 11 Jun 2006 04:33:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Message-ID: <200606110933.EAA05992@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnswitch.cpp updated: 1.37 -> 1.38 --- Log message: Back out Owen's 6/9 changes. They broke MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others). --- Diffs of the changes: (+0 -4) LoopUnswitch.cpp | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.37 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.38 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.37 Fri Jun 9 13:40:32 2006 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Sun Jun 11 04:32:57 2006 @@ -73,8 +73,6 @@ AU.addPreservedID(LoopSimplifyID); AU.addRequired(); AU.addPreserved(); - AU.addRequiredID(LCSSAID); - AU.addPreservedID(LCSSAID); } private: @@ -201,8 +199,6 @@ } } - assert(L->isLCSSAForm()); - return Changed; } From evan.cheng at apple.com Sun Jun 11 04:33:40 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 11 Jun 2006 04:33:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LCSSA.cpp Message-ID: <200606110933.EAA05993@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LCSSA.cpp updated: 1.17 -> 1.18 --- Log message: Back out Owen's 6/9 changes. They broke MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others). --- Diffs of the changes: (+1 -3) LCSSA.cpp | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/Transforms/Utils/LCSSA.cpp diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.17 llvm/lib/Transforms/Utils/LCSSA.cpp:1.18 --- llvm/lib/Transforms/Utils/LCSSA.cpp:1.17 Fri Jun 9 13:33:30 2006 +++ llvm/lib/Transforms/Utils/LCSSA.cpp Sun Jun 11 04:32:57 2006 @@ -98,7 +98,7 @@ for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) { changed |= visitSubloop(*I); } - + return changed; } @@ -132,8 +132,6 @@ processInstruction(*I, exitBlocks); } - assert(L->isLCSSAForm()); - return true; } From resistor at mac.com Sun Jun 11 14:22:41 2006 From: resistor at mac.com (Owen Anderson) Date: Sun, 11 Jun 2006 14:22:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LCSSA.cpp Message-ID: <200606111922.OAA15185@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LCSSA.cpp updated: 1.18 -> 1.19 --- Log message: Re-commit the safe parts of my 6/9 patch. Still working on fixing the unsafe parts. --- Diffs of the changes: (+2 -0) LCSSA.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Transforms/Utils/LCSSA.cpp diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.18 llvm/lib/Transforms/Utils/LCSSA.cpp:1.19 --- llvm/lib/Transforms/Utils/LCSSA.cpp:1.18 Sun Jun 11 04:32:57 2006 +++ llvm/lib/Transforms/Utils/LCSSA.cpp Sun Jun 11 14:22:28 2006 @@ -132,6 +132,8 @@ processInstruction(*I, exitBlocks); } + assert(L->isLCSSAForm()); + return true; } From resistor at mac.com Sun Jun 11 14:22:42 2006 From: resistor at mac.com (Owen Anderson) Date: Sun, 11 Jun 2006 14:22:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/LoopInfo.cpp Message-ID: <200606111922.OAA15189@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: LoopInfo.cpp updated: 1.72 -> 1.73 --- Log message: Re-commit the safe parts of my 6/9 patch. Still working on fixing the unsafe parts. --- Diffs of the changes: (+16 -0) LoopInfo.cpp | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.72 llvm/lib/Analysis/LoopInfo.cpp:1.73 --- llvm/lib/Analysis/LoopInfo.cpp:1.72 Sun Jun 11 04:32:57 2006 +++ llvm/lib/Analysis/LoopInfo.cpp Sun Jun 11 14:22:28 2006 @@ -479,6 +479,22 @@ return 0; } +/// isLCSSAForm - Return true if the Loop is in LCSSA form +bool Loop::isLCSSAForm() const { + for (Loop::block_iterator BB = block_begin(), E = block_end(); + BB != E; ++BB) { + for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ++I) + for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; + ++UI) { + BasicBlock *UserBB = cast(*UI)->getParent(); + if (!isa(*UI) && !contains(UserBB)) { + return false; + } + } + } + + return true; +} //===-------------------------------------------------------------------===// // APIs for updating loop information after changing the CFG From resistor at mac.com Sun Jun 11 14:22:42 2006 From: resistor at mac.com (Owen Anderson) Date: Sun, 11 Jun 2006 14:22:42 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/LoopInfo.h Message-ID: <200606111922.OAA15193@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: LoopInfo.h updated: 1.56 -> 1.57 --- Log message: Re-commit the safe parts of my 6/9 patch. Still working on fixing the unsafe parts. --- Diffs of the changes: (+3 -0) LoopInfo.h | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/include/llvm/Analysis/LoopInfo.h diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.56 llvm/include/llvm/Analysis/LoopInfo.h:1.57 --- llvm/include/llvm/Analysis/LoopInfo.h:1.56 Sun Jun 11 04:32:54 2006 +++ llvm/include/llvm/Analysis/LoopInfo.h Sun Jun 11 14:22:28 2006 @@ -146,6 +146,9 @@ /// this returns null. /// Value *getTripCount() const; + + /// isLCSSAForm - Return true if the Loop is in LCSSA form + bool isLCSSAForm() const; //===--------------------------------------------------------------------===// // APIs for updating loop information after changing the CFG