svn commit: r193399 - in vendor/llvm/dist: . docs include/llvm/CodeGen include/llvm/ExecutionEngine include/llvm/Support lib/CodeGen lib/ExecutionEngine/JIT lib/Target/Alpha lib/Target/Mips lib/Tar...

Ed Schouten ed at FreeBSD.org
Wed Jun 3 21:10:17 UTC 2009


Author: ed
Date: Wed Jun  3 21:10:15 2009
New Revision: 193399
URL: http://svn.freebsd.org/changeset/base/193399

Log:
  Import LLVM, at r72805, which fixes PR4315 and PR4316.
  
  Normally I'm not updating sources this often, but I want to get rid of
  this breakage, because right now I can't offer a proper source snapshot
  yet.

Added:
  vendor/llvm/dist/include/llvm/Support/StandardPasses.h
  vendor/llvm/dist/lib/CodeGen/ELFCodeEmitter.cpp
  vendor/llvm/dist/lib/CodeGen/ELFCodeEmitter.h
  vendor/llvm/dist/lib/Target/Alpha/AlphaMachineFunctionInfo.h
  vendor/llvm/dist/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll
  vendor/llvm/dist/test/Transforms/IndVarSimplify/variable-stride-ivs-1.ll
Deleted:
  vendor/llvm/dist/test/Transforms/IndVarSimplify/variable-stride-ivs.ll
Modified:
  vendor/llvm/dist/CMakeLists.txt
  vendor/llvm/dist/docs/CMake.html
  vendor/llvm/dist/docs/GoldPlugin.html
  vendor/llvm/dist/include/llvm/CodeGen/JITCodeEmitter.h
  vendor/llvm/dist/include/llvm/CodeGen/MachineCodeEmitter.h
  vendor/llvm/dist/include/llvm/ExecutionEngine/JITMemoryManager.h
  vendor/llvm/dist/lib/CodeGen/CMakeLists.txt
  vendor/llvm/dist/lib/CodeGen/ELFWriter.cpp
  vendor/llvm/dist/lib/ExecutionEngine/JIT/JITEmitter.cpp
  vendor/llvm/dist/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
  vendor/llvm/dist/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
  vendor/llvm/dist/lib/Target/Alpha/AlphaISelLowering.cpp
  vendor/llvm/dist/lib/Target/Alpha/AlphaInstrInfo.cpp
  vendor/llvm/dist/lib/Target/Alpha/AlphaInstrInfo.h
  vendor/llvm/dist/lib/Target/Mips/MipsISelDAGToDAG.cpp
  vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.cpp
  vendor/llvm/dist/lib/Target/Mips/MipsInstrInfo.cpp
  vendor/llvm/dist/lib/Target/Mips/MipsInstrInfo.h
  vendor/llvm/dist/lib/Target/Mips/MipsMachineFunction.h
  vendor/llvm/dist/lib/Target/PIC16/PIC16.h
  vendor/llvm/dist/lib/Target/PIC16/PIC16AsmPrinter.cpp
  vendor/llvm/dist/lib/Target/PIC16/PIC16DebugInfo.cpp
  vendor/llvm/dist/lib/Target/PIC16/PIC16DebugInfo.h
  vendor/llvm/dist/lib/Target/PIC16/PIC16ISelLowering.cpp
  vendor/llvm/dist/lib/Target/PIC16/PIC16InstrInfo.cpp
  vendor/llvm/dist/lib/Target/PIC16/PIC16InstrInfo.h
  vendor/llvm/dist/lib/Target/PIC16/PIC16InstrInfo.td
  vendor/llvm/dist/lib/Target/X86/X86ISelDAGToDAG.cpp
  vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp
  vendor/llvm/dist/lib/Transforms/Scalar/IndVarSimplify.cpp
  vendor/llvm/dist/tools/llvm-config/CMakeLists.txt
  vendor/llvm/dist/tools/llvm-ld/Optimize.cpp
  vendor/llvm/dist/tools/lto/LTOCodeGenerator.cpp
  vendor/llvm/dist/tools/opt/opt.cpp

Modified: vendor/llvm/dist/CMakeLists.txt
==============================================================================
--- vendor/llvm/dist/CMakeLists.txt	Wed Jun  3 21:02:14 2009	(r193398)
+++ vendor/llvm/dist/CMakeLists.txt	Wed Jun  3 21:10:15 2009	(r193399)
@@ -17,6 +17,8 @@ This process created the file `CMakeCach
 Please delete them.")
 endif()
 
+string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+
 include(FindPerl)
 
 set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
@@ -55,6 +57,16 @@ endif( MSVC )
 
 option(LLVM_ENABLE_THREADS "Use threads if available." ON)
 
+if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
+  option(LLVM_ENABLE_ASSERTS "Enable asserts" OFF)
+else()
+  option(LLVM_ENABLE_ASSERTS "Enable asserts" ON)
+endif()
+
+if( LLVM_ENABLE_ASSERTS )
+  add_definitions( -D_DEBUG -UNDEBUG )
+endif()
+
 if( LLVM_TARGETS_TO_BUILD STREQUAL "all" )
   set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} )
 endif()

Modified: vendor/llvm/dist/docs/CMake.html
==============================================================================
--- vendor/llvm/dist/docs/CMake.html	Wed Jun  3 21:02:14 2009	(r193398)
+++ vendor/llvm/dist/docs/CMake.html	Wed Jun  3 21:10:15 2009	(r193399)
@@ -248,6 +248,10 @@
   <dt><b>LLVM_ENABLE_THREADS</b>:BOOL</dt>
   <dd>Build with threads support, if available. Defaults to ON.</dd>
 
+  <dt><b>LLVM_ENABLE_ASSERTS</b>:BOOL</dt>
+  <dd>Enables code asserts. Defaults to ON if and only if
+    CMAKE_BUILD_TYPE is <i>Release</i>.</dd>
+
   <dt><b>LLVM_ENABLE_PIC</b>:BOOL</dt>
   <dd>Add the <i>-fPIC</i> flag to the compiler command-line, if the
     compiler supports this flag. Some systems, like Windows, does not

Modified: vendor/llvm/dist/docs/GoldPlugin.html
==============================================================================
--- vendor/llvm/dist/docs/GoldPlugin.html	Wed Jun  3 21:02:14 2009	(r193398)
+++ vendor/llvm/dist/docs/GoldPlugin.html	Wed Jun  3 21:10:15 2009	(r193399)
@@ -14,6 +14,7 @@
   <li><a href="#usage">Usage</a>
   <ul>
     <li><a href="#example1">Example of link time optimization</a></li>
+    <li><a href="#lto_autotools">Quickstart for using LTO with autotooled projects</a></li>
   </ul></li>
   <li><a href="#licensing">Licensing</a></li>
 </ol>
@@ -136,6 +137,35 @@ $ llvm-gcc -use-gold-plugin a.o b.o -o m
 </div>
 
 <!--=========================================================================-->
+<div class="doc_section"><a name="lto_autotools">Quickstart for using LTO with autotooled projects</a></div>
+<!--=========================================================================-->
+<div class="doc_text">
+  <p><tt>gold</tt>, <tt>ar</tt> and <tt>nm</tt> all support plugins now, so everything should be
+  in place for an easy to use LTO build of autotooled projects:</p>
+  <ul>
+    <li>Follow the instructions <a href="#build">on how to build libLLVMgold.so</a>.</li>
+    <li>Install the newly built binutils to <tt>$PREFIX</tt></li>
+    <li>Copy <tt>Release/lib/libLLVMgold.so</tt> to
+    <tt>$PREFIX/libexec/gcc/x86_64-unknown-linux-gnu/4.2.1/</tt> and
+    <tt>$PREFIX/lib/bfd-plugins/</tt></li>
+    <li>Set environment variables (<tt>$PREFIX</tt> is where you installed llvm-gcc and
+    binutils):
+    <pre class="doc_code">
+export CC="$PREFIX/bin/llvm-gcc -use-gold-plugin"
+export CXX="$PREFIX/bin/llvm-g++ -use-gold-plugin"
+export AR="$PREFIX/bin/ar --plugin libLLVMgold.so"
+export NM="$PREFIX/bin/nm --plugin libLLVMgold.so"
+export RANLIB=/bin/true #ranlib is not needed, and doesn't support .bc files in .a
+export CFLAGS="-O4"
+     </pre>
+     </li>
+     <li>Configure &amp; build the project as usual: <tt>./configure &amp;&amp; make &amp;&amp; make check</tt> </li>
+   </ul>
+   <p> The environment variable settings may work for non-autotooled projects
+   too, but you may need to set the <tt>LD</tt> environment variable as well.</p>
+</div>
+
+<!--=========================================================================-->
 <div class="doc_section"><a name="licensing">Licensing</a></div>
 <!--=========================================================================-->
 <div class="doc_text">

Modified: vendor/llvm/dist/include/llvm/CodeGen/JITCodeEmitter.h
==============================================================================
--- vendor/llvm/dist/include/llvm/CodeGen/JITCodeEmitter.h	Wed Jun  3 21:02:14 2009	(r193398)
+++ vendor/llvm/dist/include/llvm/CodeGen/JITCodeEmitter.h	Wed Jun  3 21:10:15 2009	(r193399)
@@ -89,7 +89,7 @@ public:
   /// emitByte - This callback is invoked when a byte needs to be written to the
   /// output stream.
   ///
-  void emitByte(uint8_t B) {
+  void emitByte(unsigned char B) {
     if (CurBufferPtr != BufferEnd)
       *CurBufferPtr++ = B;
   }
@@ -99,10 +99,10 @@ public:
   ///
   void emitWordLE(unsigned W) {
     if (4 <= BufferEnd-CurBufferPtr) {
-      *CurBufferPtr++ = (uint8_t)(W >>  0);
-      *CurBufferPtr++ = (uint8_t)(W >>  8);
-      *CurBufferPtr++ = (uint8_t)(W >> 16);
-      *CurBufferPtr++ = (uint8_t)(W >> 24);
+      *CurBufferPtr++ = (unsigned char)(W >>  0);
+      *CurBufferPtr++ = (unsigned char)(W >>  8);
+      *CurBufferPtr++ = (unsigned char)(W >> 16);
+      *CurBufferPtr++ = (unsigned char)(W >> 24);
     } else {
       CurBufferPtr = BufferEnd;
     }
@@ -113,10 +113,10 @@ public:
   ///
   void emitWordBE(unsigned W) {
     if (4 <= BufferEnd-CurBufferPtr) {
-      *CurBufferPtr++ = (uint8_t)(W >> 24);
-      *CurBufferPtr++ = (uint8_t)(W >> 16);
-      *CurBufferPtr++ = (uint8_t)(W >>  8);
-      *CurBufferPtr++ = (uint8_t)(W >>  0);
+      *CurBufferPtr++ = (unsigned char)(W >> 24);
+      *CurBufferPtr++ = (unsigned char)(W >> 16);
+      *CurBufferPtr++ = (unsigned char)(W >>  8);
+      *CurBufferPtr++ = (unsigned char)(W >>  0);
     } else {
       CurBufferPtr = BufferEnd;
     }
@@ -127,14 +127,14 @@ public:
   ///
   void emitDWordLE(uint64_t W) {
     if (8 <= BufferEnd-CurBufferPtr) {
-      *CurBufferPtr++ = (uint8_t)(W >>  0);
-      *CurBufferPtr++ = (uint8_t)(W >>  8);
-      *CurBufferPtr++ = (uint8_t)(W >> 16);
-      *CurBufferPtr++ = (uint8_t)(W >> 24);
-      *CurBufferPtr++ = (uint8_t)(W >> 32);
-      *CurBufferPtr++ = (uint8_t)(W >> 40);
-      *CurBufferPtr++ = (uint8_t)(W >> 48);
-      *CurBufferPtr++ = (uint8_t)(W >> 56);
+      *CurBufferPtr++ = (unsigned char)(W >>  0);
+      *CurBufferPtr++ = (unsigned char)(W >>  8);
+      *CurBufferPtr++ = (unsigned char)(W >> 16);
+      *CurBufferPtr++ = (unsigned char)(W >> 24);
+      *CurBufferPtr++ = (unsigned char)(W >> 32);
+      *CurBufferPtr++ = (unsigned char)(W >> 40);
+      *CurBufferPtr++ = (unsigned char)(W >> 48);
+      *CurBufferPtr++ = (unsigned char)(W >> 56);
     } else {
       CurBufferPtr = BufferEnd;
     }
@@ -145,14 +145,14 @@ public:
   ///
   void emitDWordBE(uint64_t W) {
     if (8 <= BufferEnd-CurBufferPtr) {
-      *CurBufferPtr++ = (uint8_t)(W >> 56);
-      *CurBufferPtr++ = (uint8_t)(W >> 48);
-      *CurBufferPtr++ = (uint8_t)(W >> 40);
-      *CurBufferPtr++ = (uint8_t)(W >> 32);
-      *CurBufferPtr++ = (uint8_t)(W >> 24);
-      *CurBufferPtr++ = (uint8_t)(W >> 16);
-      *CurBufferPtr++ = (uint8_t)(W >>  8);
-      *CurBufferPtr++ = (uint8_t)(W >>  0);
+      *CurBufferPtr++ = (unsigned char)(W >> 56);
+      *CurBufferPtr++ = (unsigned char)(W >> 48);
+      *CurBufferPtr++ = (unsigned char)(W >> 40);
+      *CurBufferPtr++ = (unsigned char)(W >> 32);
+      *CurBufferPtr++ = (unsigned char)(W >> 24);
+      *CurBufferPtr++ = (unsigned char)(W >> 16);
+      *CurBufferPtr++ = (unsigned char)(W >>  8);
+      *CurBufferPtr++ = (unsigned char)(W >>  0);
     } else {
       CurBufferPtr = BufferEnd;
     }
@@ -166,8 +166,8 @@ public:
     if(Alignment <= (uintptr_t)(BufferEnd-CurBufferPtr)) {
       // Move the current buffer ptr up to the specified alignment.
       CurBufferPtr =
-        (uint8_t*)(((uintptr_t)CurBufferPtr+Alignment-1) &
-                   ~(uintptr_t)(Alignment-1));
+        (unsigned char*)(((uintptr_t)CurBufferPtr+Alignment-1) &
+                         ~(uintptr_t)(Alignment-1));
     } else {
       CurBufferPtr = BufferEnd;
     }
@@ -178,7 +178,7 @@ public:
   /// written to the output stream.
   void emitULEB128Bytes(unsigned Value) {
     do {
-      uint8_t Byte = Value & 0x7f;
+      unsigned char Byte = Value & 0x7f;
       Value >>= 7;
       if (Value) Byte |= 0x80;
       emitByte(Byte);
@@ -187,12 +187,12 @@ public:
   
   /// emitSLEB128Bytes - This callback is invoked when a SLEB128 needs to be
   /// written to the output stream.
-  void emitSLEB128Bytes(int32_t Value) {
-    int32_t Sign = Value >> (8 * sizeof(Value) - 1);
+  void emitSLEB128Bytes(int Value) {
+    int Sign = Value >> (8 * sizeof(Value) - 1);
     bool IsMore;
   
     do {
-      uint8_t Byte = Value & 0x7f;
+      unsigned char Byte = Value & 0x7f;
       Value >>= 7;
       IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
       if (IsMore) Byte |= 0x80;
@@ -205,14 +205,14 @@ public:
   void emitString(const std::string &String) {
     for (unsigned i = 0, N = static_cast<unsigned>(String.size());
          i < N; ++i) {
-      uint8_t C = String[i];
+      unsigned char C = String[i];
       emitByte(C);
     }
     emitByte(0);
   }
   
   /// emitInt32 - Emit a int32 directive.
-  void emitInt32(int32_t Value) {
+  void emitInt32(int Value) {
     if (4 <= BufferEnd-CurBufferPtr) {
       *((uint32_t*)CurBufferPtr) = Value;
       CurBufferPtr += 4;

Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineCodeEmitter.h
==============================================================================
--- vendor/llvm/dist/include/llvm/CodeGen/MachineCodeEmitter.h	Wed Jun  3 21:02:14 2009	(r193398)
+++ vendor/llvm/dist/include/llvm/CodeGen/MachineCodeEmitter.h	Wed Jun  3 21:10:15 2009	(r193399)
@@ -50,14 +50,14 @@ class MachineCodeEmitter {
 protected:
   /// BufferBegin/BufferEnd - Pointers to the start and end of the memory
   /// allocated for this code buffer.
-  uint8_t *BufferBegin, *BufferEnd;
+  unsigned char *BufferBegin, *BufferEnd;
   
   /// CurBufferPtr - Pointer to the next byte of memory to fill when emitting 
   /// code.  This is guranteed to be in the range [BufferBegin,BufferEnd].  If
   /// this pointer is at BufferEnd, it will never move due to code emission, and
   /// all code emission requests will be ignored (this is the buffer overflow
   /// condition).
-  uint8_t *CurBufferPtr;
+  unsigned char *CurBufferPtr;
 
 public:
   virtual ~MachineCodeEmitter() {}
@@ -96,7 +96,7 @@ public:
   /// emitByte - This callback is invoked when a byte needs to be written to the
   /// output stream.
   ///
-  void emitByte(uint8_t B) {
+  void emitByte(unsigned char B) {
     if (CurBufferPtr != BufferEnd)
       *CurBufferPtr++ = B;
   }
@@ -106,10 +106,10 @@ public:
   ///
   void emitWordLE(unsigned W) {
     if (4 <= BufferEnd-CurBufferPtr) {
-      *CurBufferPtr++ = (uint8_t)(W >>  0);
-      *CurBufferPtr++ = (uint8_t)(W >>  8);
-      *CurBufferPtr++ = (uint8_t)(W >> 16);
-      *CurBufferPtr++ = (uint8_t)(W >> 24);
+      *CurBufferPtr++ = (unsigned char)(W >>  0);
+      *CurBufferPtr++ = (unsigned char)(W >>  8);
+      *CurBufferPtr++ = (unsigned char)(W >> 16);
+      *CurBufferPtr++ = (unsigned char)(W >> 24);
     } else {
       CurBufferPtr = BufferEnd;
     }
@@ -120,10 +120,10 @@ public:
   ///
   void emitWordBE(unsigned W) {
     if (4 <= BufferEnd-CurBufferPtr) {
-      *CurBufferPtr++ = (uint8_t)(W >> 24);
-      *CurBufferPtr++ = (uint8_t)(W >> 16);
-      *CurBufferPtr++ = (uint8_t)(W >>  8);
-      *CurBufferPtr++ = (uint8_t)(W >>  0);
+      *CurBufferPtr++ = (unsigned char)(W >> 24);
+      *CurBufferPtr++ = (unsigned char)(W >> 16);
+      *CurBufferPtr++ = (unsigned char)(W >>  8);
+      *CurBufferPtr++ = (unsigned char)(W >>  0);
     } else {
       CurBufferPtr = BufferEnd;
     }
@@ -134,14 +134,14 @@ public:
   ///
   void emitDWordLE(uint64_t W) {
     if (8 <= BufferEnd-CurBufferPtr) {
-      *CurBufferPtr++ = (uint8_t)(W >>  0);
-      *CurBufferPtr++ = (uint8_t)(W >>  8);
-      *CurBufferPtr++ = (uint8_t)(W >> 16);
-      *CurBufferPtr++ = (uint8_t)(W >> 24);
-      *CurBufferPtr++ = (uint8_t)(W >> 32);
-      *CurBufferPtr++ = (uint8_t)(W >> 40);
-      *CurBufferPtr++ = (uint8_t)(W >> 48);
-      *CurBufferPtr++ = (uint8_t)(W >> 56);
+      *CurBufferPtr++ = (unsigned char)(W >>  0);
+      *CurBufferPtr++ = (unsigned char)(W >>  8);
+      *CurBufferPtr++ = (unsigned char)(W >> 16);
+      *CurBufferPtr++ = (unsigned char)(W >> 24);
+      *CurBufferPtr++ = (unsigned char)(W >> 32);
+      *CurBufferPtr++ = (unsigned char)(W >> 40);
+      *CurBufferPtr++ = (unsigned char)(W >> 48);
+      *CurBufferPtr++ = (unsigned char)(W >> 56);
     } else {
       CurBufferPtr = BufferEnd;
     }
@@ -152,14 +152,14 @@ public:
   ///
   void emitDWordBE(uint64_t W) {
     if (8 <= BufferEnd-CurBufferPtr) {
-      *CurBufferPtr++ = (uint8_t)(W >> 56);
-      *CurBufferPtr++ = (uint8_t)(W >> 48);
-      *CurBufferPtr++ = (uint8_t)(W >> 40);
-      *CurBufferPtr++ = (uint8_t)(W >> 32);
-      *CurBufferPtr++ = (uint8_t)(W >> 24);
-      *CurBufferPtr++ = (uint8_t)(W >> 16);
-      *CurBufferPtr++ = (uint8_t)(W >>  8);
-      *CurBufferPtr++ = (uint8_t)(W >>  0);
+      *CurBufferPtr++ = (unsigned char)(W >> 56);
+      *CurBufferPtr++ = (unsigned char)(W >> 48);
+      *CurBufferPtr++ = (unsigned char)(W >> 40);
+      *CurBufferPtr++ = (unsigned char)(W >> 32);
+      *CurBufferPtr++ = (unsigned char)(W >> 24);
+      *CurBufferPtr++ = (unsigned char)(W >> 16);
+      *CurBufferPtr++ = (unsigned char)(W >>  8);
+      *CurBufferPtr++ = (unsigned char)(W >>  0);
     } else {
       CurBufferPtr = BufferEnd;
     }
@@ -173,8 +173,8 @@ public:
     if(Alignment <= (uintptr_t)(BufferEnd-CurBufferPtr)) {
       // Move the current buffer ptr up to the specified alignment.
       CurBufferPtr =
-        (uint8_t*)(((uintptr_t)CurBufferPtr+Alignment-1) &
-                   ~(uintptr_t)(Alignment-1));
+        (unsigned char*)(((uintptr_t)CurBufferPtr+Alignment-1) &
+                         ~(uintptr_t)(Alignment-1));
     } else {
       CurBufferPtr = BufferEnd;
     }
@@ -185,7 +185,7 @@ public:
   /// written to the output stream.
   void emitULEB128Bytes(unsigned Value) {
     do {
-      uint8_t Byte = Value & 0x7f;
+      unsigned char Byte = Value & 0x7f;
       Value >>= 7;
       if (Value) Byte |= 0x80;
       emitByte(Byte);
@@ -194,12 +194,12 @@ public:
   
   /// emitSLEB128Bytes - This callback is invoked when a SLEB128 needs to be
   /// written to the output stream.
-  void emitSLEB128Bytes(int32_t Value) {
-    int32_t Sign = Value >> (8 * sizeof(Value) - 1);
+  void emitSLEB128Bytes(int Value) {
+    int Sign = Value >> (8 * sizeof(Value) - 1);
     bool IsMore;
   
     do {
-      uint8_t Byte = Value & 0x7f;
+      unsigned char Byte = Value & 0x7f;
       Value >>= 7;
       IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
       if (IsMore) Byte |= 0x80;
@@ -212,14 +212,14 @@ public:
   void emitString(const std::string &String) {
     for (unsigned i = 0, N = static_cast<unsigned>(String.size());
          i < N; ++i) {
-      uint8_t C = String[i];
+      unsigned char C = String[i];
       emitByte(C);
     }
     emitByte(0);
   }
   
   /// emitInt32 - Emit a int32 directive.
-  void emitInt32(int32_t Value) {
+  void emitInt32(int Value) {
     if (4 <= BufferEnd-CurBufferPtr) {
       *((uint32_t*)CurBufferPtr) = Value;
       CurBufferPtr += 4;

Modified: vendor/llvm/dist/include/llvm/ExecutionEngine/JITMemoryManager.h
==============================================================================
--- vendor/llvm/dist/include/llvm/ExecutionEngine/JITMemoryManager.h	Wed Jun  3 21:02:14 2009	(r193398)
+++ vendor/llvm/dist/include/llvm/ExecutionEngine/JITMemoryManager.h	Wed Jun  3 21:10:15 2009	(r193399)
@@ -60,7 +60,7 @@ public:
   
   /// getGOTBase - If this is managing a Global Offset Table, this method should
   /// return a pointer to its base.
-  virtual uint8_t *getGOTBase() const = 0;
+  virtual unsigned char *getGOTBase() const = 0;
   
   /// SetDlsymTable - If the JIT must be able to relocate stubs after they have
   /// been emitted, potentially because they are being copied to a process
@@ -89,8 +89,8 @@ public:
   /// emit the function, so it doesn't pass in the size.  Instead, this method
   /// is required to pass back a "valid size".  The JIT will be careful to not
   /// write more than the returned ActualSize bytes of memory. 
-  virtual uint8_t *startFunctionBody(const Function *F, 
-                                     uintptr_t &ActualSize) = 0;
+  virtual unsigned char *startFunctionBody(const Function *F, 
+                                           uintptr_t &ActualSize) = 0;
   
   /// allocateStub - This method is called by the JIT to allocate space for a
   /// function stub (used to handle limited branch displacements) while it is
@@ -100,8 +100,9 @@ public:
   /// thunk for it.  The stub should be "close" to the current function body,
   /// but should not be included in the 'actualsize' returned by
   /// startFunctionBody.
-  virtual uint8_t *allocateStub(const GlobalValue* F, unsigned StubSize,
-                                unsigned Alignment) = 0;
+  virtual unsigned char *allocateStub(const GlobalValue* F, unsigned StubSize,
+                                      unsigned Alignment) =0;
+  
   
   /// endFunctionBody - This method is called when the JIT is done codegen'ing
   /// the specified function.  At this point we know the size of the JIT
@@ -109,11 +110,11 @@ public:
   /// the startFunctionBody method) and FunctionEnd which is a pointer to the 
   /// actual end of the function.  This method should mark the space allocated
   /// and remember where it is in case the client wants to deallocate it.
-  virtual void endFunctionBody(const Function *F, uint8_t *FunctionStart,
-                               uint8_t *FunctionEnd) = 0;
+  virtual void endFunctionBody(const Function *F, unsigned char *FunctionStart,
+                               unsigned char *FunctionEnd) = 0;
 
   /// allocateSpace - Allocate a memory block of the given size.
-  virtual uint8_t *allocateSpace(intptr_t Size, unsigned Alignment) = 0;
+  virtual unsigned char *allocateSpace(intptr_t Size, unsigned Alignment) = 0;
   
   /// deallocateMemForFunction - Free JIT memory for the specified function.
   /// This is never called when the JIT is currently emitting a function.
@@ -121,13 +122,14 @@ public:
   
   /// startExceptionTable - When we finished JITing the function, if exception
   /// handling is set, we emit the exception table.
-  virtual uint8_t* startExceptionTable(const Function* F,
-                                       uintptr_t &ActualSize) = 0;
+  virtual unsigned char* startExceptionTable(const Function* F,
+                                             uintptr_t &ActualSize) = 0;
   
   /// endExceptionTable - This method is called when the JIT is done emitting
   /// the exception table.
-  virtual void endExceptionTable(const Function *F, uint8_t *TableStart,
-                                 uint8_t *TableEnd, uint8_t* FrameRegister) = 0;
+  virtual void endExceptionTable(const Function *F, unsigned char *TableStart,
+                                 unsigned char *TableEnd, 
+                                 unsigned char* FrameRegister) = 0;
 };
 
 } // end namespace llvm.

Added: vendor/llvm/dist/include/llvm/Support/StandardPasses.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/llvm/dist/include/llvm/Support/StandardPasses.h	Wed Jun  3 21:10:15 2009	(r193399)
@@ -0,0 +1,250 @@
+//===-- llvm/Support/StandardPasses.h - Standard pass lists -----*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines utility functions for creating a "standard" set of
+// optimization passes, so that compilers and tools which use optimization
+// passes use the same set of standard passes.
+//
+// These are implemented as inline functions so that we do not have to worry
+// about link issues.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_STANDARDPASSES_H
+#define LLVM_SUPPORT_STANDARDPASSES_H
+
+#include "llvm/PassManager.h"
+#include "llvm/Analysis/Passes.h"
+#include "llvm/Analysis/Verifier.h"
+#include "llvm/Transforms/Scalar.h"
+#include "llvm/Transforms/IPO.h"
+
+namespace llvm {
+  /// createStandardFunctionPasses - Add the standard list of function passes to
+  /// the provided pass manager.
+  ///
+  /// \arg OptimizationLevel - The optimization level, corresponding to -O0,
+  /// -O1, etc.
+  static inline void createStandardFunctionPasses(FunctionPassManager *PM,
+                                                  unsigned OptimizationLevel);
+
+  /// createStandardModulePasses - Add the standard list of module passes to the
+  /// provided pass manager.
+  ///
+  /// \arg OptimizationLevel - The optimization level, corresponding to -O0,
+  /// -O1, etc.
+  /// \arg OptimizeSize - Whether the transformations should optimize for size.
+  /// \arg UnitAtATime - Allow passes which may make global module changes.
+  /// \arg UnrollLoops - Allow loop unrolling.
+  /// \arg SimplifyLibCalls - Allow library calls to be simplified.
+  /// \arg HaveExceptions - Whether the module may have code using exceptions.
+  /// \arg InliningPass - The inlining pass to use, if any, or null. This will
+  /// always be added, even at -O0.a
+  static inline void createStandardModulePasses(PassManager *PM,
+                                                unsigned OptimizationLevel,
+                                                bool OptimizeSize,
+                                                bool UnitAtATime,
+                                                bool UnrollLoops,
+                                                bool SimplifyLibCalls,
+                                                bool HaveExceptions,
+                                                Pass *InliningPass);
+
+  /// createStandardLTOPasses - Add the standard list of module passes suitable
+  /// for link time optimization.
+  ///
+  /// Internalize - Run the internalize pass.
+  /// RunInliner - Use a function inlining pass.
+  /// RunSecondGlobalOpt - Run the global optimizer pass twice.
+  /// VerifyEach - Run the verifier after each pass.
+  //
+  // FIXME: RunSecondGlobalOpt should go away once we resolve which of LTO or
+  // llvm-ld is better.
+  static inline void createStandardLTOPasses(PassManager *PM,
+                                             bool Internalize,
+                                             bool RunInliner,
+                                             bool RunSecondGlobalOpt,
+                                             bool VerifyEach);
+
+  // Implementations
+
+  static inline void createStandardFunctionPasses(FunctionPassManager *PM,
+                                                  unsigned OptimizationLevel) {
+    if (OptimizationLevel > 0) {
+      PM->add(createCFGSimplificationPass());
+      if (OptimizationLevel == 1)
+        PM->add(createPromoteMemoryToRegisterPass());
+      else
+        PM->add(createScalarReplAggregatesPass());
+      PM->add(createInstructionCombiningPass());
+    }
+  }
+
+  static inline void createStandardModulePasses(PassManager *PM,
+                                                unsigned OptimizationLevel,
+                                                bool OptimizeSize,
+                                                bool UnitAtATime,
+                                                bool UnrollLoops,
+                                                bool SimplifyLibCalls,
+                                                bool HaveExceptions,
+                                                Pass *InliningPass) {
+    if (OptimizationLevel == 0) {
+      if (InliningPass)
+        PM->add(InliningPass);
+    } else {
+      if (UnitAtATime)
+        PM->add(createRaiseAllocationsPass());    // call %malloc -> malloc inst
+      PM->add(createCFGSimplificationPass());     // Clean up disgusting code
+       // Kill useless allocas
+      PM->add(createPromoteMemoryToRegisterPass());
+      if (UnitAtATime) {
+        PM->add(createGlobalOptimizerPass());     // Optimize out global vars
+        PM->add(createGlobalDCEPass());           // Remove unused fns and globs
+        // IP Constant Propagation
+        PM->add(createIPConstantPropagationPass());
+        PM->add(createDeadArgEliminationPass());  // Dead argument elimination
+      }
+      PM->add(createInstructionCombiningPass());  // Clean up after IPCP & DAE
+      PM->add(createCFGSimplificationPass());     // Clean up after IPCP & DAE
+      if (UnitAtATime) {
+        if (HaveExceptions)
+          PM->add(createPruneEHPass());           // Remove dead EH info
+        PM->add(createFunctionAttrsPass());       // Set readonly/readnone attrs
+      }
+      if (InliningPass)
+        PM->add(InliningPass);
+      if (OptimizationLevel > 2)
+        PM->add(createArgumentPromotionPass());   // Scalarize uninlined fn args
+      if (SimplifyLibCalls)
+        PM->add(createSimplifyLibCallsPass());    // Library Call Optimizations
+      PM->add(createInstructionCombiningPass());  // Cleanup for scalarrepl.
+      PM->add(createJumpThreadingPass());         // Thread jumps.
+      PM->add(createCFGSimplificationPass());     // Merge & remove BBs
+      PM->add(createScalarReplAggregatesPass());  // Break up aggregate allocas
+      PM->add(createInstructionCombiningPass());  // Combine silly seq's
+      PM->add(createCondPropagationPass());       // Propagate conditionals
+      PM->add(createTailCallEliminationPass());   // Eliminate tail calls
+      PM->add(createCFGSimplificationPass());     // Merge & remove BBs
+      PM->add(createReassociatePass());           // Reassociate expressions
+      PM->add(createLoopRotatePass());            // Rotate Loop
+      PM->add(createLICMPass());                  // Hoist loop invariants
+      PM->add(createLoopUnswitchPass(OptimizeSize));
+      PM->add(createLoopIndexSplitPass());        // Split loop index
+      PM->add(createInstructionCombiningPass());  
+      PM->add(createIndVarSimplifyPass());        // Canonicalize indvars
+      PM->add(createLoopDeletionPass());          // Delete dead loops
+      if (UnrollLoops)
+        PM->add(createLoopUnrollPass());          // Unroll small loops
+      PM->add(createInstructionCombiningPass());  // Clean up after the unroller
+      PM->add(createGVNPass());                   // Remove redundancies
+      PM->add(createMemCpyOptPass());             // Remove memcpy / form memset
+      PM->add(createSCCPPass());                  // Constant prop with SCCP
+    
+      // Run instcombine after redundancy elimination to exploit opportunities
+      // opened up by them.
+      PM->add(createInstructionCombiningPass());
+      PM->add(createCondPropagationPass());       // Propagate conditionals
+      PM->add(createDeadStoreEliminationPass());  // Delete dead stores
+      PM->add(createAggressiveDCEPass());         // Delete dead instructions
+      PM->add(createCFGSimplificationPass());     // Merge & remove BBs
+
+      if (UnitAtATime) {
+        PM->add(createStripDeadPrototypesPass()); // Get rid of dead prototypes
+        PM->add(createDeadTypeEliminationPass()); // Eliminate dead types
+      }
+
+      if (OptimizationLevel > 1 && UnitAtATime)
+        PM->add(createConstantMergePass());       // Merge dup global constants
+    }
+  }
+
+  static inline void addOnePass(PassManager *PM, Pass *P, bool AndVerify) {
+    PM->add(P);
+
+    if (AndVerify)
+      PM->add(createVerifierPass());
+  }
+
+  static inline void createStandardLTOPasses(PassManager *PM,
+                                             bool Internalize,
+                                             bool RunInliner,
+                                             bool RunSecondGlobalOpt,
+                                             bool VerifyEach) {
+    // Now that composite has been compiled, scan through the module, looking
+    // for a main function.  If main is defined, mark all other functions
+    // internal.
+    if (Internalize)
+      addOnePass(PM, createInternalizePass(true), VerifyEach);
+
+    // Propagate constants at call sites into the functions they call.  This
+    // opens opportunities for globalopt (and inlining) by substituting function
+    // pointers passed as arguments to direct uses of functions.  
+    addOnePass(PM, createIPSCCPPass(), VerifyEach);
+
+    // Now that we internalized some globals, see if we can hack on them!
+    addOnePass(PM, createGlobalOptimizerPass(), VerifyEach);
+    
+    // Linking modules together can lead to duplicated global constants, only
+    // keep one copy of each constant...
+    addOnePass(PM, createConstantMergePass(), VerifyEach);
+    
+    // Remove unused arguments from functions...
+    addOnePass(PM, createDeadArgEliminationPass(), VerifyEach);
+
+    // Reduce the code after globalopt and ipsccp.  Both can open up significant
+    // simplification opportunities, and both can propagate functions through
+    // function pointers.  When this happens, we often have to resolve varargs
+    // calls, etc, so let instcombine do this.
+    addOnePass(PM, createInstructionCombiningPass(), VerifyEach);
+
+    // Inline small functions
+    if (RunInliner)
+      addOnePass(PM, createFunctionInliningPass(), VerifyEach);
+
+    addOnePass(PM, createPruneEHPass(), VerifyEach);   // Remove dead EH info.
+    // Optimize globals again.
+    if (RunSecondGlobalOpt)
+      addOnePass(PM, createGlobalOptimizerPass(), VerifyEach);
+    addOnePass(PM, createGlobalDCEPass(), VerifyEach); // Remove dead functions.
+
+    // If we didn't decide to inline a function, check to see if we can
+    // transform it to pass arguments by value instead of by reference.
+    addOnePass(PM, createArgumentPromotionPass(), VerifyEach);
+
+    // The IPO passes may leave cruft around.  Clean up after them.
+    addOnePass(PM, createInstructionCombiningPass(), VerifyEach);
+    addOnePass(PM, createJumpThreadingPass(), VerifyEach);
+    // Break up allocas
+    addOnePass(PM, createScalarReplAggregatesPass(), VerifyEach);
+
+    // Run a few AA driven optimizations here and now, to cleanup the code.
+    addOnePass(PM, createFunctionAttrsPass(), VerifyEach); // Add nocapture.
+    addOnePass(PM, createGlobalsModRefPass(), VerifyEach); // IP alias analysis.
+
+    addOnePass(PM, createLICMPass(), VerifyEach);      // Hoist loop invariants.
+    addOnePass(PM, createGVNPass(), VerifyEach);       // Remove redundancies.
+    addOnePass(PM, createMemCpyOptPass(), VerifyEach); // Remove dead memcpys.
+    // Nuke dead stores.
+    addOnePass(PM, createDeadStoreEliminationPass(), VerifyEach);
+
+    // Cleanup and simplify the code after the scalar optimizations.
+    addOnePass(PM, createInstructionCombiningPass(), VerifyEach);
+
+    addOnePass(PM, createJumpThreadingPass(), VerifyEach);
+    // Cleanup jump threading.
+    addOnePass(PM, createPromoteMemoryToRegisterPass(), VerifyEach);
+    
+    // Delete basic blocks, which optimization passes may have killed...
+    addOnePass(PM, createCFGSimplificationPass(), VerifyEach);
+
+    // Now that we have optimized the program, discard unreachable functions.
+    addOnePass(PM, createGlobalDCEPass(), VerifyEach);
+  }
+}
+
+#endif

Modified: vendor/llvm/dist/lib/CodeGen/CMakeLists.txt
==============================================================================
--- vendor/llvm/dist/lib/CodeGen/CMakeLists.txt	Wed Jun  3 21:02:14 2009	(r193398)
+++ vendor/llvm/dist/lib/CodeGen/CMakeLists.txt	Wed Jun  3 21:10:15 2009	(r193399)
@@ -3,6 +3,7 @@ add_llvm_library(LLVMCodeGen
   CodePlacementOpt.cpp
   DeadMachineInstructionElim.cpp
   DwarfEHPrepare.cpp
+  ELFCodeEmitter.cpp
   ELFWriter.cpp
   GCMetadata.cpp
   GCMetadataPrinter.cpp
@@ -16,6 +17,7 @@ add_llvm_library(LLVMCodeGen
   LiveStackAnalysis.cpp
   LiveVariables.cpp
   LowerSubregs.cpp
+  MachOCodeEmitter.cpp
   MachOWriter.cpp
   MachineBasicBlock.cpp
   MachineDominators.cpp

Added: vendor/llvm/dist/lib/CodeGen/ELFCodeEmitter.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/llvm/dist/lib/CodeGen/ELFCodeEmitter.cpp	Wed Jun  3 21:10:15 2009	(r193399)
@@ -0,0 +1,94 @@
+//===-- lib/CodeGen/ELFCodeEmitter.cpp ------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "ELFCodeEmitter.h"
+#include "llvm/Constants.h"
+#include "llvm/DerivedTypes.h"
+#include "llvm/Function.h"
+#include "llvm/CodeGen/MachineConstantPool.h"
+#include "llvm/CodeGen/MachineJumpTableInfo.h"
+#include "llvm/Target/TargetAsmInfo.h"
+#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetMachine.h"
+#include "llvm/Support/Mangler.h"
+#include "llvm/Support/OutputBuffer.h"
+
+//===----------------------------------------------------------------------===//
+//                       ELFCodeEmitter Implementation
+//===----------------------------------------------------------------------===//
+
+namespace llvm {
+
+/// startFunction - This callback is invoked when a new machine function is
+/// about to be emitted.
+void ELFCodeEmitter::startFunction(MachineFunction &F) {
+  // Align the output buffer to the appropriate alignment.
+  unsigned Align = 16;   // FIXME: GENERICIZE!!
+  // Get the ELF Section that this function belongs in.
+  ES = &EW.getSection(".text", ELFWriter::ELFSection::SHT_PROGBITS,
+                      ELFWriter::ELFSection::SHF_EXECINSTR |
+                      ELFWriter::ELFSection::SHF_ALLOC);
+  OutBuffer = &ES->SectionData;
+  cerr << "FIXME: This code needs to be updated for changes in the "
+       << "CodeEmitter interfaces.  In particular, this should set "
+       << "BufferBegin/BufferEnd/CurBufferPtr, not deal with OutBuffer!";
+  abort();
+
+  // Upgrade the section alignment if required.
+  if (ES->Align < Align) ES->Align = Align;
+
+  // Add padding zeros to the end of the buffer to make sure that the
+  // function will start on the correct byte alignment within the section.
+  OutputBuffer OB(*OutBuffer,
+                  TM.getTargetData()->getPointerSizeInBits() == 64,
+                  TM.getTargetData()->isLittleEndian());
+  OB.align(Align);
+  FnStart = OutBuffer->size();
+}
+
+/// finishFunction - This callback is invoked after the function is completely
+/// finished.
+bool ELFCodeEmitter::finishFunction(MachineFunction &F) {
+  // We now know the size of the function, add a symbol to represent it.
+  ELFWriter::ELFSym FnSym(F.getFunction());
+
+  // Figure out the binding (linkage) of the symbol.
+  switch (F.getFunction()->getLinkage()) {
+  default:
+    // appending linkage is illegal for functions.
+    assert(0 && "Unknown linkage type!");
+  case GlobalValue::ExternalLinkage:
+    FnSym.SetBind(ELFWriter::ELFSym::STB_GLOBAL);
+    break;
+  case GlobalValue::LinkOnceAnyLinkage:
+  case GlobalValue::LinkOnceODRLinkage:
+  case GlobalValue::WeakAnyLinkage:
+  case GlobalValue::WeakODRLinkage:
+    FnSym.SetBind(ELFWriter::ELFSym::STB_WEAK);
+    break;
+  case GlobalValue::PrivateLinkage:
+    assert (0 && "PrivateLinkage should not be in the symbol table.");
+  case GlobalValue::InternalLinkage:
+    FnSym.SetBind(ELFWriter::ELFSym::STB_LOCAL);
+    break;
+  }
+
+  ES->Size = OutBuffer->size();
+
+  FnSym.SetType(ELFWriter::ELFSym::STT_FUNC);
+  FnSym.SectionIdx = ES->SectionIdx;
+  FnSym.Value = FnStart;   // Value = Offset from start of Section.
+  FnSym.Size = OutBuffer->size()-FnStart;
+
+  // Finally, add it to the symtab.
+  EW.SymbolTable.push_back(FnSym);
+  return false;
+}
+
+} // end namespace llvm

Added: vendor/llvm/dist/lib/CodeGen/ELFCodeEmitter.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/llvm/dist/lib/CodeGen/ELFCodeEmitter.h	Wed Jun  3 21:10:15 2009	(r193399)
@@ -0,0 +1,87 @@
+//===-- lib/CodeGen/ELFCodeEmitter.h ----------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef ELFCODEEMITTER_H
+#define ELFCODEEMITTER_H
+
+#include "ELFWriter.h"
+#include "llvm/CodeGen/MachineCodeEmitter.h"
+#include <vector>
+
+namespace llvm {
+
+  /// ELFCodeEmitter - This class is used by the ELFWriter to 
+  /// emit the code for functions to the ELF file.
+  class ELFCodeEmitter : public MachineCodeEmitter {
+    ELFWriter &EW;
+    TargetMachine &TM;
+    ELFWriter::ELFSection *ES;  // Section to write to.
+    std::vector<unsigned char> *OutBuffer;
+    size_t FnStart;
+  public:
+    explicit ELFCodeEmitter(ELFWriter &ew) : EW(ew), TM(EW.TM), OutBuffer(0) {}
+
+    void startFunction(MachineFunction &F);
+    bool finishFunction(MachineFunction &F);
+
+    void addRelocation(const MachineRelocation &MR) {
+      assert(0 && "relo not handled yet!");
+    }
+
+    virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) {
+    }
+
+    virtual uintptr_t getConstantPoolEntryAddress(unsigned Index) const {
+      assert(0 && "CP not implementated yet!");
+      return 0;
+    }
+    virtual uintptr_t getJumpTableEntryAddress(unsigned Index) const {
+      assert(0 && "JT not implementated yet!");
+      return 0;
+    }
+
+    virtual uintptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const {
+      assert(0 && "JT not implementated yet!");
+      return 0;
+    }
+
+    virtual uintptr_t getLabelAddress(uint64_t Label) const {
+      assert(0 && "Label address not implementated yet!");
+      abort();
+      return 0;
+    }
+
+    virtual void emitLabel(uint64_t LabelID) {
+      assert(0 && "emit Label not implementated yet!");
+      abort();
+    }
+
+    virtual void setModuleInfo(llvm::MachineModuleInfo* MMI) { }
+
+    /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!
+    void startGVStub(const GlobalValue* F, unsigned StubSize,
+                     unsigned Alignment = 1) {
+      assert(0 && "JIT specific function called!");
+      abort();
+    }
+    void startGVStub(const GlobalValue* F,  void *Buffer, unsigned StubSize) {
+      assert(0 && "JIT specific function called!");
+      abort();
+    }
+    void *finishGVStub(const GlobalValue *F) {
+      assert(0 && "JIT specific function called!");
+      abort();
+      return 0;
+    }
+};  // end class ELFCodeEmitter
+
+} // end namespace llvm
+
+#endif
+

Modified: vendor/llvm/dist/lib/CodeGen/ELFWriter.cpp
==============================================================================
--- vendor/llvm/dist/lib/CodeGen/ELFWriter.cpp	Wed Jun  3 21:02:14 2009	(r193398)
+++ vendor/llvm/dist/lib/CodeGen/ELFWriter.cpp	Wed Jun  3 21:10:15 2009	(r193399)
@@ -32,6 +32,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ELFWriter.h"
+#include "ELFCodeEmitter.h"
 #include "llvm/Module.h"
 #include "llvm/PassManager.h"
 #include "llvm/DerivedTypes.h"
@@ -61,149 +62,10 @@ MachineCodeEmitter *llvm::AddELFWriter(P
 }
 
 //===----------------------------------------------------------------------===//
-//                       ELFCodeEmitter Implementation
-//===----------------------------------------------------------------------===//
-
-namespace llvm {
-  /// ELFCodeEmitter - This class is used by the ELFWriter to emit the code for
-  /// functions to the ELF file.
-  class ELFCodeEmitter : public MachineCodeEmitter {
-    ELFWriter &EW;
-    TargetMachine &TM;
-    ELFWriter::ELFSection *ES;  // Section to write to.
-    std::vector<unsigned char> *OutBuffer;
-    size_t FnStart;
-  public:
-    explicit ELFCodeEmitter(ELFWriter &ew) : EW(ew), TM(EW.TM), OutBuffer(0) {}
-
-    void startFunction(MachineFunction &F);
-    bool finishFunction(MachineFunction &F);
-
-    void addRelocation(const MachineRelocation &MR) {
-      assert(0 && "relo not handled yet!");
-    }
-    
-    virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) {
-    }
-
-    virtual uintptr_t getConstantPoolEntryAddress(unsigned Index) const {
-      assert(0 && "CP not implementated yet!");
-      return 0;
-    }
-    virtual uintptr_t getJumpTableEntryAddress(unsigned Index) const {
-      assert(0 && "JT not implementated yet!");
-      return 0;
-    }
-
-    virtual uintptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const {
-      assert(0 && "JT not implementated yet!");
-      return 0;
-    }
-
-    virtual uintptr_t getLabelAddress(uint64_t Label) const {
-      assert(0 && "Label address not implementated yet!");
-      abort();
-      return 0;
-    }
-
-    virtual void emitLabel(uint64_t LabelID) {
-      assert(0 && "emit Label not implementated yet!");
-      abort();
-    }
-
-
-    virtual void setModuleInfo(llvm::MachineModuleInfo* MMI) { }
-
-
-    /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!
-    void startGVStub(const GlobalValue* F, unsigned StubSize,
-                     unsigned Alignment = 1) {
-      assert(0 && "JIT specific function called!");
-      abort();
-    }
-    void startGVStub(const GlobalValue* F,  void *Buffer, unsigned StubSize) {
-      assert(0 && "JIT specific function called!");
-      abort();
-    }
-    void *finishGVStub(const GlobalValue *F) {
-      assert(0 && "JIT specific function called!");
-      abort();
-      return 0;
-    }
-  };
-}
-
-/// startFunction - This callback is invoked when a new machine function is
-/// about to be emitted.
-void ELFCodeEmitter::startFunction(MachineFunction &F) {
-  // Align the output buffer to the appropriate alignment.

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-all mailing list