From lattner at cs.uiuc.edu Mon Nov 14 00:54:45 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 00:54:45 -0600
Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac
Message-ID: <200511140654.AAA07233@zion.cs.uiuc.edu>
Changes in directory llvm/autoconf:
configure.ac updated: 1.198 -> 1.199
---
Log message:
add some stuff for mstats on darwin
---
Diffs of the changes: (+2 -1)
configure.ac | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.198 llvm/autoconf/configure.ac:1.199
--- llvm/autoconf/configure.ac:1.198 Tue Nov 8 15:13:01 2005
+++ llvm/autoconf/configure.ac Mon Nov 14 00:54:33 2005
@@ -486,6 +486,7 @@
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([rw/stdex/hash_map.h rw/stdex/hash_set.h])
if test "$ENABLE_THREADS" -eq 1 ; then
AC_CHECK_HEADERS(pthread.h)
@@ -515,7 +516,7 @@
AC_CHECK_FUNCS([backtrace getcwd getpagesize getrusage gettimeofday ])
AC_CHECK_FUNCS([isatty mkdtemp mkstemp mktemp ])
AC_CHECK_FUNCS([realpath sbrk setrlimit strdup strerror strerror_r ])
-AC_CHECK_FUNCS([strtoll strtoq sysconf])
+AC_CHECK_FUNCS([strtoll strtoq sysconf mstats ])
AC_C_PRINTF_A
AC_FUNC_ALLOCA
AC_FUNC_RAND48
From lattner at cs.uiuc.edu Mon Nov 14 00:57:22 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 00:57:22 -0600
Subject: [llvm-commits] CVS: llvm/configure
Message-ID: <200511140657.AAA07454@zion.cs.uiuc.edu>
Changes in directory llvm:
configure updated: 1.201 -> 1.202
---
Log message:
regenerate
---
Diffs of the changes: (+152 -1)
configure | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 152 insertions(+), 1 deletion(-)
Index: llvm/configure
diff -u llvm/configure:1.201 llvm/configure:1.202
--- llvm/configure:1.201 Tue Nov 8 15:12:58 2005
+++ llvm/configure Mon Nov 14 00:57:11 2005
@@ -26802,6 +26802,156 @@
done
+for ac_header in 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
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 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_objext'
+ { (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
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to llvmbugs at cs.uiuc.edu ##
+## ----------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
for ac_header in rw/stdex/hash_map.h rw/stdex/hash_set.h
do
@@ -27897,7 +28047,8 @@
-for ac_func in strtoll strtoq sysconf
+
+for ac_func in strtoll strtoq sysconf mstats
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
From lattner at cs.uiuc.edu Mon Nov 14 00:57:45 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 00:57:45 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in
Message-ID: <200511140657.AAA07474@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Config:
config.h.in updated: 1.57 -> 1.58
---
Log message:
regenerate
---
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.57 llvm/include/llvm/Config/config.h.in:1.58
--- llvm/include/llvm/Config/config.h.in:1.57 Wed Aug 24 05:07:21 2005
+++ llvm/include/llvm/Config/config.h.in Mon Nov 14 00:57:34 2005
@@ -185,6 +185,9 @@
/* Define to 1 if you have the header file. */
#undef HAVE_MALLOC_H
+/* Define to 1 if you have the header file. */
+#undef HAVE_MALLOC_MALLOC_H
+
/* Define to 1 if you have the `memcpy' function. */
#undef HAVE_MEMCPY
@@ -213,6 +216,9 @@
/* Define if mmap() can map files into memory */
#undef HAVE_MMAP_FILE
+/* Define to 1 if you have the `mstats' function. */
+#undef HAVE_MSTATS
+
/* define if the compiler implements namespaces */
#undef HAVE_NAMESPACES
From lattner at cs.uiuc.edu Mon Nov 14 01:00:41 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 01:00:41 -0600
Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Process.inc
Message-ID: <200511140700.BAA07661@zion.cs.uiuc.edu>
Changes in directory llvm/lib/System/Unix:
Process.inc updated: 1.11 -> 1.12
---
Log message:
Teach -track-memory to work on darwin. Looking at sbrk doesn't work because
the default allocator uses mmap.
---
Diffs of the changes: (+12 -10)
Process.inc | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
Index: llvm/lib/System/Unix/Process.inc
diff -u llvm/lib/System/Unix/Process.inc:1.11 llvm/lib/System/Unix/Process.inc:1.12
--- llvm/lib/System/Unix/Process.inc:1.11 Thu May 5 17:33:06 2005
+++ llvm/lib/System/Unix/Process.inc Mon Nov 14 01:00:29 2005
@@ -21,6 +21,9 @@
#ifdef HAVE_MALLOC_H
#include
#endif
+#ifdef HAVE_MALLOC_MALLOC_H
+#include
+#endif
//===----------------------------------------------------------------------===//
//=== WARNING: Implementation here must contain only generic UNIX code that
@@ -43,23 +46,20 @@
return static_cast(page_size);
}
-#if defined(HAVE_SBRK)
-static char* som = reinterpret_cast(::sbrk(0));
-#endif
-
-size_t
-Process::GetMallocUsage()
-{
+size_t Process::GetMallocUsage() {
#if defined(HAVE_MALLINFO)
struct mallinfo mi;
mi = ::mallinfo();
return mi.uordblks;
+#elif defined(HAVE_MSTATS) && defined(HAVE_MALLOC_MALLOC_H)
+ return mstats().bytes_used; // darwin
#elif defined(HAVE_SBRK)
// Note this is only an approximation and more closely resembles
// the value returned by mallinfo in the arena field.
- char * eom = (char*) sbrk(0);
- if (eom != ((char*)-1) && som != ((char*)-1))
- return eom - som;
+ static char *StartOfMemory = reinterpret_cast(::sbrk(0));
+ char *EndOfMemory = (char*)sbrk(0);
+ if (EndOfMemory != ((char*)-1) && StartOfMemory != ((char*)-1))
+ return EndOfMemory - StartOfMemory;
else
return 0;
#else
@@ -74,6 +74,8 @@
#if defined(HAVE_MALLINFO)
struct mallinfo mi = ::mallinfo();
return mi.uordblks + mi.hblkhd;
+#elif defined(HAVE_MSTATS) && defined(HAVE_MALLOC_MALLOC_H)
+ return mstats().bytes_total; // darwin
#elif defined(HAVE_GETRUSAGE)
struct rusage usage;
::getrusage(RUSAGE_SELF, &usage);
From lattner at cs.uiuc.edu Mon Nov 14 01:24:13 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 01:24:13 -0600
Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac
Message-ID: <200511140724.BAA08164@zion.cs.uiuc.edu>
Changes in directory llvm/autoconf:
configure.ac updated: 1.199 -> 1.200
---
Log message:
add malloc_zone_statistics, remove mstats
---
Diffs of the changes: (+1 -1)
configure.ac | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.199 llvm/autoconf/configure.ac:1.200
--- llvm/autoconf/configure.ac:1.199 Mon Nov 14 00:54:33 2005
+++ llvm/autoconf/configure.ac Mon Nov 14 01:24:01 2005
@@ -516,7 +516,7 @@
AC_CHECK_FUNCS([backtrace getcwd getpagesize getrusage gettimeofday ])
AC_CHECK_FUNCS([isatty mkdtemp mkstemp mktemp ])
AC_CHECK_FUNCS([realpath sbrk setrlimit strdup strerror strerror_r ])
-AC_CHECK_FUNCS([strtoll strtoq sysconf mstats ])
+AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ])
AC_C_PRINTF_A
AC_FUNC_ALLOCA
AC_FUNC_RAND48
From lattner at cs.uiuc.edu Mon Nov 14 01:24:29 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 01:24:29 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in
Message-ID: <200511140724.BAA08173@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Config:
config.h.in updated: 1.58 -> 1.59
---
Log message:
add malloc_zone_statistics, remove mstats
---
Diffs of the changes: (+3 -3)
config.h.in | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
Index: llvm/include/llvm/Config/config.h.in
diff -u llvm/include/llvm/Config/config.h.in:1.58 llvm/include/llvm/Config/config.h.in:1.59
--- llvm/include/llvm/Config/config.h.in:1.58 Mon Nov 14 00:57:34 2005
+++ llvm/include/llvm/Config/config.h.in Mon Nov 14 01:24:17 2005
@@ -188,6 +188,9 @@
/* Define to 1 if you have the header file. */
#undef HAVE_MALLOC_MALLOC_H
+/* Define to 1 if you have the `malloc_zone_statistics' function. */
+#undef HAVE_MALLOC_ZONE_STATISTICS
+
/* Define to 1 if you have the `memcpy' function. */
#undef HAVE_MEMCPY
@@ -216,9 +219,6 @@
/* Define if mmap() can map files into memory */
#undef HAVE_MMAP_FILE
-/* Define to 1 if you have the `mstats' function. */
-#undef HAVE_MSTATS
-
/* define if the compiler implements namespaces */
#undef HAVE_NAMESPACES
From lattner at cs.uiuc.edu Mon Nov 14 01:26:01 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 01:26:01 -0600
Subject: [llvm-commits] CVS: llvm/configure
Message-ID: <200511140726.BAA08261@zion.cs.uiuc.edu>
Changes in directory llvm:
configure updated: 1.202 -> 1.203
---
Log message:
regenearte
---
Diffs of the changes: (+1 -1)
configure | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/configure
diff -u llvm/configure:1.202 llvm/configure:1.203
--- llvm/configure:1.202 Mon Nov 14 00:57:11 2005
+++ llvm/configure Mon Nov 14 01:25:50 2005
@@ -28048,7 +28048,7 @@
-for ac_func in strtoll strtoq sysconf mstats
+for ac_func in strtoll strtoq sysconf malloc_zone_statistics
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
From lattner at cs.uiuc.edu Mon Nov 14 01:28:08 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 01:28:08 -0600
Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Process.inc
Message-ID: <200511140728.BAA08342@zion.cs.uiuc.edu>
Changes in directory llvm/lib/System/Unix:
Process.inc updated: 1.12 -> 1.13
---
Log message:
instead of using mstats, use malloc_zone_statistics which returns numbers
that actually make sense.
---
Diffs of the changes: (+8 -4)
Process.inc | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
Index: llvm/lib/System/Unix/Process.inc
diff -u llvm/lib/System/Unix/Process.inc:1.12 llvm/lib/System/Unix/Process.inc:1.13
--- llvm/lib/System/Unix/Process.inc:1.12 Mon Nov 14 01:00:29 2005
+++ llvm/lib/System/Unix/Process.inc Mon Nov 14 01:27:56 2005
@@ -51,8 +51,10 @@
struct mallinfo mi;
mi = ::mallinfo();
return mi.uordblks;
-#elif defined(HAVE_MSTATS) && defined(HAVE_MALLOC_MALLOC_H)
- return mstats().bytes_used; // darwin
+#elif defined(HAVE_MALLOC_ZONE_STATISTICS) && defined(HAVE_MALLOC_MALLOC_H)
+ malloc_statistics_t Stats;
+ malloc_zone_statistics(malloc_default_zone(), &Stats);
+ return Stats.size_in_use; // darwin
#elif defined(HAVE_SBRK)
// Note this is only an approximation and more closely resembles
// the value returned by mallinfo in the arena field.
@@ -74,8 +76,10 @@
#if defined(HAVE_MALLINFO)
struct mallinfo mi = ::mallinfo();
return mi.uordblks + mi.hblkhd;
-#elif defined(HAVE_MSTATS) && defined(HAVE_MALLOC_MALLOC_H)
- return mstats().bytes_total; // darwin
+#elif defined(HAVE_MALLOC_ZONE_STATISTICS) && defined(HAVE_MALLOC_MALLOC_H)
+ malloc_statistics_t Stats;
+ malloc_zone_statistics(malloc_default_zone(), &Stats);
+ return Stats.size_allocated; // darwin
#elif defined(HAVE_GETRUSAGE)
struct rusage usage;
::getrusage(RUSAGE_SELF, &usage);
From brukman at cs.uiuc.edu Mon Nov 14 11:59:09 2005
From: brukman at cs.uiuc.edu (Misha Brukman)
Date: Mon, 14 Nov 2005 11:59:09 -0600
Subject: [llvm-commits] CVS: llvm-www/www-index.html
Message-ID: <200511141759.LAA14429@zion.cs.uiuc.edu>
Changes in directory llvm-www:
www-index.html updated: 1.124 -> 1.125
---
Log message:
Fix broken link to list of developers (it's now a CGI script, not static page)
---
Diffs of the changes: (+1 -1)
www-index.html | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm-www/www-index.html
diff -u llvm-www/www-index.html:1.124 llvm-www/www-index.html:1.125
--- llvm-www/www-index.html:1.124 Tue Nov 8 14:30:03 2005
+++ llvm-www/www-index.html Mon Nov 14 11:58:57 2005
@@ -70,7 +70,7 @@
href="http://www.uiuc.edu/">University of Illinois, Urbana-Champaign. Since
the first public release, LLVM has grown to include contributions from several
-other people! We welcome external contributions,
+other people! We welcome external contributions,
so please send e-mail to
llvmdev at cs.uiuc.edu if you are
interested in contributing code to the LLVM infrastructure.
From lattner at cs.uiuc.edu Mon Nov 14 12:52:58 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 12:52:58 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
Message-ID: <200511141852.MAA24290@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCAsmPrinter.cpp updated: 1.106 -> 1.107
---
Log message:
Teach the PPC asmwriter to honor globals with explicit section requests.
---
Diffs of the changes: (+32 -22)
PPCAsmPrinter.cpp | 54 ++++++++++++++++++++++++++++++++----------------------
1 files changed, 32 insertions(+), 22 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.106 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.107
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.106 Thu Nov 10 15:59:25 2005
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Mon Nov 14 12:52:46 2005
@@ -43,9 +43,11 @@
namespace {
Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
- struct PPCAsmPrinter : public AsmPrinter {
+ class PPCAsmPrinter : public AsmPrinter {
+ std::string CurSection;
+ public:
std::set FnStubs, GVStubs, LinkOnceStubs;
-
+
PPCAsmPrinter(std::ostream &O, TargetMachine &TM)
: AsmPrinter(O, TM), FunctionNumber(0) {}
@@ -61,6 +63,25 @@
return static_cast(TM);
}
+ /// SwitchSection - Switch to the specified section of the executable if we
+ /// are not already in it!
+ ///
+ void SwitchSection(const char *NewSection, const GlobalValue *GV) {
+ std::string NS;
+
+ if (GV && GV->hasSection())
+ NS = ".section " + GV->getSection();
+ else
+ NS = NewSection;
+
+
+ if (CurSection != NS) {
+ CurSection = NS;
+ if (!CurSection.empty())
+ O << "\t" << CurSection << "\n";
+ }
+ }
+
unsigned enumRegToMachineReg(unsigned enumReg) {
switch (enumReg) {
default: assert(0 && "Unhandled register!"); break;
@@ -227,18 +248,6 @@
};
} // end of anonymous namespace
-// SwitchSection - Switch to the specified section of the executable if we are
-// not already in it!
-//
-static void SwitchSection(std::ostream &OS, std::string &CurSection,
- const char *NewSection) {
- if (CurSection != NewSection) {
- CurSection = NewSection;
- if (!CurSection.empty())
- OS << "\t" << NewSection << "\n";
- }
-}
-
/// createDarwinAsmPrinterPass - Returns a pass that prints the PPC assembly
/// code for a MachineFunction to the given output stream, in a format that the
/// Darwin assembler can deal with.
@@ -387,9 +396,10 @@
printConstantPool(MF.getConstantPool());
// Print out labels for the function.
- O << "\t.text\n";
+ const Function *F = MF.getFunction();
+ SwitchSection(".text", F);
emitAlignment(4);
- if (!MF.getFunction()->hasInternalLinkage())
+ if (!F->hasInternalLinkage())
O << "\t.globl\t" << CurrentFnName << "\n";
O << CurrentFnName << ":\n";
@@ -444,6 +454,7 @@
bool DarwinAsmPrinter::doInitialization(Module &M) {
if (TM.getSubtarget().isGigaProcessor())
O << "\t.machine ppc970\n";
+ SwitchSection("", 0);
AsmPrinter::doInitialization(M);
// Darwin wants symbols to be quoted if they have complex names.
@@ -453,7 +464,6 @@
bool DarwinAsmPrinter::doFinalization(Module &M) {
const TargetData &TD = TM.getTargetData();
- std::string CurSection;
// Print out module-level global variables here.
for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
@@ -467,7 +477,7 @@
if (C->isNullValue() && /* FIXME: Verify correct */
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
I->hasLinkOnceLinkage())) {
- SwitchSection(O, CurSection, ".data");
+ SwitchSection(".data", I);
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
if (I->hasInternalLinkage())
O << ".lcomm " << name << "," << Size << "," << Align;
@@ -495,10 +505,10 @@
O << "\t.globl " << name << "\n";
// FALL THROUGH
case GlobalValue::InternalLinkage:
- SwitchSection(O, CurSection, ".data");
+ SwitchSection(".data", I);
break;
- case GlobalValue::GhostLinkage:
- std::cerr << "Error: unmaterialized (GhostLinkage) function in asm!";
+ default:
+ std::cerr << "Unknown linkage type!";
abort();
}
@@ -649,8 +659,8 @@
}
bool AIXAsmPrinter::doInitialization(Module &M) {
+ SwitchSection("", 0);
const TargetData &TD = TM.getTargetData();
- std::string CurSection;
O << "\t.machine \"ppc64\"\n"
<< "\t.toc\n"
From lattner at cs.uiuc.edu Mon Nov 14 12:59:54 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 12:59:54 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/AsmPrinter.h
Message-ID: <200511141859.MAA24374@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
AsmPrinter.h updated: 1.14 -> 1.15
---
Log message:
Teach emitAlignment to handle explicit alignment requests by globals.
---
Diffs of the changes: (+3 -2)
AsmPrinter.h | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Index: llvm/include/llvm/CodeGen/AsmPrinter.h
diff -u llvm/include/llvm/CodeGen/AsmPrinter.h:1.14 llvm/include/llvm/CodeGen/AsmPrinter.h:1.15
--- llvm/include/llvm/CodeGen/AsmPrinter.h:1.14 Thu Nov 10 12:05:57 2005
+++ llvm/include/llvm/CodeGen/AsmPrinter.h Mon Nov 14 12:59:42 2005
@@ -137,8 +137,9 @@
/// emitAlignment - Emit an alignment directive to the specified power of
/// two boundary. For example, if you pass in 3 here, you will get an 8
- /// byte alignment.
- void emitAlignment(unsigned NumBits) const;
+ /// byte alignment. If a global value is specified, and if that global has
+ /// an explicit alignment requested, it will override the alignment request.
+ void emitAlignment(unsigned NumBits, const GlobalValue *GV = 0) const;
/// emitZeros - Emit a block of zeros.
///
From lattner at cs.uiuc.edu Mon Nov 14 13:00:17 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 13:00:17 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp
Message-ID: <200511141900.NAA24437@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
AsmPrinter.cpp updated: 1.23 -> 1.24
---
Log message:
Teach emitAlignment to handle explicit alignment requests by globals.
---
Diffs of the changes: (+3 -1)
AsmPrinter.cpp | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.23 llvm/lib/CodeGen/AsmPrinter.cpp:1.24
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.23 Thu Nov 10 12:36:17 2005
+++ llvm/lib/CodeGen/AsmPrinter.cpp Mon Nov 14 13:00:06 2005
@@ -35,7 +35,9 @@
}
// emitAlignment - Emit an alignment directive to the specified power of two.
-void AsmPrinter::emitAlignment(unsigned NumBits) const {
+void AsmPrinter::emitAlignment(unsigned NumBits, const GlobalValue *GV) const {
+ if (GV && GV->getAlignment())
+ NumBits = Log2_32(GV->getAlignment());
if (NumBits == 0) return; // No need to emit alignment.
if (AlignmentIsInBytes) NumBits = 1 << NumBits;
O << AlignDirective << NumBits << "\n";
From lattner at cs.uiuc.edu Mon Nov 14 13:00:41 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 14 Nov 2005 13:00:41 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
Message-ID: <200511141900.NAA24470@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCAsmPrinter.cpp updated: 1.107 -> 1.108
---
Log message:
Handle globals with explicit alignment requests
---
Diffs of the changes: (+4 -4)
PPCAsmPrinter.cpp | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.107 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.108
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.107 Mon Nov 14 12:52:46 2005
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Mon Nov 14 13:00:30 2005
@@ -74,7 +74,6 @@
else
NS = NewSection;
-
if (CurSection != NS) {
CurSection = NS;
if (!CurSection.empty())
@@ -398,7 +397,7 @@
// Print out labels for the function.
const Function *F = MF.getFunction();
SwitchSection(".text", F);
- emitAlignment(4);
+ emitAlignment(4, F);
if (!F->hasInternalLinkage())
O << "\t.globl\t" << CurrentFnName << "\n";
O << CurrentFnName << ":\n";
@@ -466,7 +465,8 @@
const TargetData &TD = TM.getTargetData();
// Print out module-level global variables here.
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
+ for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
+ I != E; ++I)
if (I->hasInitializer()) { // External global require no code
O << '\n';
std::string name = Mang->getValueName(I);
@@ -512,7 +512,7 @@
abort();
}
- emitAlignment(Align);
+ emitAlignment(Align, I);
O << name << ":\t\t\t\t; '" << I->getName() << "'\n";
emitGlobalConstant(C);
}
From alenhar2 at cs.uiuc.edu Mon Nov 14 13:32:17 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Mon, 14 Nov 2005 13:32:17 -0600
Subject: [llvm-commits] CVS: llvm/docs/CommandLine.html
Message-ID: <200511141932.NAA24620@zion.cs.uiuc.edu>
Changes in directory llvm/docs:
CommandLine.html updated: 1.38 -> 1.39
---
Log message:
this file moved
---
Diffs of the changes: (+2 -2)
CommandLine.html | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/docs/CommandLine.html
diff -u llvm/docs/CommandLine.html:1.38 llvm/docs/CommandLine.html:1.39
--- llvm/docs/CommandLine.html:1.38 Fri Aug 26 04:25:54 2005
+++ llvm/docs/CommandLine.html Mon Nov 14 13:32:05 2005
@@ -195,7 +195,7 @@
program:
- #include "Support/CommandLine.h"
+ #include "llvm/Support/CommandLine.h"
Additionally, you need to add this as the first line of your main
@@ -1900,7 +1900,7 @@
Chris Lattner
LLVM Compiler Infrastructure
- Last modified: $Date: 2005/08/26 09:25:54 $
+ Last modified: $Date: 2005/11/14 19:32:05 $