[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.52 - 1.53
---
Log message:

new method for creating a path, which does not create a temporary string.


---
Diffs of the changes:  (+8 -0)

 Path.h |8 
 1 files changed, 8 insertions(+)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.52 
llvm/include/llvm/System/Path.h:1.53
--- llvm/include/llvm/System/Path.h:1.52Tue Apr 10 21:02:09 2007
+++ llvm/include/llvm/System/Path.h Sun Apr 29 01:16:32 2007
@@ -174,6 +174,14 @@
   /// @brief Construct a Path from a string.
   explicit Path(const std::string p) : path(p) {}
 
+  /// This constructor will accept a character range as a path.  No 
checking
+  /// is done on this path to determine if it is valid.  To determine
+  /// validity of the path, use the isValid method. 
+  /// @param p The path to assign.
+  /// @brief Construct a Path from a string.
+  explicit Path(const char *StrStart, unsigned StrLen)
+: path(StrStart, StrStart+StrLen) {}
+  
 /// @}
 /// @name Operators
 /// @{



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Support/MemoryBuffer.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/Support:

MemoryBuffer.h added (r1.1)
---
Log message:

Add a new memorybuffer class, to unify all the file reading code in the system


---
Diffs of the changes:  (+83 -0)

 MemoryBuffer.h |   83 +
 1 files changed, 83 insertions(+)


Index: llvm/include/llvm/Support/MemoryBuffer.h
diff -c /dev/null llvm/include/llvm/Support/MemoryBuffer.h:1.1
*** /dev/null   Sun Apr 29 01:59:02 2007
--- llvm/include/llvm/Support/MemoryBuffer.hSun Apr 29 01:58:52 2007
***
*** 0 
--- 1,83 
+ //===--- MemoryBuffer.h - Memory Buffer Interface ---*- C++ 
-*-===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Chris Lattner and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for 
details.
+ //
+ 
//===--===//
+ //
+ //  This file defines the MemoryBuffer interface.
+ //
+ 
//===--===//
+ 
+ #ifndef LLVM_SUPPORT_MEMORYBUFFER_H
+ #define LLVM_SUPPORT_MEMORYBUFFER_H
+ 
+ #include llvm/Support/DataTypes.h
+ 
+ namespace llvm {
+ 
+ /// MemoryBuffer - This interface provides simple read-only access to a block
+ /// of memory, and provides simple methods for reading files and standard 
input
+ /// into a memory buffer.  In addition to basic access to the characters in 
the
+ /// file, this interface guarantees you can read one character past the end of
+ /// the file, and that this character will read as '\0'.
+ class MemoryBuffer {
+   const char *BufferStart; // Start of the buffer.
+   const char *BufferEnd;   // End of the buffer.
+ 
+   /// MustDeleteBuffer - True if we allocated this buffer.  If so, the
+   /// destructor must know the delete[] it.
+   bool MustDeleteBuffer;
+ protected:
+   MemoryBuffer() : MustDeleteBuffer(false) {}
+   void init(const char *BufStart, const char *BufEnd);
+   void initCopyOf(const char *BufStart, const char *BufEnd);
+ public:
+   virtual ~MemoryBuffer();
+   
+   const char *getBufferStart() const { return BufferStart; }
+   const char *getBufferEnd() const   { return BufferEnd; }
+   unsigned getBufferSize() const { return BufferEnd-BufferStart; }
+   
+   /// getBufferIdentifier - Return an identifier for this buffer, typically 
the
+   /// filename it was read from.
+   virtual const char *getBufferIdentifier() const {
+ return Unknown buffer;
+   }
+ 
+   /// getFile - Open the specified file as a MemoryBuffer, returning a new
+   /// MemoryBuffer if successful, otherwise returning null.  If FileSize is
+   /// specified, this means that the client knows that the file exists and 
that
+   /// it has the specified size.
+   static MemoryBuffer *getFile(const char *FilenameStart, unsigned FnSize,
+int64_t FileSize = -1);
+ 
+   /// getMemBuffer - Open the specified memory range as a MemoryBuffer.  Note
+   /// that EndPtr[0] must be a null byte and be accessible!
+   static MemoryBuffer *getMemBuffer(const char *StartPtr, const char *EndPtr,
+ const char *BufferName = );
+   
+   /// getNewMemBuffer - Allocate a new MemoryBuffer of the specified size that
+   /// is completely initialized to zeros.  Note that the caller should
+   /// initialize the memory allocated by this method.  The memory is owned by
+   /// the MemoryBuffer object.
+   static MemoryBuffer *getNewMemBuffer(unsigned Size,
+const char *BufferName = );
+   
+   /// getNewUninitMemBuffer - Allocate a new MemoryBuffer of the specified 
size
+   /// that is not initialized.  Note that the caller should initialize the
+   /// memory allocated by this method.  The memory is owned by the 
MemoryBuffer
+   /// object.
+   static MemoryBuffer *getNewUninitMemBuffer(unsigned Size,
+  const char *BufferName = );
+   
+   /// getSTDIN - Read all of stdin into a file buffer, and return it.  This
+   /// fails if stdin is empty.
+   static MemoryBuffer *getSTDIN();
+ };
+ 
+ } // end namespace llvm
+ 
+ #endif



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Support/MemoryBuffer.cpp

2007-04-29 Thread Chris Lattner


Changes in directory llvm/lib/Support:

MemoryBuffer.cpp added (r1.1)
---
Log message:

Add a new memorybuffer class, to unify all the file reading code in the system


---
Diffs of the changes:  (+239 -0)

 MemoryBuffer.cpp |  239 +++
 1 files changed, 239 insertions(+)


Index: llvm/lib/Support/MemoryBuffer.cpp
diff -c /dev/null llvm/lib/Support/MemoryBuffer.cpp:1.1
*** /dev/null   Sun Apr 29 01:59:02 2007
--- llvm/lib/Support/MemoryBuffer.cpp   Sun Apr 29 01:58:52 2007
***
*** 0 
--- 1,239 
+ //===--- MemoryBuffer.cpp - Memory Buffer implementation 
--===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Chris Lattner and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for 
details.
+ //
+ 
//===--===//
+ //
+ //  This file implements the MemoryBuffer interface.
+ //
+ 
//===--===//
+ 
+ #include llvm/Support/MemoryBuffer.h
+ #include llvm/System/MappedFile.h
+ #include llvm/System/Process.h
+ #include cstdio
+ #include cstring
+ #include cerrno
+ using namespace llvm;
+ 
+ 
//===--===//
+ // MemoryBuffer implementation itself.
+ 
//===--===//
+ 
+ MemoryBuffer::~MemoryBuffer() {
+   if (MustDeleteBuffer)
+ delete [] BufferStart;
+ }
+ 
+ /// initCopyOf - Initialize this source buffer with a copy of the specified
+ /// memory range.  We make the copy so that we can null terminate it
+ /// successfully.
+ void MemoryBuffer::initCopyOf(const char *BufStart, const char *BufEnd) {
+   size_t Size = BufEnd-BufStart;
+   BufferStart = new char[Size+1];
+   BufferEnd = BufferStart+Size;
+   memcpy(const_castchar*(BufferStart), BufStart, Size);
+   *const_castchar*(BufferEnd) = 0;   // Null terminate buffer.
+   MustDeleteBuffer = false;
+ }
+ 
+ /// init - Initialize this MemoryBuffer as a reference to externally allocated
+ /// memory, memory that we know is already null terminated.
+ void MemoryBuffer::init(const char *BufStart, const char *BufEnd) {
+   assert(BufEnd[0] == 0  Buffer is not null terminated!);
+   BufferStart = BufStart;
+   BufferEnd = BufEnd;
+   MustDeleteBuffer = false;
+ }
+ 
+ 
//===--===//
+ // MemoryBufferMem implementation.
+ 
//===--===//
+ 
+ namespace {
+ class MemoryBufferMem : public MemoryBuffer {
+   std::string FileID;
+ public:
+   MemoryBufferMem(const char *Start, const char *End, const char *FID)
+   : FileID(FID) {
+ init(Start, End);
+   }
+   
+   virtual const char *getBufferIdentifier() const {
+ return FileID.c_str();
+   }
+ };
+ }
+ 
+ /// getMemBuffer - Open the specified memory range as a MemoryBuffer.  Note
+ /// that EndPtr[0] must be a null byte and be accessible!
+ MemoryBuffer *MemoryBuffer::getMemBuffer(const char *StartPtr, 
+  const char *EndPtr,
+  const char *BufferName) {
+   return new MemoryBufferMem(StartPtr, EndPtr, BufferName);
+ }
+ 
+ /// getNewUninitMemBuffer - Allocate a new MemoryBuffer of the specified size
+ /// that is completely initialized to zeros.  Note that the caller should
+ /// initialize the memory allocated by this method.  The memory is owned by
+ /// the MemoryBuffer object.
+ MemoryBuffer *MemoryBuffer::getNewUninitMemBuffer(unsigned Size,
+   const char *BufferName) {
+   char *Buf = new char[Size+1];
+   Buf[Size] = 0;
+   MemoryBufferMem *SB = new MemoryBufferMem(Buf, Buf+Size, BufferName);
+   // The memory for this buffer is owned by the MemoryBuffer.
+   SB-MustDeleteBuffer = true;
+   return SB;
+ }
+ 
+ /// getNewMemBuffer - Allocate a new MemoryBuffer of the specified size that
+ /// is completely initialized to zeros.  Note that the caller should
+ /// initialize the memory allocated by this method.  The memory is owned by
+ /// the MemoryBuffer object.
+ MemoryBuffer *MemoryBuffer::getNewMemBuffer(unsigned Size,
+ const char *BufferName) {
+   MemoryBuffer *SB = getNewUninitMemBuffer(Size, BufferName);
+   memset(const_castchar*(SB-getBufferStart()), 0, Size+1);
+   return SB;
+ }
+ 
+ 
+ 
//===--===//
+ // MemoryBufferMMapFile implementation.
+ 
//===--===//
+ 
+ namespace {
+ class MemoryBufferMMapFile : public MemoryBuffer {
+   sys::MappedFile File;
+ public:
+   MemoryBufferMMapFile(const sys::Path Filename);
+   

[llvm-commits] CVS: llvm/include/llvm/Bitcode/ReaderWriter.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/Bitcode:

ReaderWriter.h updated: 1.1 - 1.2
---
Log message:

Switch the bitcode reader interface to take a MemoryBuffer instead of knowing
anything about disk I/O itself.  This greatly simplifies its interface -
eliminating the need for the ReaderWrappers.cpp file.

This adds a new option to llvm-dis (-bitcode) which instructs it to read
the input file as bitcode.  Until/unless the bytecode reader is taught to
read from MemoryBuffer, there is no way to handle stdin reading without it.

I don't plan to switch the bytecode reader over, I'd rather delete it :),
so the option will stay around temporarily.



---
Diffs of the changes:  (+10 -5)

 ReaderWriter.h |   15 ++-
 1 files changed, 10 insertions(+), 5 deletions(-)


Index: llvm/include/llvm/Bitcode/ReaderWriter.h
diff -u llvm/include/llvm/Bitcode/ReaderWriter.h:1.1 
llvm/include/llvm/Bitcode/ReaderWriter.h:1.2
--- llvm/include/llvm/Bitcode/ReaderWriter.h:1.1Sun Apr 22 01:22:05 2007
+++ llvm/include/llvm/Bitcode/ReaderWriter.hSun Apr 29 02:54:31 2007
@@ -20,15 +20,20 @@
 namespace llvm {
   class Module;
   class ModuleProvider;
+  class MemoryBuffer;
   
-  ModuleProvider *getBitcodeModuleProvider(const std::string Filename,
+  /// getBitcodeModuleProvider - Read the header of the specified bitcode 
buffer
+  /// and prepare for lazy deserialization of function bodies.  If successful,
+  /// this takes ownership of 'buffer' and returns a non-null pointer.  On
+  /// error, this returns null, *does not* take ownership of Buffer, and fills
+  /// in *ErrMsg with an error description if ErrMsg is non-null.
+  ModuleProvider *getBitcodeModuleProvider(MemoryBuffer *Buffer,
std::string *ErrMsg = 0);
 
-  
   /// ParseBitcodeFile - Read the specified bitcode file, returning the module.
-  /// If an error occurs, return null and fill in *ErrMsg if non-null.
-  Module *ParseBitcodeFile(const std::string Filename,
-   std::string *ErrMsg = 0);
+  /// If an error occurs, this returns null and fills in *ErrMsg if it is
+  /// non-null.  This method *never* takes ownership of Buffer.
+  Module *ParseBitcodeFile(MemoryBuffer *Buffer, std::string *ErrMsg = 0);
   
   /// WriteBitcodeToFile - Write the specified module to the specified output
   /// stream.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/llvm-dis/llvm-dis.cpp

2007-04-29 Thread Chris Lattner


Changes in directory llvm/tools/llvm-dis:

llvm-dis.cpp updated: 1.58 - 1.59
---
Log message:

Switch the bitcode reader interface to take a MemoryBuffer instead of knowing
anything about disk I/O itself.  This greatly simplifies its interface -
eliminating the need for the ReaderWrappers.cpp file.

This adds a new option to llvm-dis (-bitcode) which instructs it to read
the input file as bitcode.  Until/unless the bytecode reader is taught to
read from MemoryBuffer, there is no way to handle stdin reading without it.

I don't plan to switch the bytecode reader over, I'd rather delete it :),
so the option will stay around temporarily.



---
Diffs of the changes:  (+24 -6)

 llvm-dis.cpp |   30 --
 1 files changed, 24 insertions(+), 6 deletions(-)


Index: llvm/tools/llvm-dis/llvm-dis.cpp
diff -u llvm/tools/llvm-dis/llvm-dis.cpp:1.58 
llvm/tools/llvm-dis/llvm-dis.cpp:1.59
--- llvm/tools/llvm-dis/llvm-dis.cpp:1.58   Sun Apr 22 01:35:20 2007
+++ llvm/tools/llvm-dis/llvm-dis.cppSun Apr 29 02:54:31 2007
@@ -24,6 +24,7 @@
 #include llvm/Support/Compressor.h
 #include llvm/Support/CommandLine.h
 #include llvm/Support/ManagedStatic.h
+#include llvm/Support/MemoryBuffer.h
 #include llvm/Support/Streams.h
 #include llvm/System/Signals.h
 #include iostream
@@ -44,6 +45,9 @@
 static cl::optbool
 DontPrint(disable-output, cl::desc(Don't output the .ll file), cl::Hidden);
 
+static cl::optbool
+Bitcode(bitcode, cl::desc(Read a bitcode file));
+
 int main(int argc, char **argv) {
   llvm_shutdown_obj X;  // Call llvm_shutdown() on exit.
   try {
@@ -55,12 +59,26 @@
 
 std::auto_ptrModule M;

-if (InputFilename != -) 
-  M.reset(ParseBitcodeFile(InputFilename, ErrorMessage));
-
-if (M.get() == 0)
-  
M.reset(ParseBytecodeFile(InputFilename,Compressor::decompressToNewBuffer,
+if (Bitcode) {
+  MemoryBuffer *Buffer;
+  if (InputFilename == -) {
+Buffer = MemoryBuffer::getSTDIN();
+  } else {
+Buffer = MemoryBuffer::getFile(InputFilename[0], 
InputFilename.size());
+  }
+
+  if (Buffer == 0)
+ErrorMessage = Error reading file ' + InputFilename + ';
+  else
+M.reset(ParseBitcodeFile(Buffer, ErrorMessage));
+  
+  delete Buffer;
+} else {
+  M.reset(ParseBytecodeFile(InputFilename,
+Compressor::decompressToNewBuffer,
 ErrorMessage));
+}
+
 if (M.get() == 0) {
   cerr  argv[0]  : ;
   if (ErrorMessage.size())
@@ -69,7 +87,7 @@
 cerr  bytecode didn't read correctly.\n;
   return 1;
 }
-
+
 if (DontPrint) {
   // Just use stdout.  We won't actually print anything on it.
 } else if (OutputFilename != ) {   // Specified an output filename?



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp BitcodeReader.h ReaderWrappers.cpp

2007-04-29 Thread Chris Lattner


Changes in directory llvm/lib/Bitcode/Reader:

BitcodeReader.cpp updated: 1.15 - 1.16
BitcodeReader.h updated: 1.10 - 1.11
ReaderWrappers.cpp (r1.2) removed
---
Log message:

Switch the bitcode reader interface to take a MemoryBuffer instead of knowing
anything about disk I/O itself.  This greatly simplifies its interface -
eliminating the need for the ReaderWrappers.cpp file.

This adds a new option to llvm-dis (-bitcode) which instructs it to read
the input file as bitcode.  Until/unless the bytecode reader is taught to
read from MemoryBuffer, there is no way to handle stdin reading without it.

I don't plan to switch the bytecode reader over, I'd rather delete it :),
so the option will stay around temporarily.



---
Diffs of the changes:  (+62 -10)

 BitcodeReader.cpp |   55 +-
 BitcodeReader.h   |   17 +++-
 2 files changed, 62 insertions(+), 10 deletions(-)


Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.15 
llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.16
--- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.15  Sat Apr 28 09:57:59 2007
+++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp   Sun Apr 29 02:54:31 2007
@@ -11,6 +11,7 @@
 //
 
//===--===//
 
+#include llvm/Bitcode/ReaderWriter.h
 #include BitcodeReader.h
 #include llvm/Bitcode/BitstreamReader.h
 #include llvm/Constants.h
@@ -18,8 +19,14 @@
 #include llvm/Module.h
 #include llvm/ADT/SmallString.h
 #include llvm/Support/MathExtras.h
+#include llvm/Support/MemoryBuffer.h
 using namespace llvm;
 
+BitcodeReader::~BitcodeReader() {
+  delete Buffer;
+}
+
+
 /// ConvertToString - Convert a string from a record into an std::string, 
return
 /// true on failure.
 templatetypename StrTy
@@ -852,14 +859,14 @@
 }
 
 
-bool BitcodeReader::ParseBitcode(unsigned char *Buf, unsigned Length,
- const std::string ModuleID) {
+bool BitcodeReader::ParseBitcode() {
   TheModule = 0;
   
-  if (Length  3)
+  if (Buffer-getBufferSize()  3)
 return Error(Bitcode stream should be a multiple of 4 bytes in length);
   
-  BitstreamReader Stream(Buf, Buf+Length);
+  unsigned char *BufPtr = (unsigned char *)Buffer-getBufferStart();
+  BitstreamReader Stream(BufPtr, BufPtr+Buffer-getBufferSize());
   
   // Sniff for the signature.
   if (Stream.Read(8) != 'B' ||
@@ -882,7 +889,7 @@
 
 // We only know the MODULE subblock ID.
 if (BlockID == bitc::MODULE_BLOCK_ID) {
-  if (ParseModule(Stream, ModuleID))
+  if (ParseModule(Stream, Buffer-getBufferIdentifier()))
 return true;
 } else if (Stream.SkipBlock()) {
   return Error(Malformed block record);
@@ -891,3 +898,41 @@
   
   return false;
 }
+
+//===--===//
+// External interface
+//===--===//
+
+/// getBitcodeModuleProvider - lazy function-at-a-time loading from a file.
+///
+ModuleProvider *llvm::getBitcodeModuleProvider(MemoryBuffer *Buffer,
+   std::string *ErrMsg) {
+  BitcodeReader *R = new BitcodeReader(Buffer);
+  if (R-ParseBitcode()) {
+if (ErrMsg)
+  *ErrMsg = R-getErrorString();
+
+// Don't let the BitcodeReader dtor delete 'Buffer'.
+R-releaseMemoryBuffer();
+delete R;
+return 0;
+  }
+  return R;
+}
+
+/// ParseBitcodeFile - Read the specified bitcode file, returning the module.
+/// If an error occurs, return null and fill in *ErrMsg if non-null.
+Module *llvm::ParseBitcodeFile(MemoryBuffer *Buffer, std::string *ErrMsg){
+  BitcodeReader *R;
+  R = static_castBitcodeReader*(getBitcodeModuleProvider(Buffer, ErrMsg));
+  if (!R) return 0;
+  
+  // Read the whole module, get a pointer to it, tell ModuleProvider not to
+  // delete it when its dtor is run.
+  Module *M = R-releaseModule(ErrMsg);
+  
+  // Don't let the BitcodeReader dtor delete 'Buffer'.
+  R-releaseMemoryBuffer();
+  delete R;
+  return M;
+}


Index: llvm/lib/Bitcode/Reader/BitcodeReader.h
diff -u llvm/lib/Bitcode/Reader/BitcodeReader.h:1.10 
llvm/lib/Bitcode/Reader/BitcodeReader.h:1.11
--- llvm/lib/Bitcode/Reader/BitcodeReader.h:1.10Wed Apr 25 22:27:58 2007
+++ llvm/lib/Bitcode/Reader/BitcodeReader.h Sun Apr 29 02:54:31 2007
@@ -22,6 +22,7 @@
 
 namespace llvm {
   class BitstreamReader;
+  class MemoryBuffer;
   
 class BitcodeReaderValueList : public User {
   std::vectorUse Uses;
@@ -57,6 +58,7 @@
   
 
 class BitcodeReader : public ModuleProvider {
+  MemoryBuffer *Buffer;
   const char *ErrorString;
   
   std::vectorPATypeHolder TypeList;
@@ -64,10 +66,16 @@
   std::vectorstd::pairGlobalVariable*, unsigned  GlobalInits;
   std::vectorstd::pairGlobalAlias*, unsigned  AliasInits;
 public:
-  BitcodeReader() : ErrorString(0) {}
-  virtual ~BitcodeReader() {}
+  

[llvm-commits] CVS: llvm/include/llvm/Bitcode/BitstreamReader.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/Bitcode:

BitstreamReader.h updated: 1.5 - 1.6
---
Log message:

make this file self-contained


---
Diffs of the changes:  (+1 -0)

 BitstreamReader.h |1 +
 1 files changed, 1 insertion(+)


Index: llvm/include/llvm/Bitcode/BitstreamReader.h
diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.5 
llvm/include/llvm/Bitcode/BitstreamReader.h:1.6
--- llvm/include/llvm/Bitcode/BitstreamReader.h:1.5 Mon Apr 23 13:57:58 2007
+++ llvm/include/llvm/Bitcode/BitstreamReader.h Sun Apr 29 03:05:07 2007
@@ -16,6 +16,7 @@
 #define BITSTREAM_READER_H
 
 #include llvm/Bitcode/BitCodes.h
+#include vector
 
 namespace llvm {
   



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp

2007-04-29 Thread Chris Lattner


Changes in directory llvm/tools/llvm-bcanalyzer:

llvm-bcanalyzer.cpp updated: 1.11 - 1.12
---
Log message:

very early support for analyzing a bitstream.  This opens the file, starts
reading the stream, and detects whether it is LLVM IR or not.


---
Diffs of the changes:  (+67 -7)

 llvm-bcanalyzer.cpp |   74 +++-
 1 files changed, 67 insertions(+), 7 deletions(-)


Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.11 
llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.12
--- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.11 Sun Apr 29 00:51:00 2007
+++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp  Sun Apr 29 03:12:22 2007
@@ -31,14 +31,15 @@
 
//===--===//
 
 #include llvm/Analysis/Verifier.h
+#include llvm/Bitcode/BitstreamReader.h
 #include llvm/Bytecode/Analyzer.h
 #include llvm/Support/CommandLine.h
 #include llvm/Support/Compressor.h
 #include llvm/Support/ManagedStatic.h
+#include llvm/Support/MemoryBuffer.h
 #include llvm/System/Signals.h
 #include fstream
 #include iostream
-
 using namespace llvm;
 
 static cl::optstd::string
@@ -50,15 +51,74 @@
 static cl::optbool NoDetails(nodetails, cl::desc(Skip detailed output));
 static cl::optbool Dump(dump, cl::desc(Dump low level bytecode trace));
 static cl::optbool Verify(verify, cl::desc(Progressively verify module));
+static cl::optbool Bitcode(bitcode, cl::desc(Read a bitcode file));
+
+/// CurStreamType - If we can sniff the flavor of this stream, we can produce 
+/// better dump info.
+static enum {
+  UnknownBitstream,
+  LLVMIRBitstream
+} CurStreamType;
+
+/// AnalyzeBitcode - Analyze the bitcode file specified by InputFilename.
+static int AnalyzeBitcode() {
+  // Read the input file.
+  MemoryBuffer *Buffer;
+  if (InputFilename == -)
+Buffer = MemoryBuffer::getSTDIN();
+  else
+Buffer = MemoryBuffer::getFile(InputFilename[0], InputFilename.size());
+
+  if (Buffer == 0) {
+std::cerr  Error reading '  InputFilename  '.\n;
+return 1;
+  }
+  
+  if (Buffer-getBufferSize()  3) {
+std::cerr  Bitcode stream should be a multiple of 4 bytes in length\n;
+return 1;
+  }
+  
+  unsigned char *BufPtr = (unsigned char *)Buffer-getBufferStart();
+  BitstreamReader Stream(BufPtr, BufPtr+Buffer-getBufferSize());
+
+  
+  // Read the stream signature.
+  char Signature[6];
+  Signature[0] = Stream.Read(8);
+  Signature[1] = Stream.Read(8);
+  Signature[2] = Stream.Read(4);
+  Signature[3] = Stream.Read(4);
+  Signature[4] = Stream.Read(4);
+  Signature[5] = Stream.Read(4);
+  
+  CurStreamType = UnknownBitstream;
+  if (Signature[0] == 'B'  Signature[1] == 'C' 
+  Signature[2] == 0x0  Signature[3] == 0xC 
+  Signature[4] == 0xE  Signature[5] == 0xD)
+CurStreamType = LLVMIRBitstream;
+
+  std::cerr  Summary of   InputFilename  :\n;
+  std::cerrStream type: ;
+  switch (CurStreamType) {
+  default: assert(0  Unknown bitstream type);
+  case UnknownBitstream: std::cerr  unknown\n; break;
+  case LLVMIRBitstream:  std::cerr  LLVM IR\n; break;
+  }
+
+  return 0;
+}
 
 int main(int argc, char **argv) {
   llvm_shutdown_obj X;  // Call llvm_shutdown() on exit.
+  cl::ParseCommandLineOptions(argc, argv,  llvm-bcanalyzer file analyzer\n);
+  
+  sys::PrintStackTraceOnErrorSignal();
+  
+  if (Bitcode)
+return AnalyzeBitcode();
+
   try {
-cl::ParseCommandLineOptions(argc, argv,
-   llvm-bcanalyzer Analysis of ByteCode Dumper\n);
-
-sys::PrintStackTraceOnErrorSignal();
-
 std::ostream *Out = std::cout;  // Default to printing to stdout...
 std::string ErrorMessage;
 BytecodeAnalysis bca;
@@ -75,7 +135,7 @@
 // All that bcanalyzer does is write the gathered statistics to the output
 PrintBytecodeAnalysis(bca,*Out);
 
-if ( M  Verify ) {
+if (M  Verify) {
   std::string verificationMsg;
   if (verifyModule(*M, ReturnStatusAction, verificationMsg))
 std::cerr  Final Verification Message:   verificationMsg  \n;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp

2007-04-29 Thread Chris Lattner


Changes in directory llvm/tools/llvm-bcanalyzer:

llvm-bcanalyzer.cpp updated: 1.12 - 1.13
---
Log message:

Implement support to read an arbitrary bitcode file.  Next up, dumping the
file symbolically and actually computing statistics.


---
Diffs of the changes:  (+78 -9)

 llvm-bcanalyzer.cpp |   87 ++--
 1 files changed, 78 insertions(+), 9 deletions(-)


Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.12 
llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.13
--- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.12 Sun Apr 29 03:12:22 2007
+++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp  Sun Apr 29 03:31:14 2007
@@ -51,6 +51,11 @@
 static cl::optbool NoDetails(nodetails, cl::desc(Skip detailed output));
 static cl::optbool Dump(dump, cl::desc(Dump low level bytecode trace));
 static cl::optbool Verify(verify, cl::desc(Progressively verify module));
+
+//===--===//
+// Bitcode specific analysis.
+//===--===//
+
 static cl::optbool Bitcode(bitcode, cl::desc(Read a bitcode file));
 
 /// CurStreamType - If we can sniff the flavor of this stream, we can produce 
@@ -60,6 +65,54 @@
   LLVMIRBitstream
 } CurStreamType;
 
+/// Error - All bitcode analysis errors go through this function, making this a
+/// good place to breakpoint if debugging.
+static bool Error(const std::string Err) {
+  std::cerr  Err  \n;
+  return true;
+}
+
+/// ParseBlock - Read a block, updating statistics, etc.
+static bool ParseBlock(BitstreamReader Stream) {
+  unsigned BlockID = Stream.ReadSubBlockID();
+  
+  // TODO: Compute per-block-id stats.
+  BlockID = BlockID;
+  
+  if (Stream.EnterSubBlock())
+return Error(Malformed block record);
+
+  SmallVectoruint64_t, 64 Record;
+
+  // Read all the records for this block.
+  while (1) {
+if (Stream.AtEndOfStream())
+  return Error(Premature end of bitstream);
+
+// Read the code for this record.
+unsigned AbbrevID = Stream.ReadCode();
+switch (AbbrevID) {
+case bitc::END_BLOCK:
+  if (Stream.ReadBlockEnd())
+return Error(Error at end of block);
+  return false;
+case bitc::ENTER_SUBBLOCK:
+  if (ParseBlock(Stream))
+return true;
+  break;
+case bitc::DEFINE_ABBREV:
+  Stream.ReadAbbrevRecord();
+  break;
+default:
+  Record.clear();
+  unsigned Code = Stream.ReadRecord(AbbrevID, Record);
+  // TODO: Compute per-blockid/code stats.
+  Code = Code;
+  break;
+}
+  }
+}
+
 /// AnalyzeBitcode - Analyze the bitcode file specified by InputFilename.
 static int AnalyzeBitcode() {
   // Read the input file.
@@ -69,15 +122,11 @@
   else
 Buffer = MemoryBuffer::getFile(InputFilename[0], InputFilename.size());
 
-  if (Buffer == 0) {
-std::cerr  Error reading '  InputFilename  '.\n;
-return 1;
-  }
+  if (Buffer == 0)
+return Error(Error reading ' + InputFilename + '.);
   
-  if (Buffer-getBufferSize()  3) {
-std::cerr  Bitcode stream should be a multiple of 4 bytes in length\n;
-return 1;
-  }
+  if (Buffer-getBufferSize()  3)
+return Error(Bitcode stream should be a multiple of 4 bytes in length);
   
   unsigned char *BufPtr = (unsigned char *)Buffer-getBufferStart();
   BitstreamReader Stream(BufPtr, BufPtr+Buffer-getBufferSize());
@@ -92,12 +141,25 @@
   Signature[4] = Stream.Read(4);
   Signature[5] = Stream.Read(4);
   
+  // Autodetect the file contents, if it is one we know.
   CurStreamType = UnknownBitstream;
   if (Signature[0] == 'B'  Signature[1] == 'C' 
   Signature[2] == 0x0  Signature[3] == 0xC 
   Signature[4] == 0xE  Signature[5] == 0xD)
 CurStreamType = LLVMIRBitstream;
 
+  // Parse the top-level structure.  We only allow blocks at the top-level.
+  while (!Stream.AtEndOfStream()) {
+unsigned Code = Stream.ReadCode();
+if (Code != bitc::ENTER_SUBBLOCK)
+  return Error(Invalid record at top-level);
+
+if (ParseBlock(Stream))
+  return true;
+  }
+  
+  // Print a summary of the read file.
+  
   std::cerr  Summary of   InputFilename  :\n;
   std::cerrStream type: ;
   switch (CurStreamType) {
@@ -105,10 +167,17 @@
   case UnknownBitstream: std::cerr  unknown\n; break;
   case LLVMIRBitstream:  std::cerr  LLVM IR\n; break;
   }
-
+  
+  // TODO: Stats!
+  
   return 0;
 }
 
+
+//===--===//
+// Bytecode specific analysis.
+//===--===//
+
 int main(int argc, char **argv) {
   llvm_shutdown_obj X;  // Call llvm_shutdown() on exit.
   cl::ParseCommandLineOptions(argc, argv,  llvm-bcanalyzer file analyzer\n);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu

Re: [llvm-commits] [126685] Add alias support to llvm-gcc

2007-04-29 Thread Anton Korobeynikov
Chris,
 Revision: 126685
 Author:   clattner
 Date: 2007-04-28 21:24:20 -0700 (Sat, 28 Apr 2007)
 
 Log Message:
 ---
 Add alias support to llvm-gcc
Probably I forget about one small addendum. Attached.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics  Mechanics, Saint Petersburg State University.

diff -r afcaf95c2797 README.LLVM
--- a/README.LLVM	Sat Apr 28 09:03:58 2007 +
+++ b/README.LLVM	Wed Apr 25 18:36:58 2007 +0400
@@ -41,10 +41,6 @@ Below we assume the LLVM OBJDIR is $LLVM
 
 //===---
 Linux-specific Instructions:
-
-Until http://llvm.org/PR1017 is fixed, you should configure with
---disable-shared. This fixes problems when missing symbols in the stdc++ 
-library when trying to link llvm-g++. 
 
 If llvm-gcc doesn't build right, try building LLVM with OPTIMIZE_OPTION=-O2.
 This may be host compiler version specific.
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] [126665] Revert previous patch.

2007-04-29 Thread Bill Wendling
Is this to mean that

for t in $TARGETS ; do
   ln -s ../../../libstdc++.6.dylib \
 .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc+ 
+.dylib \
 || exit 1
done

is the correct patch and that the one brought over from the merge  
should be ignored?

:-)

-bw

On Apr 27, 2007, at 10:01 PM, Evan Cheng wrote:

 Please ignore. There was no problem. It's something else that was
 causing issues.

 Evan
 On Apr 27, 2007, at 7:08 PM, Bill wrote:

 The newest LLVM-GCC merge has this:

 for t in $TARGETS ; do
 -  ln -s ../../../libstdc++.6.dylib \
 +  cp -p /usr/lib/libstdc++.6.dylib \
  .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc+
 +.dylib \
  || exit 1
 +  strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/
 $VERS/libstdc++.dylib
 || exit 1
  done

 The strip line breaks. But does this help you with the problem
 you're seeing?

 -bw

 On 4/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Revision: 126665
 Author:   echeng
 Date: 2007-04-27 18:07:12 -0700 (Fri, 27 Apr 2007)

 Log Message:
 ---
 Revert previous patch. libstdc++.dylib links still needed.

 Modified Paths:
 --
 apple-local/branches/llvm/build_gcc

 Modified: apple-local/branches/llvm/build_gcc
 ===
 --- apple-local/branches/llvm/build_gcc 2007-04-28 01:03:48 UTC
 (rev 126664)
 +++ apple-local/branches/llvm/build_gcc 2007-04-28 01:07:12 UTC
 (rev 126665)
 @@ -451,6 +451,12 @@
fi
  done

 +for t in $TARGETS ; do
 +  ln -s ../../../libstdc++.6.dylib \
 +.$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc+
 +.dylib \
 +|| exit 1
 +done
 +
  # include
  HEADERPATH=$DEST_ROOT/include/gcc/darwin/$MAJ_VERS
  mkdir -p .$HEADERPATH || exit 1


 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CodeGen/X86/aliases.ll

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/test/CodeGen/X86:

aliases.ll updated: 1.1 - 1.2
---
Log message:

Updated aliases test


---
Diffs of the changes:  (+4 -2)

 aliases.ll |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm/test/CodeGen/X86/aliases.ll
diff -u llvm/test/CodeGen/X86/aliases.ll:1.1 
llvm/test/CodeGen/X86/aliases.ll:1.2
--- llvm/test/CodeGen/X86/aliases.ll:1.1Wed Apr 25 09:27:10 2007
+++ llvm/test/CodeGen/X86/aliases.llSun Apr 29 05:34:42 2007
@@ -1,7 +1,7 @@
 ; RUN: llvm-as  %s | \
 ; RUN:   llc -mtriple=i686-pc-linux-gnu -o %t -f
-; RUN: grep -c set %t   | grep 4
-; RUN: grep -c globl %t | grep 3
+; RUN: grep -c set %t   | grep 5
+; RUN: grep -c globl %t | grep 4
 ; RUN: grep -c weak %t  | grep 1
 
 @bar = external global i32
@@ -15,6 +15,8 @@
 
 @bar_i = alias internal i32* @bar
 
[EMAIL PROTECTED] = alias bitcast (i32* @bar to i64*)
+
 define i32 @test() {
 entry:
%tmp = load i32* @foo1



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Globals.cpp Module.cpp Verifier.cpp

2007-04-29 Thread Anton Korobeynikov
Chris,

 This can use the new getAliaseeGlobal() method.
Not here. We should distinguish, whether we have variable, function ot
bitcast here and print them differently.

 What does it mean for an alias to be a declaration?  I'd be fine with  
 them always returning true or false.  What code calls  
 GlobalValue::isDeclaration?
I thought to use it inside linker. Call Alias-isDeclaration() and if
not = do RAUW. I think it's ok to delegate isDeclaration() to aliasee.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics  Mechanics, Saint Petersburg State University.


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] llvm-gcc mirror update delayed again

2007-04-29 Thread Bill Wendling
Have others come across this failure?

-bw

On Apr 28, 2007, at 7:22 AM, Jeff Cohen wrote:

 Once again, the log claims it was updated at 2am PDT, but my nightly
 tester failed to pull in any changes at 3am.  Revision 318 is now
 present at 7am.

 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] Compilation Failure

2007-04-29 Thread Bill Wendling
There's a compilation failure:

llvm[1]: Compiling MemoryBuffer.cpp for Debug build
/Volumes/Gir/devel/llvm/llvm.src/lib/Support/MemoryBuffer.cpp: In  
static member function 'static llvm::MemoryBuffer*  
llvm::MemoryBuffer::getFile(const char*, unsigned int, int64_t)':
/Volumes/Gir/devel/llvm/llvm.src/lib/Support/MemoryBuffer.cpp:161:  
error: no matching function for call to  
'llvm::sys::PathWithStatus::PathWithStatus(const char*, unsigned int)'
/Volumes/Gir/devel/llvm/llvm.src/include/llvm/System/Path.h:559:  
note: candidates are: llvm::sys::PathWithStatus::PathWithStatus(const  
std::string)
/Volumes/Gir/devel/llvm/llvm.src/include/llvm/System/Path.h:551:  
note: llvm::sys::PathWithStatus::PathWithStatus(const  
llvm::sys::Path)
/Volumes/Gir/devel/llvm/llvm.src/include/llvm/System/Path.h:545:  
note: llvm::sys::PathWithStatus::PathWithStatus(const  
llvm::sys::PathWithStatus)
/Volumes/Gir/devel/llvm/llvm.src/include/llvm/System/Path.h:542:  
note: llvm::sys::PathWithStatus::PathWithStatus()
make[1]: *** [/Volumes/Gir/devel/llvm/llvm.obj/lib/Support/Debug/ 
MemoryBuffer.o] Error 1
make: *** [all] Error 1


-bw
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] Compilation Failure

2007-04-29 Thread Jeff Cohen
Yep, my nightly tester failed with the same error.

Look, this is getting ridiculous.  Never mind running the regression 
tests, how about trying to compile before committing?

Bill Wendling wrote:
 There's a compilation failure:

 llvm[1]: Compiling MemoryBuffer.cpp for Debug build
 /Volumes/Gir/devel/llvm/llvm.src/lib/Support/MemoryBuffer.cpp: In  
 static member function 'static llvm::MemoryBuffer*  
 llvm::MemoryBuffer::getFile(const char*, unsigned int, int64_t)':
 /Volumes/Gir/devel/llvm/llvm.src/lib/Support/MemoryBuffer.cpp:161:  
 error: no matching function for call to  
 'llvm::sys::PathWithStatus::PathWithStatus(const char*, unsigned int)'
 /Volumes/Gir/devel/llvm/llvm.src/include/llvm/System/Path.h:559:  
 note: candidates are: llvm::sys::PathWithStatus::PathWithStatus(const  
 std::string)
 /Volumes/Gir/devel/llvm/llvm.src/include/llvm/System/Path.h:551:  
 note: llvm::sys::PathWithStatus::PathWithStatus(const  
 llvm::sys::Path)
 /Volumes/Gir/devel/llvm/llvm.src/include/llvm/System/Path.h:545:  
 note: llvm::sys::PathWithStatus::PathWithStatus(const  
 llvm::sys::PathWithStatus)
 /Volumes/Gir/devel/llvm/llvm.src/include/llvm/System/Path.h:542:  
 note: llvm::sys::PathWithStatus::PathWithStatus()
 make[1]: *** [/Volumes/Gir/devel/llvm/llvm.obj/lib/Support/Debug/ 
 MemoryBuffer.o] Error 1
 make: *** [all] Error 1


 -bw
 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



   

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] llvm-gcc mirror update delayed again

2007-04-29 Thread Jeff Cohen
It happened again last night.  According to the log:


r319 | bwendlin | 2007-04-29 02:04:05 -0700 (Sun, 29 Apr 2007) | 1 line

auto-merge 2007-04-29T02:00:00-0700


it updated at 2am.  But my nightly tester at 3am did not pull in 319, 
only 318 (which it failed to pull in the previous night).  But updating 
now pulls in 319.

So when is the mirror updated? If not 2am, why does the log show 2am?  
If it is 2am, then how does an update an hour later fail to see it?  And 
why does there have to be a mirror in the first place?  Why can't you do 
your commits directly to a publicly accessible repository?  What benefit 
is there to keeping the code under wraps for less than 24 hours?

Bill Wendling wrote:
 Have others come across this failure?

 -bw

 On Apr 28, 2007, at 7:22 AM, Jeff Cohen wrote:

 Once again, the log claims it was updated at 2am PDT, but my nightly
 tester failed to pull in any changes at 3am.  Revision 318 is now
 present at 7am.

 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Support/MemoryBuffer.cpp

2007-04-29 Thread Jeff Cohen


Changes in directory llvm/lib/Support:

MemoryBuffer.cpp updated: 1.1 - 1.2
---
Log message:

Unbreak build.

---
Diffs of the changes:  (+2 -1)

 MemoryBuffer.cpp |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/Support/MemoryBuffer.cpp
diff -u llvm/lib/Support/MemoryBuffer.cpp:1.1 
llvm/lib/Support/MemoryBuffer.cpp:1.2
--- llvm/lib/Support/MemoryBuffer.cpp:1.1   Sun Apr 29 01:58:52 2007
+++ llvm/lib/Support/MemoryBuffer.cpp   Sun Apr 29 09:21:44 2007
@@ -14,6 +14,7 @@
 #include llvm/Support/MemoryBuffer.h
 #include llvm/System/MappedFile.h
 #include llvm/System/Process.h
+#include cassert
 #include cstdio
 #include cstring
 #include cerrno
@@ -158,7 +159,7 @@
 
 MemoryBuffer *MemoryBuffer::getFile(const char *FilenameStart, unsigned FnSize,
 int64_t FileSize) {
-  sys::PathWithStatus P(FilenameStart, FnSize);
+  sys::PathWithStatus P(std::string(FilenameStart, FnSize));
 #if 1
   return new MemoryBufferMMapFile(P);
 #else



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/win32/Bitcode/Bitcode.vcproj

2007-04-29 Thread Jeff Cohen


Changes in directory llvm/win32/Bitcode:

Bitcode.vcproj updated: 1.2 - 1.3
---
Log message:

Unbreak VC++ build.

---
Diffs of the changes:  (+3 -6)

 Bitcode.vcproj |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)


Index: llvm/win32/Bitcode/Bitcode.vcproj
diff -u llvm/win32/Bitcode/Bitcode.vcproj:1.2 
llvm/win32/Bitcode/Bitcode.vcproj:1.3
--- llvm/win32/Bitcode/Bitcode.vcproj:1.2   Mon Apr 23 08:55:05 2007
+++ llvm/win32/Bitcode/Bitcode.vcproj   Sun Apr 29 09:22:14 2007
@@ -117,21 +117,18 @@
File

RelativePath=..\..\lib\Bitcode\Reader\BitcodeReader.h
/File
-   File
-   
RelativePath=..\..\lib\Bitcode\Reader\ReaderWrappers.cpp
-   /File
/Filter
Filter
Name=Writer
Filter=
File
-   
RelativePath=..\..\lib\Bitcode\Writer\ValueEnumerator.cpp
+   
RelativePath=..\..\lib\Bitcode\Writer\BitcodeWriter.cpp
/File
File
-   
RelativePath=..\..\lib\Bitcode\Writer\ValueEnumerator.h
+   
RelativePath=..\..\lib\Bitcode\Writer\ValueEnumerator.cpp
/File
File
-   
RelativePath=..\..\lib\Bitcode\Writer\Writer.cpp
+   
RelativePath=..\..\lib\Bitcode\Writer\ValueEnumerator.h
/File
/Filter
/Filter



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/win32/Support/Support.vcproj

2007-04-29 Thread Jeff Cohen


Changes in directory llvm/win32/Support:

Support.vcproj updated: 1.19 - 1.20
---
Log message:

Unbreak VC++ build.

---
Diffs of the changes:  (+6 -0)

 Support.vcproj |6 ++
 1 files changed, 6 insertions(+)


Index: llvm/win32/Support/Support.vcproj
diff -u llvm/win32/Support/Support.vcproj:1.19 
llvm/win32/Support/Support.vcproj:1.20
--- llvm/win32/Support/Support.vcproj:1.19  Fri Apr  6 17:30:07 2007
+++ llvm/win32/Support/Support.vcproj   Sun Apr 29 09:22:14 2007
@@ -158,6 +158,9 @@

RelativePath=..\..\lib\Support\ManagedStatic.cpp
/File
File
+   
RelativePath=..\..\lib\Support\MemoryBuffer.cpp
+   /File
+   File

RelativePath=..\..\lib\Support\PluginLoader.cpp
/File
File
@@ -311,6 +314,9 @@

RelativePath=..\..\include\llvm\Support\MathExtras.h
/File
File
+   
RelativePath=..\..\include\llvm\Support\MemoryBuffer.h
+   /File
+   File

RelativePath=..\..\include\llvm\Support\OutputBuffer.h
/File
File



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] llvm-gcc mirror update delayed again

2007-04-29 Thread Reid Spencer
On Sun, 29 Apr 2007 07:11:45 -0700
 Jeff Cohen [EMAIL PROTECTED] wrote:
It happened again last night.  According to the log:


r319 | bwendlin | 2007-04-29 02:04:05 -0700 (Sun, 29 Apr 2007) | 1 line

auto-merge 2007-04-29T02:00:00-0700


it updated at 2am.  But my nightly tester at 3am did not pull in 319, 
only 318 (which it failed to pull in the previous night).  But updating 
now pulls in 319.

As I suspected, I think those times are bogus :)


So when is the mirror updated? If not 2am, why does the log show 2am?  
If it is 2am, then how does an update an hour later fail to see it?  

Bill needs to answer those questions.

 And 
why does there have to be a mirror in the first place?  Why can't you do 
your commits directly to a publicly accessible repository?  What benefit 
is there to keeping the code under wraps for less than 24 hours?

Jeff, we all suffer this frustration. If we could change it, it would be better 
by now.  It is the way it is because of how Apple has organized their internal 
repository. llvm-gcc is comingled with Apple GCC and that repository isn't 
accessible outside Apple. Consequently, the mirror allows llvm-gcc to be 
accessible by the community without providing access to the rest of Apple GCC 
(or something like that, I'm vague on the details).

We would have a fully commitable llvm-gcc repository under Subversion by now if 
we were cut over, but we're not. Because there's a lot going on in the 
community right now, we've put off the SVN migration until June. So, a few more 
weeks of patience and things should get much better in this regard.

Reid.

Bill Wendling wrote:
 Have others come across this failure?

 -bw

 On Apr 28, 2007, at 7:22 AM, Jeff Cohen wrote:

 Once again, the log claims it was updated at 2am PDT, but my nightly
 tester failed to pull in any changes at 3am.  Revision 318 is now
 present at 7am.

 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-29 Thread Jeff Cohen


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.53 - 1.54
---
Log message:

Fix MemoryBuffer breakage correctly.

---
Diffs of the changes:  (+8 -0)

 Path.h |8 
 1 files changed, 8 insertions(+)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.53 
llvm/include/llvm/System/Path.h:1.54
--- llvm/include/llvm/System/Path.h:1.53Sun Apr 29 01:16:32 2007
+++ llvm/include/llvm/System/Path.h Sun Apr 29 09:43:30 2007
@@ -559,6 +559,14 @@
   explicit PathWithStatus(const std::string p) 
 : Path(p), status(), fsIsValid(false) {}
 
+  /// This constructor will accept a character range as a path.  No 
checking
+  /// is done on this path to determine if it is valid.  To determine
+  /// validity of the path, use the isValid method. 
+  /// @param p The path to assign.
+  /// @brief Construct a Path from a string.
+  explicit PathWithStatus(const char *StrStart, unsigned StrLen)
+: Path(StrStart, StrLen), status(), fsIsValid(false) {}
+
   /// Makes a copy of \p that to \p this.
   /// @returns \p this
   /// @brief Assignment Operator



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Support/MemoryBuffer.cpp

2007-04-29 Thread Jeff Cohen


Changes in directory llvm/lib/Support:

MemoryBuffer.cpp updated: 1.2 - 1.3
---
Log message:

Fix MemoryBuffer breakage correctly.

---
Diffs of the changes:  (+1 -1)

 MemoryBuffer.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Support/MemoryBuffer.cpp
diff -u llvm/lib/Support/MemoryBuffer.cpp:1.2 
llvm/lib/Support/MemoryBuffer.cpp:1.3
--- llvm/lib/Support/MemoryBuffer.cpp:1.2   Sun Apr 29 09:21:44 2007
+++ llvm/lib/Support/MemoryBuffer.cpp   Sun Apr 29 09:43:31 2007
@@ -159,7 +159,7 @@
 
 MemoryBuffer *MemoryBuffer::getFile(const char *FilenameStart, unsigned FnSize,
 int64_t FileSize) {
-  sys::PathWithStatus P(std::string(FilenameStart, FnSize));
+  sys::PathWithStatus P(FilenameStart, FnSize);
 #if 1
   return new MemoryBufferMMapFile(P);
 #else



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] llvm-gcc mirror update delayed again

2007-04-29 Thread Jeff Cohen
Reid Spencer wrote:
 On Sun, 29 Apr 2007 07:11:45 -0700
  Jeff Cohen [EMAIL PROTECTED] wrote:
   
 It happened again last night.  According to the log:

 
 r319 | bwendlin | 2007-04-29 02:04:05 -0700 (Sun, 29 Apr 2007) | 1 line

 auto-merge 2007-04-29T02:00:00-0700
 

 it updated at 2am.  But my nightly tester at 3am did not pull in 319, 
 only 318 (which it failed to pull in the previous night).  But updating 
 now pulls in 319.
 

 As I suspected, I think those times are bogus :)
   

I don't buy it.  There are too many days where the changes *are* pulled 
in one hour later.  And other days where they're pulled in 49 hours later.

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs

2007-04-29 Thread Jeff Cohen
Jeff Cohen wrote:
 Changes in directory llvm/lib/AsmParser:

 llvmAsmParser.cpp.cvs updated: 1.95 - 1.96
 llvmAsmParser.h.cvs updated: 1.73 - 1.74
 ---
 Log message:

 Fix MemoryBuffer breakage correctly.

 ---
 Diffs of the changes:  (+1404 -1627)

  llvmAsmParser.cpp.cvs | 3002 
 +++---
  llvmAsmParser.h.cvs   |   29 
  2 files changed, 1404 insertions(+), 1627 deletions(-)
   

Ugh...  No, I did not change AsmParser.y.  But as these files got 
modified by design anyway, I'm not going to spend the effort to 
unmodify them.  At least it'll prevent a conflicted update (for me 
anyway) in the future.

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] Persistent regression failures

2007-04-29 Thread Jeff Cohen
Two tests that broke yesterday are still broke:

CFrontend/2007-04-11-InlineAsmStruct.c
CFrontend/2007-04-11-InlineAsmUnion.c


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.54 - 1.55
---
Log message:

add missing ctor


---
Diffs of the changes:  (+6 -2)

 Path.h |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.54 
llvm/include/llvm/System/Path.h:1.55
--- llvm/include/llvm/System/Path.h:1.54Sun Apr 29 09:43:30 2007
+++ llvm/include/llvm/System/Path.h Sun Apr 29 12:40:50 2007
@@ -177,8 +177,6 @@
   /// This constructor will accept a character range as a path.  No 
checking
   /// is done on this path to determine if it is valid.  To determine
   /// validity of the path, use the isValid method. 
-  /// @param p The path to assign.
-  /// @brief Construct a Path from a string.
   explicit Path(const char *StrStart, unsigned StrLen)
 : path(StrStart, StrStart+StrLen) {}
   
@@ -551,6 +549,12 @@
   PathWithStatus(const Path other) 
 : Path(other), status(), fsIsValid(false) {}
 
+  /// This constructor will accept a character range as a path.  No 
checking
+  /// is done on this path to determine if it is valid.  To determine
+  /// validity of the path, use the isValid method. 
+  PathWithStatus(const char *StrStart, unsigned StrLen)
+: Path(StrStart, StrLen), fsIsValid(false) {}
+
   /// This constructor will accept a std::string as a path. No checking is
   /// done on this path to determine if it is valid. To determine validity
   /// of the path, use the isValid method. 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] Compilation Failure

2007-04-29 Thread Chris Lattner

On Apr 29, 2007, at 7:03 AM, Jeff Cohen wrote:

 Yep, my nightly tester failed with the same error.

 Look, this is getting ridiculous.  Never mind running the regression
 tests, how about trying to compile before committing?

I'm sorry for the breakage Jeff.

However, there is no need for the attitude.  Yes, I did actually try  
compiling my tree.  The failure was forgetting to check in the file.   
Again, the breakage is bad, and I'm not making excuses for it, but  
ow about trying to compile before committing is pretty silly.

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.55 - 1.56
---
Log message:

Jeff's fix was fine


---
Diffs of the changes:  (+2 -6)

 Path.h |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.55 
llvm/include/llvm/System/Path.h:1.56
--- llvm/include/llvm/System/Path.h:1.55Sun Apr 29 12:40:50 2007
+++ llvm/include/llvm/System/Path.h Sun Apr 29 12:44:10 2007
@@ -177,6 +177,8 @@
   /// This constructor will accept a character range as a path.  No 
checking
   /// is done on this path to determine if it is valid.  To determine
   /// validity of the path, use the isValid method. 
+  /// @param p The path to assign.
+  /// @brief Construct a Path from a string.
   explicit Path(const char *StrStart, unsigned StrLen)
 : path(StrStart, StrStart+StrLen) {}
   
@@ -549,12 +551,6 @@
   PathWithStatus(const Path other) 
 : Path(other), status(), fsIsValid(false) {}
 
-  /// This constructor will accept a character range as a path.  No 
checking
-  /// is done on this path to determine if it is valid.  To determine
-  /// validity of the path, use the isValid method. 
-  PathWithStatus(const char *StrStart, unsigned StrLen)
-: Path(StrStart, StrLen), fsIsValid(false) {}
-
   /// This constructor will accept a std::string as a path. No checking is
   /// done on this path to determine if it is valid. To determine validity
   /// of the path, use the isValid method. 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] Persistent regression failures

2007-04-29 Thread Chris Lattner

On Apr 29, 2007, at 8:09 AM, Jeff Cohen wrote:

 Two tests that broke yesterday are still broke:

 CFrontend/2007-04-11-InlineAsmStruct.c
 CFrontend/2007-04-11-InlineAsmUnion.c

These both pass for me.  Three options: your CFE isn't up-to-date,  
the test is broken for your target, or the compiler is broken for  
your target.

-Chris 
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/LangRef.html

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/docs:

LangRef.html updated: 1.240 - 1.241
---
Log message:

Implement review feedback


---
Diffs of the changes:  (+2 -2)

 LangRef.html |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.240 llvm/docs/LangRef.html:1.241
--- llvm/docs/LangRef.html:1.240Sat Apr 28 20:07:00 2007
+++ llvm/docs/LangRef.html  Sun Apr 29 13:02:48 2007
@@ -24,7 +24,7 @@
   lia href=#callingconvCalling Conventions/a/li
   lia href=#globalvarsGlobal Variables/a/li
   lia href=#functionstructureFunctions/a/li
-  lia href=aliasstructureAliases/a
+  lia href=#aliasstructureAliases/a
   lia href=#paramattrsParameter Attributes/a/li
   lia href=#moduleasmModule-Level Inline Assembly/a/li
   lia href=#datalayoutData Layout/a/li
@@ -4749,7 +4749,7 @@
 
   a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/04/29 01:07:00 $
+  Last modified: $Date: 2007/04/29 18:02:48 $
 /address
 /body
 /html



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Globals.cpp Verifier.cpp

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/lib/VMCore:

AsmWriter.cpp updated: 1.277 - 1.278
Globals.cpp updated: 1.21 - 1.22
Verifier.cpp updated: 1.208 - 1.209
---
Log message:

Implement review feedback


---
Diffs of the changes:  (+30 -9)

 AsmWriter.cpp |3 +--
 Globals.cpp   |   33 +++--
 Verifier.cpp  |3 ++-
 3 files changed, 30 insertions(+), 9 deletions(-)


Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.277 llvm/lib/VMCore/AsmWriter.cpp:1.278
--- llvm/lib/VMCore/AsmWriter.cpp:1.277 Sat Apr 28 08:44:59 2007
+++ llvm/lib/VMCore/AsmWriter.cpp   Sun Apr 29 13:02:48 2007
@@ -926,8 +926,7 @@
assert(0  Invalid alias linkage);
   }
   
-  const Constant *Aliasee = dyn_cast_or_nullConstant(GA-getAliasee());
-  assert(Aliasee  Aliasee cannot be null);
+  const Constant *Aliasee = GA-getAliasee();
 
   if (const GlobalVariable *GV = dyn_castGlobalVariable(Aliasee)) {
 printType(GV-getType());


Index: llvm/lib/VMCore/Globals.cpp
diff -u llvm/lib/VMCore/Globals.cpp:1.21 llvm/lib/VMCore/Globals.cpp:1.22
--- llvm/lib/VMCore/Globals.cpp:1.21Sat Apr 28 08:44:59 2007
+++ llvm/lib/VMCore/Globals.cpp Sun Apr 29 13:02:48 2007
@@ -12,6 +12,7 @@
 //
 
//===--===//
 
+#include llvm/Constants.h
 #include llvm/GlobalVariable.h
 #include llvm/GlobalAlias.h
 #include llvm/DerivedTypes.h
@@ -193,16 +194,36 @@
 }
 
 bool GlobalAlias::isDeclaration() const {
-  const GlobalValue* AV = dyn_cast_or_nullconst GlobalValue(getAliasee());
-  return (AV  AV-isDeclaration());
+  const GlobalValue* AV = getAliasedGlobal();
+  if (AV)
+return AV-isDeclaration();
+  else
+return false;
 }
 
 void GlobalAlias::setAliasee(Constant *Aliasee) 
 {
-  if (Aliasee) {
-assert(Aliasee-getType() == getType()  
+  if (Aliasee)
+assert(Aliasee-getType() == getType() 
Alias and aliasee types should match!);
-setOperand(0, Aliasee);
-  }
+  
+  setOperand(0, Aliasee);
+}
+
+const GlobalValue *GlobalAlias::getAliasedGlobal() const  {
+  const Constant *C = getAliasee();
+  if (C) {
+if (const GlobalValue *GV = dyn_castGlobalValue(C))
+  return GV;
+else {
+  const ConstantExpr *CE = 0;
+  if ((CE = dyn_castConstantExpr(Aliasee)) 
+  (CE-getOpcode() == Instruction::BitCast))
+return castGlobalValue(CE-getOperand(0));
+  else
+assert(0  Unsupported aliasee);
+}
+  } else
+return 0;
 }
 


Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.208 llvm/lib/VMCore/Verifier.cpp:1.209
--- llvm/lib/VMCore/Verifier.cpp:1.208  Sat Apr 28 09:35:41 2007
+++ llvm/lib/VMCore/Verifier.cppSun Apr 29 13:02:48 2007
@@ -321,7 +321,8 @@
   
   if (!isaGlobalValue(GA.getAliasee())) {
 const ConstantExpr *CE = dyn_castConstantExpr(GA.getAliasee());
-Assert1(CE  CE-getOpcode() == Instruction::BitCast,
+Assert1(CE  CE-getOpcode() == Instruction::BitCast 
+isaGlobalValue(CE-getOperand(0)),
 Aliasee should be either GlobalValue or bitcast of GlobalValue,
 GA);
   }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Function.h GlobalAlias.h

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/include/llvm:

Function.h updated: 1.83 - 1.84
GlobalAlias.h updated: 1.2 - 1.3
---
Log message:

Implement review feedback


---
Diffs of the changes:  (+6 -3)

 Function.h|4 ++--
 GlobalAlias.h |5 -
 2 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/Function.h
diff -u llvm/include/llvm/Function.h:1.83 llvm/include/llvm/Function.h:1.84
--- llvm/include/llvm/Function.h:1.83   Sat Apr 28 08:44:59 2007
+++ llvm/include/llvm/Function.hSun Apr 29 13:02:48 2007
@@ -150,12 +150,12 @@
   /// removeFromParent - This method unlinks 'this' from the containing module,
   /// but does not delete it.
   ///
-  virtual void removeFromParent();
+  void removeFromParent();
 
   /// eraseFromParent - This method unlinks 'this' from the containing module
   /// and deletes it.
   ///
-  virtual void eraseFromParent();
+  void eraseFromParent();
 
 
   /// Get the underlying elements of the Function... the basic block list is


Index: llvm/include/llvm/GlobalAlias.h
diff -u llvm/include/llvm/GlobalAlias.h:1.2 llvm/include/llvm/GlobalAlias.h:1.3
--- llvm/include/llvm/GlobalAlias.h:1.2 Sat Apr 28 08:44:59 2007
+++ llvm/include/llvm/GlobalAlias.h Sun Apr 29 13:02:48 2007
@@ -75,7 +75,10 @@
   Constant* getAliasee() {
 return cast_or_nullConstant(getOperand(0));
   }
-
+  /// getAliasedGlobal() - Aliasee can be either global or bitcast of
+  /// global. This method retrives the global for both aliasee flavours.
+  const GlobalValue* getAliasedGlobal() const;
+
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const GlobalAlias *) { return true; }
   static inline bool classof(const Value *V) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.158 - 1.159
---
Log message:

Implement review feedback


---
Diffs of the changes:  (+3 -12)

 AsmPrinter.cpp |   15 +++
 1 files changed, 3 insertions(+), 12 deletions(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.158 
llvm/lib/CodeGen/AsmPrinter.cpp:1.159
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.158   Sat Apr 28 08:44:59 2007
+++ llvm/lib/CodeGen/AsmPrinter.cpp Sun Apr 29 13:02:48 2007
@@ -129,22 +129,13 @@
 O  \n;
 for (Module::const_alias_iterator I = M.alias_begin(), E = M.alias_end();
  I!=E; ++I) {
-  const Constant *Aliasee = dyn_cast_or_nullConstant(I-getAliasee());
-  assert(Aliasee  Aliasee cannot be null);
-
   std::string Name = Mang-getValueName(I);
   std::string Target;
   
-  if (const GlobalValue *GV = dyn_castGlobalValue(Aliasee))
+  if (const GlobalValue *GV = I-getAliasedGlobal())
 Target = Mang-getValueName(GV);
-  else {
-const ConstantExpr *CE = 0;
-if ((CE = dyn_castConstantExpr(Aliasee)) 
-(CE-getOpcode() == Instruction::BitCast))
-  Target = Mang-getValueName(CE-getOperand(0));
-else
-  assert(0  Unsupported aliasee);
-  }
+  else
+assert(0  Unsupported aliasee);
   
   if (I-hasExternalLinkage())
 O  \t.globl\t  Name  \n;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Globals.cpp Module.cpp Verifier.cpp

2007-04-29 Thread Chris Lattner

On Apr 29, 2007, at 3:38 AM, Anton Korobeynikov wrote:

 Chris,

 This can use the new getAliaseeGlobal() method.
 Not here. We should distinguish, whether we have variable, function ot
 bitcast here and print them differently.

Ok, but the call can be used to dig the global out from under the  
constantexprs etc.

 What does it mean for an alias to be a declaration?  I'd be fine with
 them always returning true or false.  What code calls
 GlobalValue::isDeclaration?
 I thought to use it inside linker. Call Alias-isDeclaration() and if
 not = do RAUW. I think it's ok to delegate isDeclaration() to  
 aliasee.

I must be missing something: isn't it *always* safe to RAUW uses of  
an alias with uses of its aliasee?

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Globals.cpp Module.cpp Verifier.cpp

2007-04-29 Thread Anton Korobeynikov
Hello, Chris.

 Ok, but the call can be used to dig the global out from under the  
 constantexprs etc.
Yes. Commited.

 I must be missing something: isn't it *always* safe to RAUW uses of  
 an alias with uses of its aliasee?
No, that's me missing some bits :) It's always safe to do RAUW of an
alias. But even no used alias should be alive.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics  Mechanics, Saint Petersburg State University.


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/BytecodeFormat.html LangRef.html

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/docs:

BytecodeFormat.html updated: 1.71 - 1.72
LangRef.html updated: 1.241 - 1.242
---
Log message:

Implement protected visibility. This partly implements PR1363: 
http://llvm.org/PR1363 . Linker 
should be taught to deal with protected symbols.


---
Diffs of the changes:  (+11 -4)

 BytecodeFormat.html |6 +++---
 LangRef.html|9 -
 2 files changed, 11 insertions(+), 4 deletions(-)


Index: llvm/docs/BytecodeFormat.html
diff -u llvm/docs/BytecodeFormat.html:1.71 llvm/docs/BytecodeFormat.html:1.72
--- llvm/docs/BytecodeFormat.html:1.71  Sat Apr 28 08:44:59 2007
+++ llvm/docs/BytecodeFormat.html   Sun Apr 29 13:35:00 2007
@@ -1044,7 +1044,7 @@
 /tr
 tr
   tda href=#bitbit(10-12)/a/td
-  td class=td_leftVisibility style: 0=Default, 1=Hidden./td
+  td class=td_leftVisibility style: 0=Default, 1=Hidden, 
2=Protected./td
 /tr
 tr
   tda href=#bitbit(13-31)/a/td
@@ -1506,7 +1506,7 @@
 /tr
 tr
   tda href=#bitbit(16-18)/a/td
-  td class=td_leftVisibility style: 0=Default, 1=Hidden./td
+  td class=td_leftVisibility style: 0=Default, 1=Hidden, 
2=Protected./td
 /tr
 tr
   tda href=#bitbit(19-31)/a/td
@@ -2152,7 +2152,7 @@
 a href=mailto:[EMAIL PROTECTED]Reid Spencer/a and a
  href=mailto:[EMAIL PROTECTED]Chris Lattner/abr
 a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-Last modified: $Date: 2007/04/28 13:44:59 $
+Last modified: $Date: 2007/04/29 18:35:00 $
 /address
 /body
 /html


Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.241 llvm/docs/LangRef.html:1.242
--- llvm/docs/LangRef.html:1.241Sun Apr 29 13:02:48 2007
+++ llvm/docs/LangRef.html  Sun Apr 29 13:35:00 2007
@@ -591,6 +591,13 @@
 directly.
   /dd
 
+  dtbttprotected/tt - Protected style/b:/dt
+
+  ddOn ELF, protected visibility indicates that the symbol will be placed in
+  the dynamic symbol table, but that references within the defining module will
+  bind to the local symbol. That is, the symbol cannot be overridden by another
+  module.
+  /dd
 /dl
 
 /div
@@ -4749,7 +4756,7 @@
 
   a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/04/29 18:02:48 $
+  Last modified: $Date: 2007/04/29 18:35:00 $
 /address
 /body
 /html



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/lib/Bytecode/Writer:

Writer.cpp updated: 1.178 - 1.179
---
Log message:

Implement protected visibility. This partly implements PR1363: 
http://llvm.org/PR1363 . Linker 
should be taught to deal with protected symbols.


---
Diffs of the changes:  (+3 -2)

 Writer.cpp |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.178 
llvm/lib/Bytecode/Writer/Writer.cpp:1.179
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.178   Sat Apr 28 08:44:59 2007
+++ llvm/lib/Bytecode/Writer/Writer.cpp Sun Apr 29 13:35:00 2007
@@ -957,8 +957,9 @@
 static unsigned getEncodedVisibility(const GlobalValue *GV) {
   switch (GV-getVisibility()) {
   default: assert(0  Invalid visibility!);
-  case GlobalValue::DefaultVisibility: return 0;
-  case GlobalValue::HiddenVisibility:  return 1;
+  case GlobalValue::DefaultVisibility:   return 0;
+  case GlobalValue::HiddenVisibility:return 1;
+  case GlobalValue::ProtectedVisibility: return 2;
   }
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/lib/Bytecode/Reader:

Reader.cpp updated: 1.256 - 1.257
---
Log message:

Implement protected visibility. This partly implements PR1363: 
http://llvm.org/PR1363 . Linker 
should be taught to deal with protected symbols.


---
Diffs of the changes:  (+2 -0)

 Reader.cpp |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.256 
llvm/lib/Bytecode/Reader/Reader.cpp:1.257
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.256   Sat Apr 28 08:44:59 2007
+++ llvm/lib/Bytecode/Reader/Reader.cpp Sun Apr 29 13:35:00 2007
@@ -1532,6 +1532,7 @@
   switch (VisibilityID) {
   case 0: Visibility = GlobalValue::DefaultVisibility; break;
   case 1: Visibility = GlobalValue::HiddenVisibility; break;
+  case 2: Visibility = GlobalValue::ProtectedVisibility; break;
   default:
error(Unknown visibility type:  + utostr(VisibilityID));
Visibility = GlobalValue::DefaultVisibility;
@@ -1767,6 +1768,7 @@
 switch (VisibilityID) {
 case 0: Visibility = GlobalValue::DefaultVisibility; break;
 case 1: Visibility = GlobalValue::HiddenVisibility; break;
+case 2: Visibility = GlobalValue::ProtectedVisibility; break;
 default:
   error(Unknown visibility type:  + utostr(VisibilityID));
   Visibility = GlobalValue::DefaultVisibility;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/GlobalValue.h

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/include/llvm:

GlobalValue.h updated: 1.40 - 1.41
---
Log message:

Implement protected visibility. This partly implements PR1363: 
http://llvm.org/PR1363 . Linker 
should be taught to deal with protected symbols.


---
Diffs of the changes:  (+6 -2)

 GlobalValue.h |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/GlobalValue.h
diff -u llvm/include/llvm/GlobalValue.h:1.40 
llvm/include/llvm/GlobalValue.h:1.41
--- llvm/include/llvm/GlobalValue.h:1.40Sat Apr 28 08:44:59 2007
+++ llvm/include/llvm/GlobalValue.h Sun Apr 29 13:35:00 2007
@@ -43,7 +43,8 @@
   /// @brief An enumeration for the kinds of visibility of global values.
   enum VisibilityTypes {
 DefaultVisibility = 0,  /// The GV is visible
-HiddenVisibility/// The GV is hidden
+HiddenVisibility,   /// The GV is hidden
+ProtectedVisibility /// The GV is protected
   };
 
 protected:
@@ -58,7 +59,7 @@
   // Note: VC++ treats enums as signed, so an extra bit is required to prevent
   // Linkage and Visibility from turning into negative values.
   LinkageTypes Linkage : 5;   // The linkage of this global
-  unsigned Visibility : 1;// The visibility style of this global
+  unsigned Visibility : 2;// The visibility style of this global
   unsigned Alignment : 16;// Alignment of this symbol, must be power of two
   std::string Section;// Section to emit this into, empty mean default
 public:
@@ -74,6 +75,9 @@
 
   VisibilityTypes getVisibility() const { return (VisibilityTypes)Visibility; }
   bool hasHiddenVisibility() const { return Visibility == HiddenVisibility; }
+  bool hasProtectedVisibility() const {
+return Visibility == ProtectedVisibility;
+  }
   void setVisibility(VisibilityTypes V) { Visibility = V; }
   
   bool hasSection() const { return !Section.empty(); }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l Lexer.l.cvs llvmAsmParser.y llvmAsmParser.y.cvs

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/lib/AsmParser:

Lexer.l updated: 1.106 - 1.107
Lexer.l.cvs updated: 1.33 - 1.34
llvmAsmParser.y updated: 1.354 - 1.355
llvmAsmParser.y.cvs updated: 1.96 - 1.97
---
Log message:

Implement protected visibility. This partly implements PR1363: 
http://llvm.org/PR1363 . Linker 
should be taught to deal with protected symbols.


---
Diffs of the changes:  (+12 -8)

 Lexer.l |1 +
 Lexer.l.cvs |1 +
 llvmAsmParser.y |9 +
 llvmAsmParser.y.cvs |9 +
 4 files changed, 12 insertions(+), 8 deletions(-)


Index: llvm/lib/AsmParser/Lexer.l
diff -u llvm/lib/AsmParser/Lexer.l:1.106 llvm/lib/AsmParser/Lexer.l:1.107
--- llvm/lib/AsmParser/Lexer.l:1.106Wed Apr 25 09:27:10 2007
+++ llvm/lib/AsmParser/Lexer.l  Sun Apr 29 13:35:00 2007
@@ -206,6 +206,7 @@
 dllimport   { return DLLIMPORT; }
 dllexport   { return DLLEXPORT; }
 hidden  { return HIDDEN; }
+protected   { return PROTECTED; }
 extern_weak { return EXTERN_WEAK; }
 external{ return EXTERNAL; }
 thread_local{ return THREAD_LOCAL; }


Index: llvm/lib/AsmParser/Lexer.l.cvs
diff -u llvm/lib/AsmParser/Lexer.l.cvs:1.33 llvm/lib/AsmParser/Lexer.l.cvs:1.34
--- llvm/lib/AsmParser/Lexer.l.cvs:1.33 Wed Apr 25 09:29:12 2007
+++ llvm/lib/AsmParser/Lexer.l.cvs  Sun Apr 29 13:35:00 2007
@@ -206,6 +206,7 @@
 dllimport   { return DLLIMPORT; }
 dllexport   { return DLLEXPORT; }
 hidden  { return HIDDEN; }
+protected   { return PROTECTED; }
 extern_weak { return EXTERN_WEAK; }
 external{ return EXTERNAL; }
 thread_local{ return THREAD_LOCAL; }


Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.354 
llvm/lib/AsmParser/llvmAsmParser.y:1.355
--- llvm/lib/AsmParser/llvmAsmParser.y:1.354Sat Apr 28 11:06:50 2007
+++ llvm/lib/AsmParser/llvmAsmParser.y  Sun Apr 29 13:35:00 2007
@@ -1099,7 +1099,7 @@
 %token NORETURN INREG SRET NOUNWIND
 
 // Visibility Styles
-%token DEFAULT HIDDEN
+%token DEFAULT HIDDEN PROTECTED
 
 %start Module
 %%
@@ -1180,9 +1180,10 @@
   ;
 
 GVVisibilityStyle
-  : /*empty*/ { $$ = GlobalValue::DefaultVisibility; }
-  | DEFAULT   { $$ = GlobalValue::DefaultVisibility; }
-  | HIDDEN{ $$ = GlobalValue::HiddenVisibility;  }
+  : /*empty*/ { $$ = GlobalValue::DefaultVisibility;   }
+  | DEFAULT   { $$ = GlobalValue::DefaultVisibility;   }
+  | HIDDEN{ $$ = GlobalValue::HiddenVisibility;}
+  | PROTECTED { $$ = GlobalValue::ProtectedVisibility; }
   ;
 
 FunctionDeclareLinkage


Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs
diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.96 
llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.97
--- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.96 Sat Apr 28 11:07:31 2007
+++ llvm/lib/AsmParser/llvmAsmParser.y.cvs  Sun Apr 29 13:35:00 2007
@@ -1099,7 +1099,7 @@
 %token NORETURN INREG SRET NOUNWIND
 
 // Visibility Styles
-%token DEFAULT HIDDEN
+%token DEFAULT HIDDEN PROTECTED
 
 %start Module
 %%
@@ -1180,9 +1180,10 @@
   ;
 
 GVVisibilityStyle
-  : /*empty*/ { $$ = GlobalValue::DefaultVisibility; }
-  | DEFAULT   { $$ = GlobalValue::DefaultVisibility; }
-  | HIDDEN{ $$ = GlobalValue::HiddenVisibility;  }
+  : /*empty*/ { $$ = GlobalValue::DefaultVisibility;   }
+  | DEFAULT   { $$ = GlobalValue::DefaultVisibility;   }
+  | HIDDEN{ $$ = GlobalValue::HiddenVisibility;}
+  | PROTECTED { $$ = GlobalValue::ProtectedVisibility; }
   ;
 
 FunctionDeclareLinkage



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/lib/Target/X86:

X86ATTAsmPrinter.cpp updated: 1.103 - 1.104
X86AsmPrinter.cpp updated: 1.240 - 1.241
---
Log message:

Implement protected visibility. This partly implements PR1363: 
http://llvm.org/PR1363 . Linker 
should be taught to deal with protected symbols.


---
Diffs of the changes:  (+13 -3)

 X86ATTAsmPrinter.cpp |9 +++--
 X86AsmPrinter.cpp|7 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)


Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.103 
llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.104
--- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.103  Thu Apr 26 16:07:05 2007
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.cppSun Apr 29 13:35:00 2007
@@ -125,9 +125,13 @@
 }
 break;
   }
-  if (F-hasHiddenVisibility())
+  if (F-hasHiddenVisibility()) {
 if (const char *Directive = TAI-getHiddenDirective())
   O  Directive  CurrentFnName  \n;
+  } else if (F-hasProtectedVisibility()) {
+if (const char *Directive = TAI-getProtectedDirective())
+  O  Directive  CurrentFnName  \n;
+  }
 
   if (Subtarget-isTargetELF())
 O  \t.type   CurrentFnName  ,@function\n;
@@ -322,7 +326,8 @@
   if (isCallOp  isaFunction(GV)) {
 if (printGOT(TM, Subtarget)) {
   // Assemble call via PLT for non-local symbols
-  if (!GV-hasHiddenVisibility() || GV-isDeclaration())
+  if (!(GV-hasHiddenVisibility() || GV-hasProtectedVisibility()) ||
+  GV-isDeclaration())
 O  @PLT;
 }
 if (Subtarget-isTargetCygMing()  GV-isDeclaration())


Index: llvm/lib/Target/X86/X86AsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.240 
llvm/lib/Target/X86/X86AsmPrinter.cpp:1.241
--- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.240 Fri Apr 20 16:38:10 2007
+++ llvm/lib/Target/X86/X86AsmPrinter.cpp   Sun Apr 29 13:35:00 2007
@@ -155,9 +155,14 @@
 unsigned Size = TD-getTypeSize(Type);
 unsigned Align = TD-getPreferredAlignmentLog(I);
 
-if (I-hasHiddenVisibility())
+if (I-hasHiddenVisibility()) {
   if (const char *Directive = TAI-getHiddenDirective())
 O  Directive  name  \n;
+} else if (I-hasProtectedVisibility()) {
+  if (const char *Directive = TAI-getProtectedDirective())
+O  Directive  name  \n;
+}
+
 if (Subtarget-isTargetELF())
   O  \t.type   name  ,@object\n;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/lib/VMCore:

AsmWriter.cpp updated: 1.278 - 1.279
---
Log message:

Implement protected visibility. This partly implements PR1363: 
http://llvm.org/PR1363 . Linker 
should be taught to deal with protected symbols.


---
Diffs of the changes:  (+3 -0)

 AsmWriter.cpp |3 +++
 1 files changed, 3 insertions(+)


Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.278 llvm/lib/VMCore/AsmWriter.cpp:1.279
--- llvm/lib/VMCore/AsmWriter.cpp:1.278 Sun Apr 29 13:02:48 2007
+++ llvm/lib/VMCore/AsmWriter.cpp   Sun Apr 29 13:35:00 2007
@@ -886,6 +886,7 @@
 default: assert(0  Invalid visibility style!);
 case GlobalValue::DefaultVisibility: break;
 case GlobalValue::HiddenVisibility: Out  hidden ; break;
+case GlobalValue::ProtectedVisibility: Out  protected ; break;
 }
   }
 
@@ -914,6 +915,7 @@
   default: assert(0  Invalid visibility style!);
   case GlobalValue::DefaultVisibility: break;
   case GlobalValue::HiddenVisibility: Out  hidden ; break;
+  case GlobalValue::ProtectedVisibility: Out  protected ; break;
   }
 
   Out  alias ;
@@ -998,6 +1000,7 @@
 default: assert(0  Invalid visibility style!);
 case GlobalValue::DefaultVisibility: break;
 case GlobalValue::HiddenVisibility: Out  hidden ; break;
+case GlobalValue::ProtectedVisibility: Out  protected ; break;
 }
   }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] Persistent regression failures

2007-04-29 Thread me22
On 29/04/07, Chris Lattner [EMAIL PROTECTED] wrote:
 On Apr 29, 2007, at 8:09 AM, Jeff Cohen wrote:
  Two tests that broke yesterday are still broke:
 
  CFrontend/2007-04-11-InlineAsmStruct.c
  CFrontend/2007-04-11-InlineAsmUnion.c
 
 These both pass for me.  Three options: your CFE isn't up-to-date,
 the test is broken for your target, or the compiler is broken for
 your target.

I see them broken as well:

Running /home/me22/programming/llvm-cvs/test/CFrontend/dg.exp ...
FAIL: 
/home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11-InlineAsmStruct.c
Failed with exit(1) at line 1
while running: /usr/local/bin/llvm-gcc -emit-llvm
/home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11-InlineAsmStruct.c
-S -emit-llvm -o - | grep {call i32 asm}
child process exited abnormally
FAIL: /home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11-InlineAsmUnion.c
Failed with exit(1) at line 1
while running: /usr/local/bin/llvm-gcc -emit-llvm
/home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11-InlineAsmUnion.c
-S -emit-llvm -o - | grep {call i32 asm}
child process exited abnormally

~ Scott
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] Persistent regression failures

2007-04-29 Thread Anton Korobeynikov
Chris,

 These both pass for me.  Three options: your CFE isn't up-to-date,  
 the test is broken for your target, or the compiler is broken for  
 your target.
These two failed for me also. The resulting llvm IR (for Struct):

; ModuleID =
'/home/asl/proj/llvm/src/test/CFrontend/2007-04-11-InlineAsmStruct.c'
target datalayout =
e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64
target triple = i686-pc-linux-gnu
%struct.V = type { i16, i16 }

define i32 @bar() {
entry:
%retval = alloca i32, align 4   ; i32* [#uses=2]
%tmp = alloca i32, align 4  ; i32* [#uses=2]
%bar = alloca %struct.V, align 4; %struct.V*
[#uses=2]
alloca point = bitcast i32 0 to i32   ; i32
[#uses=0]
call void asm sideeffect foo $0\0A,
=*r,~{dirflag},~{fpsr},~{flags}( %struct.V* %bar )
%tmp1 = getelementptr %struct.V* %bar, i32 0, i32
0 ; i16* [#uses=1]
%tmp2 = load i16* %tmp1 ; i16 [#uses=1]
%tmp23 = sext i16 %tmp2 to i32  ; i32 [#uses=1]
store i32 %tmp23, i32* %tmp
%tmp4 = load i32* %tmp  ; i32 [#uses=1]
store i32 %tmp4, i32* %retval
br label %return

return: ; preds = %entry
%retval5 = load i32* %retval; i32 [#uses=1]
ret i32 %retval5
}

It seems, extra GEP was used to get result.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics  Mechanics, Saint Petersburg State University.


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/AcceptTestResults.php

2007-04-29 Thread Tanya Lattner


Changes in directory nightlytest-serverside:

AcceptTestResults.php added (r1.1)
---
Log message:

New accept test results script to populate new database.


---
Diffs of the changes:  (+552 -0)

 AcceptTestResults.php |  552 ++
 1 files changed, 552 insertions(+)


Index: nightlytest-serverside/AcceptTestResults.php
diff -c /dev/null nightlytest-serverside/AcceptTestResults.php:1.1
*** /dev/null   Sun Apr 29 13:56:37 2007
--- nightlytest-serverside/AcceptTestResults.phpSun Apr 29 13:56:27 2007
***
*** 0 
--- 1,552 
+ ?php
+ 
+ 
/***
+ *
+ * Debug info
+ *
+ 
***/
+ $print_debug = 0;
+ 
+ 
/***
+ * mysql describe machineInfo;
+ * +--+--+--+-+-++
+ * | Field| Type | Null | Key | Default | Extra  |
+ * +--+--+--+-+-++
+ * | id   | int(11)  |  | PRI | NULL| auto_increment |
+ * | targetTriple | tinytext |  | | ||
+ * | hostname | tinytext |  | | ||
+ * | nickname | tinytext |  | | ||
+ * +--+--+--+-+-++
+ * id = unqiue id assigned to machine
+ * targetTriple = llvm TARGET_TRIPLE value
+ * hostname = full hostname (ie. zion.llvm.org)
+ * nickname = short name (ie. zion)
+ *
+ * Returns id of machine and adds machine if it is not already in database.
+ 
***/
+ function getMachineID($targetTriple, $hostname, $nickname) {
+   $sqlQuery = SELECT id from machineInfo WHERE 
targetTriple=\$targetTriple\  
+. AND hostname=\$hostname\ AND nickname=\$nickname\;
+   $result = mysql_query($sqlQuery) or die(mysql_error());
+ 
+   $row = mysql_fetch_assoc($result);
+   
+   if($row) {
+ return $row['id']; 
+   }
+   else {
+ $sqlQuery = INSERT into machineInfo (targetTriple, hostname, nickname) 
VALUES 
+ . (\$targetTriple\, \$hostname\, \$nickname\);
+ mysql_query($sqlQuery) or die(mysql_error());
+ $id =  mysql_insert_id() or die(mysql_error());
+ return $id;
+   }
+ }
+ 
+ 
/***
+ * mysql describe testRunInfo;
+ * 
+---+---+--+-+-++
+ * | Field | Type  | Null | Key | 
Default | Extra  |
+ * 
+---+---+--+-+-++
+ * | id| int(11)   |  | PRI | NULL 
   | auto_increment |
+ * | runDateTime   | datetime  |  | | 
-00-00 00:00:00 ||
+ * | machineId | int(11)   |  | | 0
   ||
+ * | machineUname  | text  | YES  | | NULL 
   ||
+ * | gccVersion| text  | YES  | | NULL 
   ||
+ * | cvsCpuTime| double| YES  | | NULL 
   ||
+ * | cvsWallTime   | double| YES  | | NULL 
   ||
+ * | configureCpuTime  | double| YES  | | NULL 
   ||
+ * | configureWallTime | double| YES  | | NULL 
   ||
+ * | buildCpuTime  | double| YES  | | NULL 
   ||
+ * | buildWallTime | double| YES  | | NULL 
   ||
+ * | dejagnuCpuTime| double| YES  | | NULL 
   ||
+ * | dejagnuWallTime   | double| YES  | | NULL 
   ||
+ * | warnings  | mediumtext| YES  | | NULL 
   ||
+ * | warningsAdded | text  | YES  | | NULL 
   ||
+ * | warningsRemoved   | text  | YES  | | NULL 
   ||
+ * | cvsUsersAdd   | text  | YES  | | NULL 
   ||
+ * | cvsUsersCO| text  | YES 

[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

2007-04-29 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.438 - 1.439
---
Log message:

generalize aggregate handling


---
Diffs of the changes:  (+21 -5)

 SelectionDAGISel.cpp |   26 +-
 1 files changed, 21 insertions(+), 5 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.438 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.439
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.438Sat Apr 28 
16:12:06 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Sun Apr 29 13:58:03 2007
@@ -3248,12 +3248,28 @@
 if (OpInfo.CallOperandVal) {
   OpInfo.CallOperand = getValue(OpInfo.CallOperandVal);
   const Type *OpTy = OpInfo.CallOperandVal-getType();
-  if (!OpInfo.isIndirect) {
-// Must be an input.
-OpVT = TLI.getValueType(OpTy);
-  } else {
-OpVT = 
TLI.getValueType(castPointerType(OpTy)-getElementType(),true);
+  // If this is an indirect operand, the operand is a pointer to the
+  // accessed type.
+  if (OpInfo.isIndirect)
+OpTy = castPointerType(OpTy)-getElementType();
+  
+  // If OpTy is not a first-class value, it may be a struct/union that we
+  // can tile with integers.
+  if (!OpTy-isFirstClassType()  OpTy-isSized()) {
+unsigned BitSize = TD-getTypeSizeInBits(OpTy);
+switch (BitSize) {
+default: break;
+case 1:
+case 8:
+case 16:
+case 32:
+case 64:
+  OpTy = IntegerType::get(BitSize);
+  break;
+}
   }
+  
+  OpVT = TLI.getValueType(OpTy, true);
 }
 
 OpInfo.ConstraintVT = OpVT;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CFrontend/2007-04-11-InlineAsmStruct.c 2007-04-11-InlineAsmUnion.c

2007-04-29 Thread Chris Lattner


Changes in directory llvm/test/CFrontend:

2007-04-11-InlineAsmStruct.c updated: 1.2 - 1.3
2007-04-11-InlineAsmUnion.c updated: 1.4 - 1.5
---
Log message:

not all targets want to return an i32.  What really matters is whether llc 
accepts the generated code.


---
Diffs of the changes:  (+2 -2)

 2007-04-11-InlineAsmStruct.c |2 +-
 2007-04-11-InlineAsmUnion.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/test/CFrontend/2007-04-11-InlineAsmStruct.c
diff -u llvm/test/CFrontend/2007-04-11-InlineAsmStruct.c:1.2 
llvm/test/CFrontend/2007-04-11-InlineAsmStruct.c:1.3
--- llvm/test/CFrontend/2007-04-11-InlineAsmStruct.c:1.2Sun Apr 15 
15:08:37 2007
+++ llvm/test/CFrontend/2007-04-11-InlineAsmStruct.cSun Apr 29 13:59:01 2007
@@ -1,4 +1,4 @@
-// RUN: %llvmgcc %s -S -emit-llvm -o - | grep {call i32 asm}
+// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llc
 
 struct V { short X, Y; };
 int bar() {


Index: llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c
diff -u llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c:1.4 
llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c:1.5
--- llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c:1.4 Fri Apr 20 22:35:28 2007
+++ llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c Sun Apr 29 13:59:01 2007
@@ -1,4 +1,4 @@
-// RUN: %llvmgcc %s -S -emit-llvm -o - | grep {call i32 asm}
+// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llc
 
 union U { int x; float p; };
 void foo() {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] Persistent regression failures

2007-04-29 Thread Chris Lattner
 Running /home/me22/programming/llvm-cvs/test/CFrontend/dg.exp ...
 FAIL: /home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11- 
 InlineAsmStruct.c
 Failed with exit(1) at line 1
 while running: /usr/local/bin/llvm-gcc -emit-llvm
 /home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11- 
 InlineAsmStruct.c
 -S -emit-llvm -o - | grep {call i32 asm}
 child process exited abnormally
 FAIL: /home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11- 
 InlineAsmUnion.c
 Failed with exit(1) at line 1
 while running: /usr/local/bin/llvm-gcc -emit-llvm
 /home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11- 
 InlineAsmUnion.c
 -S -emit-llvm -o - | grep {call i32 asm}
 child process exited abnormally

It was a combination of multiple things, hopefully the tests should  
pass now, please let me know if they don't for you.

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.php

2007-04-29 Thread Tanya Lattner


Changes in directory nightlytest-serverside:

NightlyTestAccept.php updated: 1.62 - 1.63
---
Log message:

Including new accept script file, moved database connection to a function so 
its not global.


---
Diffs of the changes:  (+18 -20)

 NightlyTestAccept.php |   38 ++
 1 files changed, 18 insertions(+), 20 deletions(-)


Index: nightlytest-serverside/NightlyTestAccept.php
diff -u nightlytest-serverside/NightlyTestAccept.php:1.62 
nightlytest-serverside/NightlyTestAccept.php:1.63
--- nightlytest-serverside/NightlyTestAccept.php:1.62   Fri Apr 13 01:18:01 2007
+++ nightlytest-serverside/NightlyTestAccept.phpSun Apr 29 14:08:19 2007
@@ -70,29 +70,13 @@
   die();
 }
 
-if ($print_debug) {
-  print Support Included\n;
+if(!(includeAcceptTestResults.php)){
+  print Error: could not load necessary files!\n;
+  die();
 }
 
-/***
- *
- * Important variables
- *
- 
***/
-$database = nightlytestresults;
-$loginname = llvm;
-$password = ll2002vm;
-
-/***
- *
- * Connecting to the database
- *
- 
***/
-$mysql_link = mysql_connect(127.0.0.1, $loginname, $password) or die(Error: 
could not connect to database!);
-mysql_select_db($database) or die(Error: could not find \$database\ 
database!);
-
 if ($print_debug) {
-  print Database connected\n;
+  print Support Included\n;
 }
 
 
/***
@@ -482,6 +466,20 @@
  *
  
***/
 function acceptTest() {
+  
+  $database = nightlytestresults;
+  $loginname = llvm;
+  $password = ll2002vm;
+  
+  // connect to database
+  $mysql_link = mysql_connect(127.0.0.1, $loginname, $password) or 
die(Error: could not connect to database!);
+  mysql_select_db($database) or die(Error: could not find \$database\ 
database!);
+  
+  if ($print_debug) {
+print Database connected\n;
+  }
+  
+  
   if ($print_debug) {
 print Reading _POST Variables\n;
   }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] Persistent regression failures

2007-04-29 Thread Anton Korobeynikov
 It was a combination of multiple things, hopefully the tests should  
 pass now, please let me know if they don't for you.
They passed for me now.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics  Mechanics, Saint Petersburg State University.


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Bitcode/BitstreamReader.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/Bitcode:

BitstreamReader.h updated: 1.6 - 1.7
---
Log message:

add a method


---
Diffs of the changes:  (+6 -0)

 BitstreamReader.h |6 ++
 1 files changed, 6 insertions(+)


Index: llvm/include/llvm/Bitcode/BitstreamReader.h
diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.6 
llvm/include/llvm/Bitcode/BitstreamReader.h:1.7
--- llvm/include/llvm/Bitcode/BitstreamReader.h:1.6 Sun Apr 29 03:05:07 2007
+++ llvm/include/llvm/Bitcode/BitstreamReader.h Sun Apr 29 14:17:32 2007
@@ -72,6 +72,12 @@
   
   bool AtEndOfStream() const { return NextChar == LastChar; }
   
+  /// GetCurrentBitNo - Return the bit # of the bit we are reading.
+  uint64_t GetCurrentBitNo() const {
+return CurWord * 32ULL + (32-CurCodeSize);
+  }
+  
+  
   uint32_t Read(unsigned NumBits) {
 // If the field is fully contained by CurWord, return it quickly.
 if (BitsInCurWord = NumBits) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/TargetAsmInfo.h

2007-04-29 Thread Dale Johannesen


Changes in directory llvm/include/llvm/Target:

TargetAsmInfo.h updated: 1.30 - 1.31
---
Log message:

Make ARM-specific version of getInlineAsmLength


---
Diffs of the changes:  (+1 -1)

 TargetAsmInfo.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/Target/TargetAsmInfo.h
diff -u llvm/include/llvm/Target/TargetAsmInfo.h:1.30 
llvm/include/llvm/Target/TargetAsmInfo.h:1.31
--- llvm/include/llvm/Target/TargetAsmInfo.h:1.30   Sun Apr 29 13:35:00 2007
+++ llvm/include/llvm/Target/TargetAsmInfo.hSun Apr 29 14:17:45 2007
@@ -353,7 +353,7 @@
 
 /// Measure the specified inline asm to determine an approximation of its
 /// length.
-unsigned getInlineAsmLength(const char *Str) const;
+virtual unsigned getInlineAsmLength(const char *Str) const;
 
 /// ExpandInlineAsm - This hook allows the target to expand an inline asm
 /// call to be explicit llvm code if it wants to.  This is useful for



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetAsmInfo.h ARMTargetAsmInfo.cpp

2007-04-29 Thread Dale Johannesen


Changes in directory llvm/lib/Target/ARM:

ARMTargetAsmInfo.h updated: 1.2 - 1.3
ARMTargetAsmInfo.cpp updated: 1.15 - 1.16
---
Log message:

Make ARM-specific version of getInlineAsmLength


---
Diffs of the changes:  (+53 -0)

 ARMTargetAsmInfo.cpp |   51 +++
 ARMTargetAsmInfo.h   |2 ++
 2 files changed, 53 insertions(+)


Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.h
diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.h:1.2 
llvm/lib/Target/ARM/ARMTargetAsmInfo.h:1.3
--- llvm/lib/Target/ARM/ARMTargetAsmInfo.h:1.2  Mon Apr 23 15:04:35 2007
+++ llvm/lib/Target/ARM/ARMTargetAsmInfo.h  Sun Apr 29 14:17:45 2007
@@ -25,6 +25,8 @@
 ARMTargetAsmInfo(const ARMTargetMachine TM);
 
 bool isThumb;
+
+virtual unsigned getInlineAsmLength(const char *Str) const;
   };
 
 


Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp
diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.15 
llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.16
--- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.15   Fri Apr 27 08:54:47 2007
+++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cppSun Apr 29 14:17:45 2007
@@ -86,3 +86,54 @@
   LCOMMDirective = \t.lcomm\t;
   isThumb = Subtarget-isThumb();
 }
+
+/// ARM-specific version of TargetAsmInfo::getInlineAsmLength.
+unsigned ARMTargetAsmInfo::getInlineAsmLength(const char *Str) const {
+  // Count the number of bytes in the asm.
+  bool atInsnStart = true;
+  unsigned Length = 0;
+  for (; *Str; ++Str) {
+if (atInsnStart) {
+  // Skip whitespace
+  while (*Str  isspace(*Str)  *Str != '\n')
+Str++;
+  // Skip label
+  for (const char* p = Str; *p  !isspace(*p); p++)
+if (*p == ':') {
+  Str = p+1;
+  break;
+}
+  // Ignore everything from comment char(s) to EOL
+  if (strncmp(Str, CommentString, strlen(CommentString))==-0)
+atInsnStart = false;
+  else {
+// An instruction
+atInsnStart = false;
+if (isThumb) {
+  // BL and BLX non-reg are 4 bytes, all others 2.
+  const char*p = Str;
+  if ((*Str=='b' || *Str=='B') 
+  (*(Str+1)=='l' || *(Str+1)=='L')) {
+if (*(Str+2)=='x' || *(Str+2)=='X') {
+  const char* p = Str+3;
+  while (*p  isspace(*p))
+p++;
+  if (*p == 'r' || *p=='R')
+Length += 2;// BLX reg
+  else
+Length += 4;// BLX non-reg
+}
+else
+  Length += 4;// BL
+  } else
+Length += 2;// Thumb anything else
+}
+else
+  Length += 4;// ARM
+  }
+}
+if (*Str == '\n' || *Str == SeparatorChar)
+  atInsnStart = true;
+  }
+  return Length;
+}



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.cpp ARMConstantIslandPass.cpp

2007-04-29 Thread Dale Johannesen


Changes in directory llvm/lib/Target/ARM:

ARMInstrInfo.cpp updated: 1.22 - 1.23
ARMConstantIslandPass.cpp updated: 1.38 - 1.39
---
Log message:

Rewrite of Thumb constant islands handling (exact allowance for padding
around islands and jump tables).


---
Diffs of the changes:  (+226 -87)

 ARMConstantIslandPass.cpp |  306 +-
 ARMInstrInfo.cpp  |7 -
 2 files changed, 226 insertions(+), 87 deletions(-)


Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp
diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.22 
llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.23
--- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.22   Thu Apr 26 14:00:32 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.cppSun Apr 29 14:19:30 2007
@@ -469,12 +469,13 @@
   assert(JTI  JT.size());
   // Thumb instructions are 2 byte aligned, but JT entries are 4 byte
   // 4 aligned. The assembler / linker may add 2 byte padding just before
-  // the JT entries. Use + 4 even for tBR_JTr to purposely over-estimate
-  // the size the jumptable.
+  // the JT entries.  The size does not include this padding; the
+  // constant islands pass does separate bookkeeping for it.
   // FIXME: If we know the size of the function is less than (1  16) *2
   // bytes, we can use 16-bit entries instead. Then there won't be an
   // alignment issue.
-  return getNumJTEntries(JT, JTI) * 4 + 4;
+  return getNumJTEntries(JT, JTI) * 4 + 
+ (MI-getOpcode()==ARM::tBR_JTr ? 2 : 4);
 }
 default:
   // Otherwise, pseudo-instruction sizes are zero.


Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.38 
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.39
--- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.38  Fri Apr 27 13:27:13 2007
+++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp   Sun Apr 29 14:19:30 2007
@@ -51,10 +51,14 @@
 unsigned NextUID;
 
 /// BBSizes - The size of each MachineBasicBlock in bytes of code, indexed
-/// by MBB Number.
+/// by MBB Number.  The two-byte pads required for Thumb alignment are
+/// counted as part of the following block (i.e., the offset and size for
+/// a padded block will both be ==2 mod 4).
 std::vectorunsigned BBSizes;
 
 /// BBOffsets - the offset of each MBB in bytes, starting from 0.
+/// The two-byte pads required for Thumb alignment are counted as part of
+/// the following block.
 std::vectorunsigned BBOffsets;
 
 /// WaterList - A sorted list of basic blocks where islands could be placed
@@ -121,6 +125,7 @@
 bool HasFarJump;
 
 const TargetInstrInfo *TII;
+ARMFunctionInfo *AFI;
 bool isThumb;
   public:
 virtual bool runOnMachineFunction(MachineFunction Fn);
@@ -140,8 +145,10 @@
 void AdjustBBOffsetsAfter(MachineBasicBlock *BB, int delta);
 bool DecrementOldEntry(unsigned CPI, MachineInstr* CPEMI);
 int LookForExistingCPEntry(CPUser U, unsigned UserOffset);
-bool LookForWater(CPUserU, unsigned UserOffset, bool* PadNewWater,
+bool LookForWater(CPUserU, unsigned UserOffset, 
   MachineBasicBlock** NewMBB);
+MachineBasicBlock* AcceptWater(MachineBasicBlock *WaterBB, 
+std::vectorMachineBasicBlock*::iterator IP);
 void CreateNewWater(unsigned CPUserIndex, unsigned UserOffset,
   MachineBasicBlock** NewMBB);
 bool HandleConstantPoolUser(MachineFunction Fn, unsigned CPUserIndex);
@@ -161,9 +168,38 @@
 bool UndoLRSpillRestore();
 
 unsigned GetOffsetOf(MachineInstr *MI) const;
+void dumpBBs();
+void verify(MachineFunction Fn);
   };
 }
 
+/// verify - check BBOffsets, BBSizes, alignment of islands
+void ARMConstantIslands::verify(MachineFunction Fn) {
+  assert(BBOffsets.size() == BBSizes.size());
+  for (unsigned i = 1, e = BBOffsets.size(); i != e; ++i)
+assert(BBOffsets[i-1]+BBSizes[i-1] == BBOffsets[i]);
+  if (isThumb) {
+for (MachineFunction::iterator MBBI = Fn.begin(), E = Fn.end();
+ MBBI != E; ++MBBI) {
+  MachineBasicBlock *MBB = MBBI;
+  if (!MBB-empty() 
+  MBB-begin()-getOpcode() == ARM::CONSTPOOL_ENTRY)
+assert((BBOffsets[MBB-getNumber()]%4 == 0 
+BBSizes[MBB-getNumber()]%4 == 0) ||
+   (BBOffsets[MBB-getNumber()]%4 != 0 
+BBSizes[MBB-getNumber()]%4 != 0));
+}
+  }
+}
+
+/// print block size and offset information - debugging
+void ARMConstantIslands::dumpBBs() {
+  for (unsigned J = 0, E = BBOffsets.size(); J !=E; ++J) {
+DOUT  block  J   offset  BBOffsets[J]  
+ size  BBSizes[J]  \n;
+  }
+}
+
 /// createARMConstantIslandPass - returns an instance of the constpool
 /// island pass.
 FunctionPass *llvm::createARMConstantIslandPass() {
@@ -172,9 +208,9 @@
 
 bool ARMConstantIslands::runOnMachineFunction(MachineFunction Fn) {
   MachineConstantPool MCP = 

[llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.php

2007-04-29 Thread Tanya Lattner


Changes in directory nightlytest-serverside:

NightlyTestAccept.php updated: 1.63 - 1.64
---
Log message:

Renaming functions.


---
Diffs of the changes:  (+18 -17)

 NightlyTestAccept.php |   35 ++-
 1 files changed, 18 insertions(+), 17 deletions(-)


Index: nightlytest-serverside/NightlyTestAccept.php
diff -u nightlytest-serverside/NightlyTestAccept.php:1.63 
nightlytest-serverside/NightlyTestAccept.php:1.64
--- nightlytest-serverside/NightlyTestAccept.php:1.63   Sun Apr 29 14:08:19 2007
+++ nightlytest-serverside/NightlyTestAccept.phpSun Apr 29 14:22:27 2007
@@ -168,7 +168,7 @@
  * Returns the id number of the machine with the passed in uname
  *
  
***/
-function GetMachineId($uname, $hardware, $os, $name, $nickname, $gcc_version) {
+function GetMachineIdNum($uname, $hardware, $os, $name, $nickname, 
$gcc_version) {
   $query = SELECT * FROM machine WHERE uname=\$uname\ AND 
hardware=\$hardware\ AND nickname=\$nickname\ AND gcc=\$gcc_version\;
   $machine_query = mysql_query($query) or die(mysql_error());
   $row = mysql_fetch_assoc($machine_query);
@@ -408,7 +408,7 @@
  * Match one substring and return string result.
  *
  
***/
-function MatchOne($pattern, $string, $default) {
+function MatchOnePattern($pattern, $string, $default) {
   $subpatterns = array();
   if (isset($string)  preg_match($pattern, $string, $subpatterns)) {
 return rtrim($subpatterns[1]);
@@ -422,7 +422,7 @@
  * Match all substrings and return array result.
  *
  
***/
-function Match($pattern, $string) {
+function MatchPattern($pattern, $string) {
   $subpatterns = array();
   if (isset($string)  preg_match($pattern, $string, $subpatterns)) {
 return $subpatterns;
@@ -590,12 +590,12 @@
* Extracting the machine information
*

***/
-  $uname= MatchOne(/uname\:\s*(.+)/,$MACHINE_DATA[0], );
-  $hardware = MatchOne(/hardware\:\s*(.+)/, $MACHINE_DATA[1], );
-  $os   = MatchOne(/os\:\s*(.+)/,   $MACHINE_DATA[2], );
-  $name = MatchOne(/name\:\s*(.+)/, $MACHINE_DATA[3], );
-  $date = MatchOne(/date\:\s*(.+)/, $MACHINE_DATA[4], );
-  $time = MatchOne(/time\:\s*(.+)/, $MACHINE_DATA[5], );
+  $uname= MatchOnePattern(/uname\:\s*(.+)/,$MACHINE_DATA[0], );
+  $hardware = MatchOnePattern(/hardware\:\s*(.+)/, $MACHINE_DATA[1], );
+  $os   = MatchOnePattern(/os\:\s*(.+)/,   $MACHINE_DATA[2], );
+  $name = MatchOnePattern(/name\:\s*(.+)/, $MACHINE_DATA[3], );
+  $date = MatchOnePattern(/date\:\s*(.+)/, $MACHINE_DATA[4], );
+  $time = MatchOnePattern(/time\:\s*(.+)/, $MACHINE_DATA[5], );
 
   if ($print_debug) {
 print uname: $uname\n;
@@ -612,9 +612,9 @@
*

***/
 
-  $dejagnu_exp_passes = MatchOne(/\# of expected passes\s*([0-9]+)/,   
$dejagnutests_log, 0);
-  $dejagnu_unexp_failures = MatchOne(/unexpected failures\s*([0-9]+)/, 
$dejagnutests_log, 0);
-  $dejagnu_exp_failures   = MatchOne(/\# of expected failures\s*([0-9]+)/, 
$dejagnutests_log, 0);
+  $dejagnu_exp_passes = MatchOnePattern(/\# of expected 
passes\s*([0-9]+)/,   $dejagnutests_log, 0);
+  $dejagnu_unexp_failures = MatchOnePattern(/unexpected 
failures\s*([0-9]+)/, $dejagnutests_log, 0);
+  $dejagnu_exp_failures   = MatchOnePattern(/\# of expected 
failures\s*([0-9]+)/, $dejagnutests_log, 0);
 
   if ($print_debug) {
 print dejagnu_exp_passes: $dejagnu_exp_passes\n;
@@ -649,7 +649,7 @@
   if (!DoesMachineExist($uname, $hardware, $os, $name, $nickname, 
$gcc_version)) {
 AddMachine($uname, $hardware, $os, $name, $nickname, $gcc_version, test);
   }
-  $machine_id = GetMachineId($uname, $hardware, $os, $name, $nickname, 
$gcc_version);
+  $machine_id = GetMachineIdNum($uname, $hardware, $os, $name, $nickname, 
$gcc_version);
 
   if ($print_debug) {
 print machine_id: $machine_id\n;
@@ -696,7 +696,7 @@
   }
 
   foreach ($O_FILE_SIZE as $info) {
-list($ignore, $size, $file, $type) = Match(/(.+)\s+(.+)\s+(.+)/, $info);
+list($ignore, $size, $file, $type) = MatchPattern(/(.+)\s+(.+)\s+(.+)/, 
$info);
 AddFile($file, $size, $night_id, $type);
   }
 
@@ -706,7 +706,7 @@
   }
 
   foreach ($A_FILE_SIZE as $info) {
-list($ignore, $size, $file, $type) = Match(/(.+)\s+(.+)\s+(.+)/, $info);
+list($ignore, $size, $file, $type) = MatchPattern(/(.+)\s+(.+)\s+(.+)/, 
$info);
 AddFile($file, $size, $night_id, $type);
   }
 
@@ -839,8 +839,8 @@
 
 // put measures into hash of arrays
 foreach ($monitoring as $measure) {
-  $value_new = MatchOne(/(\d+\.?\d*)/, $new_measures[$measure], );
-  $value_old = 

[llvm-commits] CVS: llvm/include/llvm/Bitcode/BitstreamReader.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/Bitcode:

BitstreamReader.h updated: 1.7 - 1.8
---
Log message:

compute this value correctly


---
Diffs of the changes:  (+4 -2)

 BitstreamReader.h |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/Bitcode/BitstreamReader.h
diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.7 
llvm/include/llvm/Bitcode/BitstreamReader.h:1.8
--- llvm/include/llvm/Bitcode/BitstreamReader.h:1.7 Sun Apr 29 14:17:32 2007
+++ llvm/include/llvm/Bitcode/BitstreamReader.h Sun Apr 29 14:49:58 2007
@@ -48,9 +48,11 @@
   /// BlockScope - This tracks the codesize of parent blocks.
   SmallVectorBlock, 8 BlockScope;
 
+  /// FirstChar - This remembers the first byte of the stream.
+  const unsigned char *FirstChar;
 public:
   BitstreamReader(const unsigned char *Start, const unsigned char *End)
-: NextChar(Start), LastChar(End) {
+: NextChar(Start), LastChar(End), FirstChar(Start) {
 assert(((End-Start)  3) == 0 Bitcode stream not a multiple of 4 
bytes);
 CurWord = 0;
 BitsInCurWord = 0;
@@ -74,7 +76,7 @@
   
   /// GetCurrentBitNo - Return the bit # of the bit we are reading.
   uint64_t GetCurrentBitNo() const {
-return CurWord * 32ULL + (32-CurCodeSize);
+return (NextChar-FirstChar)*8 + (32-BitsInCurWord);
   }
   
   



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp

2007-04-29 Thread Chris Lattner


Changes in directory llvm/tools/llvm-bcanalyzer:

llvm-bcanalyzer.cpp updated: 1.13 - 1.14
---
Log message:

add some simple per-block statistics



---
Diffs of the changes:  (+104 -8)

 llvm-bcanalyzer.cpp |  112 
 1 files changed, 104 insertions(+), 8 deletions(-)


Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.13 
llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.14
--- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.13 Sun Apr 29 03:31:14 2007
+++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp  Sun Apr 29 15:00:02 2007
@@ -32,6 +32,7 @@
 
 #include llvm/Analysis/Verifier.h
 #include llvm/Bitcode/BitstreamReader.h
+#include llvm/Bitcode/LLVMBitCodes.h
 #include llvm/Bytecode/Analyzer.h
 #include llvm/Support/CommandLine.h
 #include llvm/Support/Compressor.h
@@ -65,6 +66,50 @@
   LLVMIRBitstream
 } CurStreamType;
 
+
+/// GetBlockName - Return a symbolic block name if known, otherwise return
+/// empty.
+static const char *GetBlockName(unsigned BlockID) {
+  if (CurStreamType != LLVMIRBitstream) return ;
+  
+  switch (BlockID) {
+  default:  return unknown LLVM IR block ID;
+  case bitc::MODULE_BLOCK_ID:   return MODULE_BLOCK;
+  case bitc::TYPE_BLOCK_ID: return TYPE_BLOCK;
+  case bitc::CONSTANTS_BLOCK_ID:return CONSTANTS_BLOCK;
+  case bitc::FUNCTION_BLOCK_ID: return FUNCTION_BLOCK;
+  case bitc::TYPE_SYMTAB_BLOCK_ID:  return TYPE_SYMTAB;
+  case bitc::VALUE_SYMTAB_BLOCK_ID: return VALUE_SYMTAB;
+  }
+}
+
+
+struct PerBlockIDStats {
+  /// NumInstances - This the number of times this block ID has been seen.
+  unsigned NumInstances;
+  
+  /// NumBits - The total size in bits of all of these blocks.
+  uint64_t NumBits;
+  
+  /// NumSubBlocks - The total number of blocks these blocks contain.
+  unsigned NumSubBlocks;
+  
+  /// NumAbbrevs - The total number of abbreviations.
+  unsigned NumAbbrevs;
+  
+  /// NumRecords - The total number of records these blocks contain, and the 
+  /// number that are abbreviated.
+  unsigned NumRecords, NumAbbreviatedRecords;
+  
+  PerBlockIDStats()
+: NumInstances(0), NumBits(0),
+  NumSubBlocks(0), NumAbbrevs(0), NumRecords(0), NumAbbreviatedRecords(0) 
{}
+};
+
+static std::mapunsigned, PerBlockIDStats BlockIDStats;
+
+
+
 /// Error - All bitcode analysis errors go through this function, making this a
 /// good place to breakpoint if debugging.
 static bool Error(const std::string Err) {
@@ -74,10 +119,14 @@
 
 /// ParseBlock - Read a block, updating statistics, etc.
 static bool ParseBlock(BitstreamReader Stream) {
+  uint64_t BlockBitStart = Stream.GetCurrentBitNo();
+  
   unsigned BlockID = Stream.ReadSubBlockID();
   
-  // TODO: Compute per-block-id stats.
-  BlockID = BlockID;
+  // Get the statistics for this BlockID.
+  PerBlockIDStats BlockStats = BlockIDStats[BlockID];
+  
+  BlockStats.NumInstances++;
   
   if (Stream.EnterSubBlock())
 return Error(Malformed block record);
@@ -92,18 +141,27 @@
 // Read the code for this record.
 unsigned AbbrevID = Stream.ReadCode();
 switch (AbbrevID) {
-case bitc::END_BLOCK:
+case bitc::END_BLOCK: {
   if (Stream.ReadBlockEnd())
 return Error(Error at end of block);
+  uint64_t BlockBitEnd = Stream.GetCurrentBitNo();
+  BlockStats.NumBits += BlockBitEnd-BlockBitStart;
   return false;
+} 
 case bitc::ENTER_SUBBLOCK:
   if (ParseBlock(Stream))
 return true;
+  ++BlockStats.NumSubBlocks;
   break;
 case bitc::DEFINE_ABBREV:
   Stream.ReadAbbrevRecord();
+  ++BlockStats.NumAbbrevs;
   break;
 default:
+  ++BlockStats.NumRecords;
+  if (AbbrevID != bitc::UNABBREV_RECORD)
+++BlockStats.NumAbbreviatedRecords;
+  
   Record.clear();
   unsigned Code = Stream.ReadRecord(AbbrevID, Record);
   // TODO: Compute per-blockid/code stats.
@@ -113,6 +171,11 @@
   }
 }
 
+static void PrintSize(double Bits) {
+  std::cerr  Bits  b/  Bits/8  B/  Bits/32  W;
+}
+
+
 /// AnalyzeBitcode - Analyze the bitcode file specified by InputFilename.
 static int AnalyzeBitcode() {
   // Read the input file.
@@ -148,6 +211,8 @@
   Signature[4] == 0xE  Signature[5] == 0xD)
 CurStreamType = LLVMIRBitstream;
 
+  unsigned NumTopBlocks = 0;
+  
   // Parse the top-level structure.  We only allow blocks at the top-level.
   while (!Stream.AtEndOfStream()) {
 unsigned Code = Stream.ReadCode();
@@ -156,20 +221,51 @@
 
 if (ParseBlock(Stream))
   return true;
+++NumTopBlocks;
   }
   
   // Print a summary of the read file.
-  
   std::cerr  Summary of   InputFilename  :\n;
-  std::cerrStream type: ;
+  std::cerr   Total size: ;
+  PrintSize(Buffer-getBufferSize()*8);
+  std::cerr  \n;
+  std::cerr  Stream type: ;
   switch (CurStreamType) {
   default: assert(0  Unknown bitstream type);
   case 

[llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/lib/Bitcode/Reader:

BitcodeReader.cpp updated: 1.16 - 1.17
---
Log message:

Implement visibility checking during linking. Also implement protected 
visibility support for bitcode.


---
Diffs of the changes:  (+1 -0)

 BitcodeReader.cpp |1 +
 1 files changed, 1 insertion(+)


Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.16 
llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.17
--- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.16  Sun Apr 29 02:54:31 2007
+++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp   Sun Apr 29 15:56:48 2007
@@ -59,6 +59,7 @@
   default: // Map unknown visibilities to default.
   case 0: return GlobalValue::DefaultVisibility;
   case 1: return GlobalValue::HiddenVisibility;
+  case 2: return GlobalValue::ProtectedVisibility;
   }
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/lib/Bitcode/Writer:

BitcodeWriter.cpp updated: 1.15 - 1.16
---
Log message:

Implement visibility checking during linking. Also implement protected 
visibility support for bitcode.


---
Diffs of the changes:  (+3 -2)

 BitcodeWriter.cpp |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.15 
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.16
--- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.15  Sun Apr 29 00:49:09 2007
+++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp   Sun Apr 29 15:56:48 2007
@@ -187,8 +187,9 @@
 static unsigned getEncodedVisibility(const GlobalValue *GV) {
   switch (GV-getVisibility()) {
   default: assert(0  Invalid visibility!);
-  case GlobalValue::DefaultVisibility: return 0;
-  case GlobalValue::HiddenVisibility:  return 1;
+  case GlobalValue::DefaultVisibility:   return 0;
+  case GlobalValue::HiddenVisibility:return 1;
+  case GlobalValue::ProtectedVisibility: return 2;
   }
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp

2007-04-29 Thread Anton Korobeynikov


Changes in directory llvm/lib/Linker:

LinkModules.cpp updated: 1.139 - 1.140
---
Log message:

Implement visibility checking during linking. Also implement protected 
visibility support for bitcode.


---
Diffs of the changes:  (+14 -1)

 LinkModules.cpp |   15 ++-
 1 files changed, 14 insertions(+), 1 deletion(-)


Index: llvm/lib/Linker/LinkModules.cpp
diff -u llvm/lib/Linker/LinkModules.cpp:1.139 
llvm/lib/Linker/LinkModules.cpp:1.140
--- llvm/lib/Linker/LinkModules.cpp:1.139   Thu Apr 12 13:32:50 2007
+++ llvm/lib/Linker/LinkModules.cpp Sun Apr 29 15:56:48 2007
@@ -365,7 +365,9 @@
 /// the result will look like in the destination module.  In particular, it
 /// computes the resultant linkage type, computes whether the global in the
 /// source should be copied over to the destination (replacing the existing
-/// one), and computes whether this linkage is an error or not.
+/// one), and computes whether this linkage is an error or not. It also 
performs
+/// visibility checks: we cannot link together two symbols with different
+/// visibilities.
 static bool GetLinkageResult(GlobalValue *Dest, GlobalValue *Src,
  GlobalValue::LinkageTypes LT, bool LinkFromSrc,
  std::string *Err) {
@@ -435,6 +437,11 @@
 return Error(Err, Linking globals named ' + Src-getName() +
  ': symbol multiply defined!);
   }
+
+  // Check visibility
+  if (Dest  Src-getVisibility() != Dest-getVisibility())
+return Error(Err, Linking globals named ' + Src-getName() +
+ ': symbols have different visibilities!);
   return false;
 }
 
@@ -617,6 +624,12 @@
 RecursiveResolveTypes(SF-getType(), DF-getType(), 
   Dest-getTypeSymbolTable(), );
 }
+
+// Check visibility
+if (DF  !DF-hasInternalLinkage() 
+SF-getVisibility() != DF-getVisibility())
+  return Error(Err, Linking functions named ' + SF-getName() +
+   ': symbols have different visibilities!);
 
 if (DF  DF-getType() != SF-getType()) {
   if (DF-isDeclaration()  !SF-isDeclaration()) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.php

2007-04-29 Thread Tanya Lattner


Changes in directory nightlytest-serverside:

NightlyTestAccept.php updated: 1.64 - 1.65
---
Log message:

Enable new database.


---
Diffs of the changes:  (+1 -1)

 NightlyTestAccept.php |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: nightlytest-serverside/NightlyTestAccept.php
diff -u nightlytest-serverside/NightlyTestAccept.php:1.64 
nightlytest-serverside/NightlyTestAccept.php:1.65
--- nightlytest-serverside/NightlyTestAccept.php:1.64   Sun Apr 29 14:22:27 2007
+++ nightlytest-serverside/NightlyTestAccept.phpSun Apr 29 16:10:32 2007
@@ -979,5 +979,5 @@
 }
 
 acceptTest();
-//acceptTestResults();
+acceptTestResults();
 ?



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] llvm-gcc mirror update delayed again

2007-04-29 Thread Bill Wendling
On Apr 29, 2007, at 7:24 AM, Reid Spencer wrote:

 On Sun, 29 Apr 2007 07:11:45 -0700
  Jeff Cohen [EMAIL PROTECTED] wrote:
 It happened again last night.  According to the log:

 - 
 ---
 r319 | bwendlin | 2007-04-29 02:04:05 -0700 (Sun, 29 Apr 2007) | 1  
 line

 auto-merge 2007-04-29T02:00:00-0700
 - 
 ---

 it updated at 2am.  But my nightly tester at 3am did not pull in 319,
 only 318 (which it failed to pull in the previous night).  But  
 updating
 now pulls in 319.

 As I suspected, I think those times are bogus :)


 So when is the mirror updated? If not 2am, why does the log show 2am?
 If it is 2am, then how does an update an hour later fail to see it?

 Bill needs to answer those questions.

I'll need to check, but the process seems to be two-step (I inherited  
it from Jim L., so I'm not up on all of the fine details). My  
understanding is that there's a merge script that's run at 2AM every  
night. That's why you get the auto-merge messages with that  
timestamp. It's from there that another script (which I don't  
control) does an rsync with the external tree. That one might be  
coming later in the day.

This is yet one more reason why going to the single SVN repository  
will be *so* welcome. We won't have these types of errors again.

 And
 why does there have to be a mirror in the first place?  Why can't  
 you do
 your commits directly to a publicly accessible repository?  What  
 benefit
 is there to keeping the code under wraps for less than 24 hours?

There is no benefit. In fact, it's a needless pain in the ass. :-)

 Jeff, we all suffer this frustration. If we could change it, it  
 would be better by now.  It is the way it is because of how Apple  
 has organized their internal repository. llvm-gcc is comingled with  
 Apple GCC and that repository isn't accessible outside Apple.  
 Consequently, the mirror allows llvm-gcc to be accessible by the  
 community without providing access to the rest of Apple GCC (or  
 something like that, I'm vague on the details).

 We would have a fully commitable llvm-gcc repository under  
 Subversion by now if we were cut over, but we're not. Because  
 there's a lot going on in the community right now, we've put off  
 the SVN migration until June. So, a few more weeks of patience and  
 things should get much better in this regard.

I agree. It's a growing pain. Please be patient. An alternative is to  
take the SVN messages posted here and update your llvm-gcc repository  
yourself. In truth, the number of changes to the llvm-gcc rep. aren't  
nearly the number that goes into LLVM proper, so the amount of pain  
it takes to merge in the patches by hand isn't as great. And it would  
only be for another month. :-)

-bw

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs

2007-04-29 Thread Bill Wendling
On Apr 29, 2007, at 7:47 AM, Jeff Cohen wrote:

 Jeff Cohen wrote:
 Changes in directory llvm/lib/AsmParser:

 llvmAsmParser.cpp.cvs updated: 1.95 - 1.96
 llvmAsmParser.h.cvs updated: 1.73 - 1.74
 ---
 Log message:

 Fix MemoryBuffer breakage correctly.

 ---
 Diffs of the changes:  (+1404 -1627)

  llvmAsmParser.cpp.cvs | 3002 ++ 
 +---
  llvmAsmParser.h.cvs   |   29
  2 files changed, 1404 insertions(+), 1627 deletions(-)


 Ugh...  No, I did not change AsmParser.y.  But as these files got
 modified by design anyway, I'm not going to spend the effort to
 unmodify them.  At least it'll prevent a conflicted update (for me
 anyway) in the future.

Huh? If you didn't modify them, you should revert them in CVS. If  
they're marked as modified in your tree, try removing them and re- 
checking them out of the CVS repository.

-bw

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp

2007-04-29 Thread Chris Lattner


Changes in directory llvm/tools/llvm-bcanalyzer:

llvm-bcanalyzer.cpp updated: 1.14 - 1.15
---
Log message:

Implement much expanded dumper support.  We now print stuff like:

MODULE_BLOCK NumWords=27 BlockCodeSize=3
  TYPE_BLOCK NumWords=7 BlockCodeSize=4
NUMENTRY op0=7
POINTER op0=1
FUNCTION op0=0 op1=2 op2=2 op3=2 op4=2
VECTOR op0=2 op1=3
INTEGER op0=64
VECTOR op0=8 op1=5
INTEGER op0=16
VOID
...

With work, the operands can be pretty printed symbolically.



---
Diffs of the changes:  (+158 -12)

 llvm-bcanalyzer.cpp |  170 
 1 files changed, 158 insertions(+), 12 deletions(-)


Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.14 
llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.15
--- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.14 Sun Apr 29 15:00:02 2007
+++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp  Sun Apr 29 16:48:19 2007
@@ -59,6 +59,11 @@
 
 static cl::optbool Bitcode(bitcode, cl::desc(Read a bitcode file));
 
+static cl::optbool
+NonSymbolic(non-symbolic,
+cl::desc(Emit numberic info in dump even if
+  symbolic info is available));
+
 /// CurStreamType - If we can sniff the flavor of this stream, we can produce 
 /// better dump info.
 static enum {
@@ -68,12 +73,12 @@
 
 
 /// GetBlockName - Return a symbolic block name if known, otherwise return
-/// empty.
+/// null.
 static const char *GetBlockName(unsigned BlockID) {
-  if (CurStreamType != LLVMIRBitstream) return ;
+  if (CurStreamType != LLVMIRBitstream) return 0;
   
   switch (BlockID) {
-  default:  return unknown LLVM IR block ID;
+  default:  return 0;
   case bitc::MODULE_BLOCK_ID:   return MODULE_BLOCK;
   case bitc::TYPE_BLOCK_ID: return TYPE_BLOCK;
   case bitc::CONSTANTS_BLOCK_ID:return CONSTANTS_BLOCK;
@@ -83,6 +88,106 @@
   }
 }
 
+/// GetCodeName - Return a symbolic code name if known, otherwise return
+/// null.
+static const char *GetCodeName(unsigned CodeID, unsigned BlockID) {
+  if (CurStreamType != LLVMIRBitstream) return 0;
+  
+  switch (BlockID) {
+  default: return 0;
+  case bitc::MODULE_BLOCK_ID:
+switch (CodeID) {
+default: return 0;
+case bitc::MODULE_CODE_VERSION: return VERSION;
+case bitc::MODULE_CODE_TRIPLE:  return TRIPLE;
+case bitc::MODULE_CODE_DATALAYOUT:  return DATALAYOUT;
+case bitc::MODULE_CODE_ASM: return ASM;
+case bitc::MODULE_CODE_SECTIONNAME: return SECTIONNAME;
+case bitc::MODULE_CODE_DEPLIB:  return DEPLIB;
+case bitc::MODULE_CODE_GLOBALVAR:   return GLOBALVAR;
+case bitc::MODULE_CODE_FUNCTION:return FUNCTION;
+case bitc::MODULE_CODE_ALIAS:   return ALIAS;
+case bitc::MODULE_CODE_PURGEVALS:   return PURGEVALS;
+}
+  case bitc::TYPE_BLOCK_ID:
+switch (CodeID) {
+default: return 0;
+case bitc::TYPE_CODE_NUMENTRY: return NUMENTRY;
+case bitc::TYPE_CODE_META: return META;
+case bitc::TYPE_CODE_VOID: return VOID;
+case bitc::TYPE_CODE_FLOAT:return FLOAT;
+case bitc::TYPE_CODE_DOUBLE:   return DOUBLE;
+case bitc::TYPE_CODE_LABEL:return LABEL;
+case bitc::TYPE_CODE_OPAQUE:   return OPAQUE;
+case bitc::TYPE_CODE_INTEGER:  return INTEGER;
+case bitc::TYPE_CODE_POINTER:  return POINTER;
+case bitc::TYPE_CODE_FUNCTION: return FUNCTION;
+case bitc::TYPE_CODE_STRUCT:   return STRUCT;
+case bitc::TYPE_CODE_ARRAY:return ARRAY;
+case bitc::TYPE_CODE_VECTOR:   return VECTOR;
+}
+
+  case bitc::CONSTANTS_BLOCK_ID:
+switch (CodeID) {
+default: return 0;
+case bitc::CST_CODE_SETTYPE:   return SETTYPE;
+case bitc::CST_CODE_NULL:  return NULL;
+case bitc::CST_CODE_UNDEF: return UNDEF;
+case bitc::CST_CODE_INTEGER:   return INTEGER;
+case bitc::CST_CODE_WIDE_INTEGER:  return WIDE_INTEGER;
+case bitc::CST_CODE_FLOAT: return FLOAT;
+case bitc::CST_CODE_AGGREGATE: return AGGREGATE;
+case bitc::CST_CODE_CE_BINOP:  return CE_BINOP;
+case bitc::CST_CODE_CE_CAST:   return CE_CAST;
+case bitc::CST_CODE_CE_GEP:return CE_GEP;
+case bitc::CST_CODE_CE_SELECT: return CE_SELECT;
+case bitc::CST_CODE_CE_EXTRACTELT: return CE_EXTRACTELT;
+case bitc::CST_CODE_CE_INSERTELT:  return CE_INSERTELT;
+case bitc::CST_CODE_CE_SHUFFLEVEC: return CE_SHUFFLEVEC;
+case bitc::CST_CODE_CE_CMP:return CE_CMP;
+}
+  case bitc::FUNCTION_BLOCK_ID:
+switch (CodeID) {
+default: return 0;
+case bitc::FUNC_CODE_DECLAREBLOCKS: return DECLAREBLOCKS;
+
+case bitc::FUNC_CODE_INST_BINOP:   return INST_BINOP;
+case bitc::FUNC_CODE_INST_CAST:return INST_CAST;
+case bitc::FUNC_CODE_INST_GEP: return INST_GEP;
+case bitc::FUNC_CODE_INST_SELECT:  

[llvm-commits] CVS: llvm/include/llvm/Bitcode/BitstreamReader.h LLVMBitCodes.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/Bitcode:

BitstreamReader.h updated: 1.8 - 1.9
LLVMBitCodes.h updated: 1.8 - 1.9
---
Log message:

add some helpers


---
Diffs of the changes:  (+5 -2)

 BitstreamReader.h |5 -
 LLVMBitCodes.h|2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/Bitcode/BitstreamReader.h
diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.8 
llvm/include/llvm/Bitcode/BitstreamReader.h:1.9
--- llvm/include/llvm/Bitcode/BitstreamReader.h:1.8 Sun Apr 29 14:49:58 2007
+++ llvm/include/llvm/Bitcode/BitstreamReader.h Sun Apr 29 16:49:05 2007
@@ -79,6 +79,8 @@
 return (NextChar-FirstChar)*8 + (32-BitsInCurWord);
   }
   
+  /// GetAbbrevIDWidth - Return the number of bits used to encode an abbrev #.
+  unsigned GetAbbrevIDWidth() const { return CurCodeSize; }
   
   uint32_t Read(unsigned NumBits) {
 // If the field is fully contained by CurWord, return it quickly.
@@ -205,7 +207,7 @@
   
   /// EnterSubBlock - Having read the ENTER_SUBBLOCK abbrevid, read and enter
   /// the block, returning the BlockID of the block we just entered.
-  bool EnterSubBlock() {
+  bool EnterSubBlock(unsigned *NumWordsP = 0) {
 BlockScope.push_back(Block(CurCodeSize));
 BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
 
@@ -213,6 +215,7 @@
 CurCodeSize = ReadVBR(bitc::CodeLenWidth);
 SkipToWord();
 unsigned NumWords = Read(bitc::BlockSizeWidth);
+if (NumWordsP) *NumWordsP = NumWords;
 
 // Validate that this block is sane.
 if (CurCodeSize == 0 || AtEndOfStream() || NextChar+NumWords*4  LastChar)


Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h
diff -u llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.8 
llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.9
--- llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.8Thu Apr 26 00:53:04 2007
+++ llvm/include/llvm/Bitcode/LLVMBitCodes.hSun Apr 29 16:49:05 2007
@@ -92,7 +92,7 @@
   
   // The constants block (CONSTANTS_BLOCK_ID) describes emission for each
   // constant and maintains an implicit current type value.
-  enum ConstantsSymtabCodes {
+  enum ConstantsCodes {
 CST_CODE_SETTYPE   =  1,  // SETTYPE:   [typeid]
 CST_CODE_NULL  =  2,  // NULL
 CST_CODE_UNDEF =  3,  // UNDEF



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp

2007-04-29 Thread Reid Spencer


Changes in directory llvm/tools/llvm-ld:

llvm-ld.cpp updated: 1.50 - 1.51
---
Log message:

Augment the verbose output to print out the sub-commands executed.


---
Diffs of the changes:  (+29 -8)

 llvm-ld.cpp |   37 +
 1 files changed, 29 insertions(+), 8 deletions(-)


Index: llvm/tools/llvm-ld/llvm-ld.cpp
diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.50 llvm/tools/llvm-ld/llvm-ld.cpp:1.51
--- llvm/tools/llvm-ld/llvm-ld.cpp:1.50 Wed Apr  4 01:34:22 2007
+++ llvm/tools/llvm-ld/llvm-ld.cpp  Sun Apr 29 18:59:47 2007
@@ -120,6 +120,14 @@
   exit(errcode);
 }
 
+static void PrintCommand(const std::vectorconst char* args) {
+  std::vectorconst char*::const_iterator I = args.begin(), E = args.end(); 
+  for (; I != E; ++I)
+if (*I)
+  cout  '  *I  '   ;
+  cout  \n  std::flush;
+}
+
 /// CopyEnv - This function takes an array of environment variables and makes a
 /// copy of it.  This copy can then be manipulated any way the caller likes
 /// without affecting the process's real environment.
@@ -201,6 +209,9 @@
 /// GenerateBytecode - generates a bytecode file from the module provided
 void GenerateBytecode(Module* M, const std::string FileName) {
 
+  if (Verbose)
+cout  Generating Bytecode To   FileName  '\n';
+
   // Create the output file.
   std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
std::ios::binary;
@@ -244,6 +255,11 @@
   args.push_back(InputFilename.c_str());
   args.push_back(0);
 
+  if (Verbose) {
+cout  Generating Assembly With: \n;
+PrintCommand(args);
+  }
+
   return sys::Program::ExecuteAndWait(llc, args[0], 0, 0, 0, 0, ErrMsg);
 }
 
@@ -261,6 +277,12 @@
   args.push_back(OutputFile.c_str());
   args.push_back(InputFile.c_str());
   args.push_back(0);
+
+  if (Verbose) {
+cout  Generating C Source With: \n;
+PrintCommand(args);
+  }
+
   return sys::Program::ExecuteAndWait(llc, args[0], 0, 0, 0, 0, ErrMsg);
 }
 
@@ -340,6 +362,11 @@
 
   args.push_back(0);
 
+  if (Verbose) {
+cout  Generating Native Executable With:\n;
+PrintCommand(args);
+  }
+
   // Run the compiler to assembly and link together the program.
   int R = sys::Program::ExecuteAndWait(
 gcc, args[0], (const char**)clean_env, 0, 0, 0, ErrMsg);
@@ -350,6 +377,8 @@
 /// EmitShellScript - Output the wrapper file that invokes the JIT on the LLVM
 /// bytecode file for the program.
 static void EmitShellScript(char **argv) {
+  if (Verbose)
+cout  Emitting Shell Script\n;
 #if defined(_WIN32) || defined(__CYGWIN__)
   // Windows doesn't support #!/bin/sh style shell scripts in .exe files.  To
   // support windows systems, we copy the llvm-stub.exe executable from the
@@ -554,15 +583,11 @@
   PrintAndExit(Failed to find gcc);
 
 // Generate an assembly language file for the bytecode.
-if (Verbose) 
-  cout  Generating Assembly Code\n;
 std::string ErrMsg;
 if (0 != GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput,
 llc, ErrMsg))
   PrintAndExit(ErrMsg);
 
-if (Verbose) 
-  cout  Generating Native Code\n;
 if (0 != GenerateNative(OutputFilename, AssemblyFile.toString(),
 NativeLinkItems, gcc, envp, ErrMsg))
   PrintAndExit(ErrMsg);
@@ -587,15 +612,11 @@
   PrintAndExit(Failed to find gcc);
 
 // Generate an assembly language file for the bytecode.
-if (Verbose) 
-  cout  Generating Assembly Code\n;
 std::string ErrMsg;
 if (0 != GenerateCFile(
 CFile.toString(), RealBytecodeOutput, llc, ErrMsg))
   PrintAndExit(ErrMsg);
 
-if (Verbose) 
-  cout  Generating Native Code\n;
 if (0 != GenerateNative(OutputFilename, CFile.toString(), 
 NativeLinkItems, gcc, envp, ErrMsg))
   PrintAndExit(ErrMsg);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Linker/LinkItems.cpp

2007-04-29 Thread Reid Spencer


Changes in directory llvm/lib/Linker:

LinkItems.cpp updated: 1.12 - 1.13
---
Log message:

Dependent libraries could be native too.


---
Diffs of the changes:  (+4 -1)

 LinkItems.cpp |5 -
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/Linker/LinkItems.cpp
diff -u llvm/lib/Linker/LinkItems.cpp:1.12 llvm/lib/Linker/LinkItems.cpp:1.13
--- llvm/lib/Linker/LinkItems.cpp:1.12  Tue Apr 10 21:44:19 2007
+++ llvm/lib/Linker/LinkItems.cpp   Sun Apr 29 19:00:10 2007
@@ -54,9 +54,12 @@
   // symbols.
   bool is_native;
   for (Module::lib_iterator I = Composite-lib_begin(),
- E = Composite-lib_end(); I != E; ++I)
+ E = Composite-lib_end(); I != E; ++I) {
 if(LinkInLibrary(*I, is_native))
   return true;
+if (is_native)
+  NativeItems.push_back(std::make_pair(*I, true));
+  }
 
   return false;
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetAsmInfo.h ARMTargetAsmInfo.cpp

2007-04-29 Thread Lauro Ramos Venancio



+/// ARM-specific version of TargetAsmInfo::getInlineAsmLength.
+unsigned ARMTargetAsmInfo::getInlineAsmLength(const char *Str) const {
+  // Count the number of bytes in the asm.
+  bool atInsnStart = true;
+  unsigned Length = 0;
+  for (; *Str; ++Str) {
+if (atInsnStart) {
+  // Skip whitespace
+  while (*Str  isspace(*Str)  *Str != '\n')
+Str++;
+  // Skip label
+  for (const char* p = Str; *p  !isspace(*p); p++)
+if (*p == ':') {
+  Str = p+1;
+  break;
+}
+  // Ignore everything from comment char(s) to EOL
+  if (strncmp(Str, CommentString, strlen(CommentString))==-0)
+atInsnStart = false;
+  else {
+// An instruction
+atInsnStart = false;
+if (isThumb) {
+  // BL and BLX non-reg are 4 bytes, all others 2.
+  const char*p = Str;



p is an unused variable.
/home/laurov/llvm/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp: In member
function 'virtual unsigned int
llvm::ARMTargetAsmInfo::getInlineAsmLength(const char*) const':
/home/laurov/llvm/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:115: warning:
unused variable 'p'



+  if ((*Str=='b' || *Str=='B') 

+  (*(Str+1)=='l' || *(Str+1)=='L')) {
+if (*(Str+2)=='x' || *(Str+2)=='X') {
+  const char* p = Str+3;
+  while (*p  isspace(*p))
+p++;
+  if (*p == 'r' || *p=='R')
+Length += 2;// BLX reg
+  else
+Length += 4;// BLX non-reg
+}
+else
+  Length += 4;// BL
+  } else
+Length += 2;// Thumb anything else
+}
+else
+  Length += 4;// ARM
+  }
+}
+if (*Str == '\n' || *Str == SeparatorChar)
+  atInsnStart = true;
+  }
+  return Length;
+}



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMTargetAsmInfo.cpp

2007-04-29 Thread Lauro Ramos Venancio


Changes in directory llvm/lib/Target/ARM:

ARMAsmPrinter.cpp updated: 1.68 - 1.69
ARMTargetAsmInfo.cpp updated: 1.16 - 1.17
---
Log message:

Enable protected visibility on ARM.


---
Diffs of the changes:  (+16 -4)

 ARMAsmPrinter.cpp|   19 +++
 ARMTargetAsmInfo.cpp |1 +
 2 files changed, 16 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp
diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.68 
llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.69
--- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.68  Fri Apr 27 08:54:47 2007
+++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp   Sun Apr 29 19:23:51 2007
@@ -210,9 +210,14 @@
 break;
   }
 
+  const char *VisibilityDirective = NULL;
   if (F-hasHiddenVisibility())
-if (const char *Directive = TAI-getHiddenDirective())
-  O  Directive  CurrentFnName  \n;
+VisibilityDirective = TAI-getHiddenDirective();
+  else if (F-hasProtectedVisibility())
+VisibilityDirective = TAI-getProtectedDirective();
+
+  if (VisibilityDirective)
+O  VisibilityDirective  CurrentFnName  \n;
 
   if (AFI-isThumbFunction()) {
 EmitAlignment(AFI-getAlign(), F);
@@ -791,9 +796,15 @@
 unsigned Size = TD-getTypeSize(Type);
 unsigned Align = TD-getPreferredAlignmentLog(I);
 
+const char *VisibilityDirective = NULL;
 if (I-hasHiddenVisibility())
-  if (const char *Directive = TAI-getHiddenDirective())
-O  Directive  name  \n;
+  VisibilityDirective = TAI-getHiddenDirective();
+else if (I-hasProtectedVisibility())
+  VisibilityDirective = TAI-getProtectedDirective();
+
+if (VisibilityDirective)
+  O  VisibilityDirective  name  \n;
+
 if (Subtarget-isTargetELF())
   O  \t.type   name  ,%object\n;
 


Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp
diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.16 
llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.17
--- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.16   Sun Apr 29 14:17:45 2007
+++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cppSun Apr 29 19:23:51 2007
@@ -27,6 +27,7 @@
 SetDirective = \t.set;
 WeakRefDirective = \t.weak_reference\t;
 HiddenDirective = \t.private_extern\t;
+ProtectedDirective = NULL;
 JumpTableDataSection = .const;
 CStringSection = \t.cstring;
 FourByteConstantSection = \t.literal4\n;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Linker.h

2007-04-29 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Linker.h updated: 1.22 - 1.23
---
Log message:

If an archive is not recognized as an LLVM bytecode archive then declare
that it is native so that the linker will pass it on downstream. This avoids
a problem where the native link line fails because there is both a .so and
a .a file. The .a file gets processed as bytecode and then dropped from the
command line.


---
Diffs of the changes:  (+2 -1)

 Linker.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Linker.h
diff -u llvm/include/llvm/Linker.h:1.22 llvm/include/llvm/Linker.h:1.23
--- llvm/include/llvm/Linker.h:1.22 Wed Apr  4 01:32:01 2007
+++ llvm/include/llvm/Linker.h  Sun Apr 29 19:29:39 2007
@@ -229,7 +229,8 @@
 /// @returns true if an error occurs, otherwise false.
 /// @brief Link in one archive.
 bool LinkInArchive(
-  const sys::Path Filename /// Filename of the archive to link
+  const sys::Path Filename, /// Filename of the archive to link
+  bool is_native///  Indicates if archive is a native archive
 );
 
 /// This method links the \p Src module into the Linker's Composite module



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Linker/LinkArchives.cpp LinkItems.cpp

2007-04-29 Thread Reid Spencer


Changes in directory llvm/lib/Linker:

LinkArchives.cpp updated: 1.56 - 1.57
LinkItems.cpp updated: 1.13 - 1.14
---
Log message:

If an archive is not recognized as an LLVM bytecode archive then declare
that it is native so that the linker will pass it on downstream. This avoids
a problem where the native link line fails because there is both a .so and
a .a file. The .a file gets processed as bytecode and then dropped from the
command line.


---
Diffs of the changes:  (+8 -3)

 LinkArchives.cpp |7 ++-
 LinkItems.cpp|4 ++--
 2 files changed, 8 insertions(+), 3 deletions(-)


Index: llvm/lib/Linker/LinkArchives.cpp
diff -u llvm/lib/Linker/LinkArchives.cpp:1.56 
llvm/lib/Linker/LinkArchives.cpp:1.57
--- llvm/lib/Linker/LinkArchives.cpp:1.56   Mon Feb  5 15:19:13 2007
+++ llvm/lib/Linker/LinkArchives.cppSun Apr 29 19:29:39 2007
@@ -88,7 +88,7 @@
 ///  TRUE  - An error occurred.
 ///  FALSE - No errors.
 bool
-Linker::LinkInArchive(const sys::Path Filename) {
+Linker::LinkInArchive(const sys::Path Filename, bool is_native) {
 
   // Make sure this is an archive file we're dealing with
   if (!Filename.isArchive())
@@ -118,6 +118,11 @@
   if (!arch)
 return error(Cannot read archive ' + Filename.toString() +
  ':  + ErrMsg);
+  if (!arch-isBytecodeArchive()) {
+is_native = true;
+return false;
+  }
+  is_native = false;
 
   // Save a set of symbols that are not defined by the archive. Since we're
   // entering a loop, there's no point searching for these multiple times. This


Index: llvm/lib/Linker/LinkItems.cpp
diff -u llvm/lib/Linker/LinkItems.cpp:1.13 llvm/lib/Linker/LinkItems.cpp:1.14
--- llvm/lib/Linker/LinkItems.cpp:1.13  Sun Apr 29 19:00:10 2007
+++ llvm/lib/Linker/LinkItems.cpp   Sun Apr 29 19:29:39 2007
@@ -90,7 +90,7 @@
   break;
 
 case sys::Archive_FileType:
-  if (LinkInArchive(Pathname))
+  if (LinkInArchive(Pathname, is_native))
 return error(Cannot link archive ' + Pathname.toString() + ');
   break;
 
@@ -171,7 +171,7 @@
   // A user may specify an ar archive without -l, perhaps because it
   // is not installed as a library. Detect that and link the archive.
   verbose(Linking archive file ' + File.toString() + ');
-  if (LinkInArchive(File))
+  if (LinkInArchive(File, is_native))
 return error(Cannot link archive ' + File.toString() + ');
   break;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp

2007-04-29 Thread Dale Johannesen


Changes in directory llvm/lib/Target/ARM:

ARMTargetAsmInfo.cpp updated: 1.17 - 1.18
---
Log message:

remove unused variable



---
Diffs of the changes:  (+0 -1)

 ARMTargetAsmInfo.cpp |1 -
 1 files changed, 1 deletion(-)


Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp
diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.17 
llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.18
--- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.17   Sun Apr 29 19:23:51 2007
+++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cppSun Apr 29 19:30:48 2007
@@ -112,7 +112,6 @@
 atInsnStart = false;
 if (isThumb) {
   // BL and BLX non-reg are 4 bytes, all others 2.
-  const char*p = Str;
   if ((*Str=='b' || *Str=='B') 
   (*(Str+1)=='l' || *(Str+1)=='L')) {
 if (*(Str+2)=='x' || *(Str+2)=='X') {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/README.txt

2007-04-29 Thread Dale Johannesen


Changes in directory llvm/lib/Target/ARM:

README.txt updated: 1.23 - 1.24
---
Log message:

Remove item: thumb padding in constant islands


---
Diffs of the changes:  (+2 -6)

 README.txt |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/ARM/README.txt
diff -u llvm/lib/Target/ARM/README.txt:1.23 llvm/lib/Target/ARM/README.txt:1.24
--- llvm/lib/Target/ARM/README.txt:1.23 Fri Apr 20 15:18:43 2007
+++ llvm/lib/Target/ARM/README.txt  Sun Apr 29 19:32:06 2007
@@ -35,14 +35,10 @@
 1.  There may be some advantage to trying to be smarter about the initial
 placement, rather than putting everything at the end.
 
-2.  The handling of 2-byte padding for Thumb is overly conservative.  There 
-would be a small gain to keeping accurate track of the padding (which would
-require aligning functions containing constant pools to 4-byte boundaries).
-
-3.  There might be some compile-time efficiency to be had by representing
+2.  There might be some compile-time efficiency to be had by representing
 consecutive islands as a single block rather than multiple blocks.
 
-4.  Use a priority queue to sort constant pool users in inverse order of
+3.  Use a priority queue to sort constant pool users in inverse order of
 position so we always process the one closed to the end of functions
 first. This may simply CreateNewWater.
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll ispositive.ll vector-identity-shuffle.ll

2007-04-29 Thread Reid Spencer


Changes in directory llvm/test/CodeGen/PowerPC:

2006-11-10-DAGCombineMiscompile.ll added (r1.1)
ispositive.ll added (r1.1)
vector-identity-shuffle.ll added (r1.1)
---
Log message:

For PR1370: http://llvm.org/PR1370 :
Rearrange some tests so that if PowerPC is not being built we don't try to
run PowerPC specific tests.


---
Diffs of the changes:  (+40 -0)

 2006-11-10-DAGCombineMiscompile.ll |   14 ++
 ispositive.ll  |   10 ++
 vector-identity-shuffle.ll |   16 
 3 files changed, 40 insertions(+)


Index: llvm/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll
diff -c /dev/null 
llvm/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll:1.1
*** /dev/null   Mon Apr 30 00:12:08 2007
--- llvm/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.llMon Apr 
30 00:11:58 2007
***
*** 0 
--- 1,14 
+ ; RUN: llvm-upgrade  %s | llvm-as | llc -march=ppc32 | grep rlwimi
+ 
+ void %test(short %div.0.i.i.i.i, int %L_num.0.i.i.i.i, int %tmp1.i.i206.i.i, 
short* %P) {
+ %X = shl short %div.0.i.i.i.i, ubyte 1  ; short [#uses=1]
+ %tmp28.i.i.i.i = shl int %L_num.0.i.i.i.i, ubyte 1  ; 
int [#uses=2]
+ %tmp31.i.i.i.i = setlt int %tmp28.i.i.i.i, %tmp1.i.i206.i.i   
  ; bool [#uses=2]
+ 
+ %tmp31.i.i.i.i = cast bool %tmp31.i.i.i.i to short  ; 
short [#uses=1]
+ %tmp371.i.i.i.i1 = or short %tmp31.i.i.i.i, %X  ; short 
[#uses=1]
+ %div.0.be.i.i.i.i = xor short %tmp371.i.i.i.i1, 1   ; 
short [#uses=1]
+ store short %div.0.be.i.i.i.i, short* %P
+ ret void
+ }
+ 


Index: llvm/test/CodeGen/PowerPC/ispositive.ll
diff -c /dev/null llvm/test/CodeGen/PowerPC/ispositive.ll:1.1
*** /dev/null   Mon Apr 30 00:12:22 2007
--- llvm/test/CodeGen/PowerPC/ispositive.ll Mon Apr 30 00:11:58 2007
***
*** 0 
--- 1,10 
+ ; RUN: llvm-as  %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
+ ; RUN:   grep {srwi r3, r3, 31}
+ 
+ define i32 @test1(i32 %X) {
+ entry:
+ icmp slt i32 %X, 0  ; i1:0 [#uses=1]
+ zext i1 %0 to i32   ; i32:1 [#uses=1]
+ ret i32 %1
+ }
+ 


Index: llvm/test/CodeGen/PowerPC/vector-identity-shuffle.ll
diff -c /dev/null llvm/test/CodeGen/PowerPC/vector-identity-shuffle.ll:1.1
*** /dev/null   Mon Apr 30 00:12:22 2007
--- llvm/test/CodeGen/PowerPC/vector-identity-shuffle.llMon Apr 30 
00:11:58 2007
***
*** 0 
--- 1,16 
+ ; RUN: llvm-upgrade  %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep test:
+ ; RUN: llvm-upgrade  %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep 
vperm
+ 
+ void %test(4 x float *%tmp2.i) {
+   %tmp2.i = load 4x float* %tmp2.i
+%xFloat0.48 = extractelement 4 x float %tmp2.i, uint 0   
 ; float [#uses=1]
+ %inFloat0.49 = insertelement 4 x float undef, float %xFloat0.48, 
uint 0   ; 4 x float [#uses=1]
+ %xFloat1.50 = extractelement 4 x float %tmp2.i, uint 1  
  ; float [#uses=1]
+ %inFloat1.52 = insertelement 4 x float %inFloat0.49, float 
%xFloat1.50, uint 1; 4 x float [#uses=1]
+ %xFloat2.53 = extractelement 4 x float %tmp2.i, uint 2  
  ; float [#uses=1]
+ %inFloat2.55 = insertelement 4 x float %inFloat1.52, float 
%xFloat2.53, uint 2; 4 x float [#uses=1]
+ %xFloat3.56 = extractelement 4 x float %tmp2.i, uint 3  
  ; float [#uses=1]
+ %inFloat3.58 = insertelement 4 x float %inFloat2.55, float 
%xFloat3.56, uint 3; 4 x float [#uses=4]
+   store 4 x float %inFloat3.58, 4x float* %tmp2.i
+   ret void
+ }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CodeGen/Generic/vector-identity-shuffle.ll 2006-11-10-DAGCombineMiscompile.ll ispositive.ll

2007-04-29 Thread Reid Spencer


Changes in directory llvm/test/CodeGen/Generic:

vector-identity-shuffle.ll updated: 1.5 - 1.6
2006-11-10-DAGCombineMiscompile.ll (r1.2) removed
ispositive.ll (r1.5) removed
---
Log message:

For PR1370: http://llvm.org/PR1370 :
Rearrange some tests so that if PowerPC is not being built we don't try to
run PowerPC specific tests.


---
Diffs of the changes:  (+0 -2)

 vector-identity-shuffle.ll |2 --
 1 files changed, 2 deletions(-)


Index: llvm/test/CodeGen/Generic/vector-identity-shuffle.ll
diff -u llvm/test/CodeGen/Generic/vector-identity-shuffle.ll:1.5 
llvm/test/CodeGen/Generic/vector-identity-shuffle.ll:1.6
--- llvm/test/CodeGen/Generic/vector-identity-shuffle.ll:1.5Mon Apr 16 
12:36:06 2007
+++ llvm/test/CodeGen/Generic/vector-identity-shuffle.llMon Apr 30 
00:11:58 2007
@@ -1,5 +1,3 @@
-; RUN: llvm-upgrade  %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep test:
-; RUN: llvm-upgrade  %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vperm
 ; RUN: llvm-upgrade  %s | llvm-as | llc 
 
 void %test(4 x float *%tmp2.i) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CodeGen/ARM/ispositive.ll

2007-04-29 Thread Reid Spencer


Changes in directory llvm/test/CodeGen/ARM:

ispositive.ll added (r1.1)
---
Log message:

For PR1370: http://llvm.org/PR1370 :
Rearrange some tests so that if PowerPC is not being built we don't try to
run PowerPC specific tests.


---
Diffs of the changes:  (+10 -0)

 ispositive.ll |   10 ++
 1 files changed, 10 insertions(+)


Index: llvm/test/CodeGen/ARM/ispositive.ll
diff -c /dev/null llvm/test/CodeGen/ARM/ispositive.ll:1.1
*** /dev/null   Mon Apr 30 00:12:08 2007
--- llvm/test/CodeGen/ARM/ispositive.ll Mon Apr 30 00:11:58 2007
***
*** 0 
--- 1,10 
+ ; RUN: llvm-as  %s | llc -march=arm | grep {mov r0, r0, lsr #31}
+ ; RUN: llvm-as  %s | llc -march=thumb | grep {lsr r0, r0, #31}
+ 
+ define i32 @test1(i32 %X) {
+ entry:
+ icmp slt i32 %X, 0  ; i1:0 [#uses=1]
+ zext i1 %0 to i32   ; i32:1 [#uses=1]
+ ret i32 %1
+ }
+ 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CodeGen/X86/ispositive.ll

2007-04-29 Thread Reid Spencer


Changes in directory llvm/test/CodeGen/X86:

ispositive.ll added (r1.1)
---
Log message:

For PR1370: http://llvm.org/PR1370 :
Rearrange some tests so that if PowerPC is not being built we don't try to
run PowerPC specific tests.


---
Diffs of the changes:  (+9 -0)

 ispositive.ll |9 +
 1 files changed, 9 insertions(+)


Index: llvm/test/CodeGen/X86/ispositive.ll
diff -c /dev/null llvm/test/CodeGen/X86/ispositive.ll:1.1
*** /dev/null   Mon Apr 30 00:12:08 2007
--- llvm/test/CodeGen/X86/ispositive.ll Mon Apr 30 00:11:58 2007
***
*** 0 
--- 1,9 
+ ; RUN: llvm-as  %s | llc -march=x86 | grep {shrl.*31}
+ 
+ define i32 @test1(i32 %X) {
+ entry:
+ icmp slt i32 %X, 0  ; i1:0 [#uses=1]
+ zext i1 %0 to i32   ; i32:1 [#uses=1]
+ ret i32 %1
+ }
+ 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/test/CodeGen/X86/ispositive.ll

2007-04-29 Thread Chris Lattner

Reid, why are you duplicating these tests?

-Chris

On Apr 29, 2007, at 10:12 PM, Reid Spencer wrote:



 Changes in directory llvm/test/CodeGen/X86:

 ispositive.ll added (r1.1)
 ---
 Log message:

 For PR1370: http://llvm.org/PR1370 :
 Rearrange some tests so that if PowerPC is not being built we don't  
 try to
 run PowerPC specific tests.


 ---
 Diffs of the changes:  (+9 -0)

  ispositive.ll |9 +
  1 files changed, 9 insertions(+)


 Index: llvm/test/CodeGen/X86/ispositive.ll
 diff -c /dev/null llvm/test/CodeGen/X86/ispositive.ll:1.1
 *** /dev/null Mon Apr 30 00:12:08 2007
 --- llvm/test/CodeGen/X86/ispositive.ll   Mon Apr 30 00:11:58 2007
 ***
 *** 0 
 --- 1,9 
 + ; RUN: llvm-as  %s | llc -march=x86 | grep {shrl.*31}
 +
 + define i32 @test1(i32 %X) {
 + entry:
 + icmp slt i32 %X, 0  ; i1:0 [#uses=1]
 + zext i1 %0 to i32   ; i32:1 [#uses=1]
 + ret i32 %1
 + }
 +



 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits