Re: [llvm-commits] CVS: llvm/include/llvm/ADT/APSInt.h

2007-04-05 Thread Reid Spencer
On Thu, 2007-04-05 at 00:20 -0500, Chris Lattner wrote:
> 
> Changes in directory llvm/include/llvm/ADT:
> 
> APSInt.h added (r1.1)
> ---
> Log message:
> 
> Add a helper class (APSInt) which can represent an APInt along with sign
> information.  This is useful when a value does have a sign associated with
> it.  This shouldn't be used generally in LLVM for mid-level optimizer stuff.

Do we really need this? I didn't see you use it in any subsequent
commits. What's the use case you have in mind?

Reid.

> 
> 
> ---
> Diffs of the changes:  (+101 -0)
> 
>  APSInt.h |  101 
> +++
>  1 files changed, 101 insertions(+)
> 
> 
> Index: llvm/include/llvm/ADT/APSInt.h
> diff -c /dev/null llvm/include/llvm/ADT/APSInt.h:1.1
> *** /dev/null Thu Apr  5 00:20:21 2007
> --- llvm/include/llvm/ADT/APSInt.hThu Apr  5 00:20:11 2007
> ***
> *** 0 
> --- 1,101 
> + //===-- llvm/Support/APSInt.h - Arbitrary Precision Signed Int -*- 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 implements the APSInt class, which is a simple class that
> + // represents an arbitrary sized integer that knows its signedness.
> + //
> + 
> //===--===//
> + 
> + #ifndef LLVM_APSINT_H
> + #define LLVM_APSINT_H
> + 
> + #include "llvm/ADT/APInt.h"
> + 
> + namespace llvm {
> +   
> +   
> + class APSInt : public APInt {
> +   bool IsUnsigned;
> + public:
> +   /// APSInt ctor - Create an APSInt with the specified width, default to
> +   /// unsigned.
> +   explicit APSInt(unsigned BitWidth) : APInt(BitWidth, 0), IsUnsigned(true) 
> {}
> +   APSInt(const APInt &I) : APInt(I), IsUnsigned(true) {}
> + 
> +   APSInt &operator=(const APSInt &RHS) {
> + APInt::operator=(RHS); 
> + IsUnsigned = RHS.IsUnsigned;
> + return *this;
> +   }
> + 
> +   APSInt &operator=(const APInt &RHS) {
> + // Retain our current sign.
> + APInt::operator=(RHS); 
> + return *this;
> +   }
> + 
> +   APSInt &operator=(uint64_t RHS) {
> + // Retain our current sign.
> + APInt::operator=(RHS); 
> + return *this;
> +   }
> + 
> +   // Query sign information.
> +   bool isSigned() const { return !IsUnsigned; }
> +   bool isUnsigned() const { return IsUnsigned; }
> +   void setIsUnsigned(bool Val) { IsUnsigned = Val; }
> +   
> +   
> +   const APSInt &operator%=(const APSInt &RHS) {
> + assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
> + if (IsUnsigned)
> +   *this = urem(RHS);
> + else
> +   *this = srem(RHS);
> + return *this;
> +   }
> +   const APSInt &operator/=(const APSInt &RHS) {
> + assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
> + if (IsUnsigned)
> +   *this = udiv(RHS);
> + else
> +   *this = sdiv(RHS);
> + return *this;
> +   }
> +   
> +   const APSInt &operator>>=(unsigned Amt) {
> + *this = *this >> Amt;
> + return *this;
> +   }
> +   
> +   APSInt operator>>(unsigned Amt) {
> + return IsUnsigned ? lshr(Amt) : ashr(Amt);
> +   }
> +   
> +   inline bool operator<(const APSInt& RHS) const {
> + assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
> + return IsUnsigned ? ult(RHS) : slt(RHS);
> +   }
> +   inline bool operator>(const APSInt& RHS) const {
> + assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
> + return IsUnsigned ? ugt(RHS) : sgt(RHS);
> +   }
> +   inline bool operator<=(const APSInt& RHS) const {
> + assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
> + return IsUnsigned ? ule(RHS) : sle(RHS);
> +   }
> +   inline bool operator>=(const APSInt& RHS) const {
> + assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
> + return IsUnsigned ? uge(RHS) : sge(RHS);
> +   }
> + };
> +   
> + } // end namespace llvm
> + 
> + #endif
> 
> 
> 
> ___
> 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-stacker/Makefile.common.in

2007-04-05 Thread Reid Spencer


Changes in directory llvm-stacker:

Makefile.common.in updated: 1.4 -> 1.5
---
Log message:

Make this compile again by abandoning partially completed makefile work.


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

 Makefile.common.in |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-stacker/Makefile.common.in
diff -u llvm-stacker/Makefile.common.in:1.4 llvm-stacker/Makefile.common.in:1.5
--- llvm-stacker/Makefile.common.in:1.4 Thu Mar 29 14:05:44 2007
+++ llvm-stacker/Makefile.common.in Thu Apr  5 11:19:25 2007
@@ -26,4 +26,4 @@
 PROJ_INSTALL_ROOT := @prefix@
 
 # Include LLVM's Master Makefile.
-include $(LLVM_OBJ_ROOT)/Makefile.config
+include $(LLVM_OBJ_ROOT)/Makefile.common



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


[llvm-commits] CVS: llvm-stacker/lib/compiler/Makefile

2007-04-05 Thread Reid Spencer


Changes in directory llvm-stacker/lib/compiler:

Makefile updated: 1.12 -> 1.13
---
Log message:

Make this compile again by abandoning partially completed makefile work.


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

 Makefile |1 -
 1 files changed, 1 deletion(-)


Index: llvm-stacker/lib/compiler/Makefile
diff -u llvm-stacker/lib/compiler/Makefile:1.12 
llvm-stacker/lib/compiler/Makefile:1.13
--- llvm-stacker/lib/compiler/Makefile:1.12 Thu Mar 29 14:05:44 2007
+++ llvm-stacker/lib/compiler/Makefile  Thu Apr  5 11:19:25 2007
@@ -14,7 +14,6 @@
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
-include $(LLVMMAKE)/archive
 
 ifdef PARSE_DEBUG
 INCLUDES += -DPARSE_DEBUG



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


Re: [llvm-commits] CVS: llvm/include/llvm/ADT/APSInt.h

2007-04-05 Thread Chris Lattner
On Apr 5, 2007, at 8:40 AM, Reid Spencer wrote:
>> Add a helper class (APSInt) which can represent an APInt along  
>> with sign
>> information.  This is useful when a value does have a sign  
>> associated with
>> it.  This shouldn't be used generally in LLVM for mid-level  
>> optimizer stuff.
>
> Do we really need this? I didn't see you use it in any subsequent
> commits. What's the use case you have in mind?

I'm playing with a little interpreter, which wants to think of values  
as signed.  It is a toy and nothing will probably come of it, but it  
made more sense to have a class to represent arbitrary-width signed  
values than use a pair everywhere.  Perhaps it will be  
useful for other people too.

-Chris
___
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/switch-lower-feature-2.ll

2007-04-05 Thread Anton Korobeynikov


Changes in directory llvm/test/CodeGen/Generic:

switch-lower-feature-2.ll updated: 1.1 -> 1.2
---
Log message:

Fix test


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

 switch-lower-feature-2.ll |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/test/CodeGen/Generic/switch-lower-feature-2.ll
diff -u llvm/test/CodeGen/Generic/switch-lower-feature-2.ll:1.1 
llvm/test/CodeGen/Generic/switch-lower-feature-2.ll:1.2
--- llvm/test/CodeGen/Generic/switch-lower-feature-2.ll:1.1 Wed Apr  4 
16:14:49 2007
+++ llvm/test/CodeGen/Generic/switch-lower-feature-2.ll Thu Apr  5 11:43:09 2007
@@ -8,6 +8,8 @@
 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep ja | wc -l | grep 1 &&
 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep js | wc -l | grep 1
 
+target triple = "i686-pc-linux-gnu"
+
 define i32 @main(i32 %tmp158) {
 entry:
 switch i32 %tmp158, label %bb336 [



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


[llvm-commits] [125745] Improve Packed structure support by used

2007-04-05 Thread dpatel
Revision: 125745
Author:   dpatel
Date: 2007-04-05 09:48:13 -0700 (Thu, 05 Apr 2007)

Log Message:
---
Improve Packed structure support by used 
Packed StructType.

Original version of this patch was written by
Andrew Lenharth. Later this patch was updated by
Duncan Sands. I updated packed bit field 
support in this patch.

Modified Paths:
--
apple-local/branches/llvm/gcc/llvm-convert.cpp
apple-local/branches/llvm/gcc/llvm-types.cpp

Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===
--- apple-local/branches/llvm/gcc/llvm-convert.cpp  2007-04-05 14:21:17 UTC 
(rev 125744)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp  2007-04-05 16:48:13 UTC 
(rev 125745)
@@ -4780,6 +4780,10 @@
 // the size of the field.  To get the pointer close enough, add some
 // number of alignment units to the pointer.
 unsigned ByteAlignment = TD.getABITypeAlignment(FieldTy);
+// It is possible that an individual field is Packed. This information 
is
+// not reflected in FieldTy. Check DECL_PACKED here.
+if (DECL_PACKED(FieldDecl))
+  ByteAlignment = 1;
 assert(ByteAlignment*8 <= LLVMValueBitSize && "Unknown overlap case!");
 unsigned NumAlignmentUnits = BitStart/(ByteAlignment*8);
 assert(NumAlignmentUnits && "Not adjusting pointer?");
@@ -5560,7 +5564,7 @@
 if (ResultElts[i] == 0)
   ResultElts[i] = Constant::getNullValue(STy->getElementType(i));
   
-  return ConstantStruct::get(ResultElts, false);
+  return ConstantStruct::get(ResultElts, STy->isPacked());
 }
 
 Constant *TreeConstantToLLVM::ConvertUnionCONSTRUCTOR(tree exp) {

Modified: apple-local/branches/llvm/gcc/llvm-types.cpp
===
--- apple-local/branches/llvm/gcc/llvm-types.cpp2007-04-05 14:21:17 UTC 
(rev 125744)
+++ apple-local/branches/llvm/gcc/llvm-types.cpp2007-04-05 16:48:13 UTC 
(rev 125745)
@@ -845,10 +845,27 @@
   std::vector ElementSizeInBytes;
   const TargetData &TD;
   unsigned GCCStructAlignmentInBytes;
+  bool Packed; // True if struct is packed
+  bool LastFieldStartsAtNonByteBoundry;
+  unsigned ExtraBitsAvailable; // Non-zero if last field is bit field and it
+   // does not use all allocated bits
 
-  StructTypeConversionInfo(TargetMachine &TM, unsigned GCCAlign)
-: TD(*TM.getTargetData()), GCCStructAlignmentInBytes(GCCAlign) {}
+  StructTypeConversionInfo(TargetMachine &TM, unsigned GCCAlign, bool P)
+: TD(*TM.getTargetData()), GCCStructAlignmentInBytes(GCCAlign),
+  Packed(P), LastFieldStartsAtNonByteBoundry(false), ExtraBitsAvailable(0) 
{}
 
+  void lastFieldStartsAtNonByteBoundry(bool value) {
+LastFieldStartsAtNonByteBoundry = value;
+  }
+
+  void extraBitsAvailable (unsigned E) {
+ExtraBitsAvailable = E;
+  }
+
+  void markAsPacked() {
+Packed = true;
+  }
+
   unsigned getGCCStructAlignmentInBytes() const {
 return GCCStructAlignmentInBytes;
   }
@@ -856,7 +873,7 @@
   /// getTypeAlignment - Return the alignment of the specified type in bytes.
   ///
   unsigned getTypeAlignment(const Type *Ty) const {
-return TD.getABITypeAlignment(Ty);
+return Packed ? 1 : TD.getABITypeAlignment(Ty);
   }
   
   /// getTypeSize - Return the size of the specified type in bytes.
@@ -868,7 +885,7 @@
   /// getLLVMType - Return the LLVM type for the specified object.
   ///
   const Type *getLLVMType() const {
-return StructType::get(Elements, false);
+return StructType::get(Elements, Packed);
   }
   
   /// getSizeAsLLVMStruct - Return the size of this struct if it were converted
@@ -877,25 +894,103 @@
   uint64_t getSizeAsLLVMStruct() const {
 if (Elements.empty()) return 0;
 unsigned MaxAlign = 1;
-for (unsigned i = 0, e = Elements.size(); i != e; ++i)
-  MaxAlign = std::max(MaxAlign, getTypeAlignment(Elements[i]));
+if (!Packed)
+  for (unsigned i = 0, e = Elements.size(); i != e; ++i)
+MaxAlign = std::max(MaxAlign, getTypeAlignment(Elements[i]));
 
 uint64_t Size = ElementOffsetInBytes.back()+ElementSizeInBytes.back();
 return (Size+MaxAlign-1) & ~(MaxAlign-1);
   }
-  
-  /// RemoveLastElementIfOverlapsWith - If the last element in the struct
-  /// includes the specified byte, remove it.
-  void RemoveLastElementIfOverlapsWith(uint64_t ByteOffset) {
-if (Elements.empty()) return;
-assert(ElementOffsetInBytes.back() <= ByteOffset &&
-   "Cannot go backwards in struct");
-if (ElementOffsetInBytes.back()+ElementSizeInBytes.back() > ByteOffset) {
-  // The last element overlapped with this one, remove it.
-  Elements.pop_back();
-  ElementOffsetInBytes.pop_back();
-  ElementSizeInBytes.pop_back();
+
+  // If this is a Packed struct and ExtraBitsAvailable is not zero then
+  // remove Extra bytes if ExtraBitsAvailable > 8.
+  void

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

2007-04-05 Thread Chris Lattner


Changes in directory llvm/tools/llvm-ld:

Optimize.cpp updated: 1.18 -> 1.19
---
Log message:

run a late dce pass to clean up extra cruft.


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

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


Index: llvm/tools/llvm-ld/Optimize.cpp
diff -u llvm/tools/llvm-ld/Optimize.cpp:1.18 
llvm/tools/llvm-ld/Optimize.cpp:1.19
--- llvm/tools/llvm-ld/Optimize.cpp:1.18Tue Mar  6 22:41:30 2007
+++ llvm/tools/llvm-ld/Optimize.cpp Thu Apr  5 11:50:20 2007
@@ -201,6 +201,7 @@
   if (!DisableOptimizations) {
 addPass(Passes, createInstructionCombiningPass());
 addPass(Passes, createCFGSimplificationPass());
+addPass(Passes, createDeadCodeEliminationPass());
 addPass(Passes, createGlobalDCEPass());
   }
 



___
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-05-PackedBitFields-2.c 2007-04-05-PackedBitFields.c 2007-04-05-PackedStruct.c 2007-04-05-UnPackedStruct.c

2007-04-05 Thread Devang Patel


Changes in directory llvm/test/CFrontend:

2007-04-05-PackedBitFields-2.c added (r1.1)
2007-04-05-PackedBitFields.c added (r1.1)
2007-04-05-PackedStruct.c added (r1.1)
2007-04-05-UnPackedStruct.c added (r1.1)
---
Log message:

New tests for Packed structs.


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

 2007-04-05-PackedBitFields-2.c |   16 
 2007-04-05-PackedBitFields.c   |   16 
 2007-04-05-PackedStruct.c  |   18 ++
 2007-04-05-UnPackedStruct.c|   16 
 4 files changed, 66 insertions(+)


Index: llvm/test/CFrontend/2007-04-05-PackedBitFields-2.c
diff -c /dev/null llvm/test/CFrontend/2007-04-05-PackedBitFields-2.c:1.1
*** /dev/null   Thu Apr  5 12:07:59 2007
--- llvm/test/CFrontend/2007-04-05-PackedBitFields-2.c  Thu Apr  5 12:07:48 2007
***
*** 0 
--- 1,16 
+ // RUN: %llvmgcc %s -S -o -
+ 
+ # define pck __attribute__((packed))
+ 
+ 
+ struct pck F { 
+   unsigned long long i : 12, 
+ j : 23, 
+ k : 27, 
+ l; 
+ }; 
+ struct F f1;
+ 
+ void foo() {
+   f1.l = 5;
+ }


Index: llvm/test/CFrontend/2007-04-05-PackedBitFields.c
diff -c /dev/null llvm/test/CFrontend/2007-04-05-PackedBitFields.c:1.1
*** /dev/null   Thu Apr  5 12:08:06 2007
--- llvm/test/CFrontend/2007-04-05-PackedBitFields.cThu Apr  5 12:07:48 2007
***
*** 0 
--- 1,16 
+ // RUN: %llvmgcc %s -S -o -
+ 
+ # define pck __attribute__((packed))
+ 
+ 
+ struct pck E { 
+   unsigned long long l, 
+ i : 12, 
+ j : 23, 
+ k : 29; };
+ 
+ struct E e1;
+ 
+ void foo() {
+   e1.k = 5;
+ }


Index: llvm/test/CFrontend/2007-04-05-PackedStruct.c
diff -c /dev/null llvm/test/CFrontend/2007-04-05-PackedStruct.c:1.1
*** /dev/null   Thu Apr  5 12:08:06 2007
--- llvm/test/CFrontend/2007-04-05-PackedStruct.c   Thu Apr  5 12:07:48 2007
***
*** 0 
--- 1,18 
+ // RUN: %llvmgcc %s -S -o -
+ 
+ #pragma pack(push, 2)
+ 
+ enum {
+   tA = 0,
+   tB = 1
+ };
+ 
+ struct MyStruct {
+   unsigned long A;
+   char C;
+   void * B;
+ };
+ 
+ void bar(){
+ struct MyStruct MS = { tB, 0 };
+ }


Index: llvm/test/CFrontend/2007-04-05-UnPackedStruct.c
diff -c /dev/null llvm/test/CFrontend/2007-04-05-UnPackedStruct.c:1.1
*** /dev/null   Thu Apr  5 12:08:06 2007
--- llvm/test/CFrontend/2007-04-05-UnPackedStruct.c Thu Apr  5 12:07:48 2007
***
*** 0 
--- 1,16 
+ // RUN: %llvmgcc %s -S -o -
+ 
+ 
+ enum {
+   tA = 0,
+   tB = 1
+ };
+ 
+ struct MyStruct {
+   unsigned long A;
+   void * B;
+ };
+ 
+ void bar(){
+ struct MyStruct MS = { tB, 0 };
+ }



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


Re: [llvm-commits] CVS: llvm/test/CFrontend/2007-04-05-PackedBitFields-2.c 2007-04-05-PackedBitFields.c 2007-04-05-PackedStruct.c 2007-04-05-UnPackedStruct.c

2007-04-05 Thread Chris Lattner
>
> New tests for Packed structs.

Woot, thanks Devang, Duncan and Andrew! :)

-Chris

>
> ---
> Diffs of the changes:  (+66 -0)
>
>  2007-04-05-PackedBitFields-2.c |   16 
>  2007-04-05-PackedBitFields.c   |   16 
>  2007-04-05-PackedStruct.c  |   18 ++
>  2007-04-05-UnPackedStruct.c|   16 
>  4 files changed, 66 insertions(+)
>
>
> Index: llvm/test/CFrontend/2007-04-05-PackedBitFields-2.c
> diff -c /dev/null llvm/test/CFrontend/2007-04-05- 
> PackedBitFields-2.c:1.1
> *** /dev/null Thu Apr  5 12:07:59 2007
> --- llvm/test/CFrontend/2007-04-05-PackedBitFields-2.cThu Apr  5  
> 12:07:48 2007
> ***
> *** 0 
> --- 1,16 
> + // RUN: %llvmgcc %s -S -o -
> +
> + # define pck __attribute__((packed))
> +
> +
> + struct pck F {
> +   unsigned long long i : 12,
> + j : 23,
> + k : 27,
> + l;
> + };
> + struct F f1;
> +
> + void foo() {
> + f1.l = 5;
> + }
>
>
> Index: llvm/test/CFrontend/2007-04-05-PackedBitFields.c
> diff -c /dev/null llvm/test/CFrontend/2007-04-05-PackedBitFields.c:1.1
> *** /dev/null Thu Apr  5 12:08:06 2007
> --- llvm/test/CFrontend/2007-04-05-PackedBitFields.c  Thu Apr  5  
> 12:07:48 2007
> ***
> *** 0 
> --- 1,16 
> + // RUN: %llvmgcc %s -S -o -
> +
> + # define pck __attribute__((packed))
> +
> +
> + struct pck E {
> +   unsigned long long l,
> + i : 12,
> + j : 23,
> + k : 29; };
> +
> + struct E e1;
> +
> + void foo() {
> + e1.k = 5;
> + }
>
>
> Index: llvm/test/CFrontend/2007-04-05-PackedStruct.c
> diff -c /dev/null llvm/test/CFrontend/2007-04-05-PackedStruct.c:1.1
> *** /dev/null Thu Apr  5 12:08:06 2007
> --- llvm/test/CFrontend/2007-04-05-PackedStruct.c Thu Apr  5  
> 12:07:48 2007
> ***
> *** 0 
> --- 1,18 
> + // RUN: %llvmgcc %s -S -o -
> +
> + #pragma pack(push, 2)
> +
> + enum {
> +   tA = 0,
> +   tB = 1
> + };
> +
> + struct MyStruct {
> +   unsigned long A;
> +   char C;
> +   void * B;
> + };
> +
> + void bar(){
> + struct MyStruct MS = { tB, 0 };
> + }
>
>
> Index: llvm/test/CFrontend/2007-04-05-UnPackedStruct.c
> diff -c /dev/null llvm/test/CFrontend/2007-04-05-UnPackedStruct.c:1.1
> *** /dev/null Thu Apr  5 12:08:06 2007
> --- llvm/test/CFrontend/2007-04-05-UnPackedStruct.c   Thu Apr  5  
> 12:07:48 2007
> ***
> *** 0 
> --- 1,16 
> + // RUN: %llvmgcc %s -S -o -
> +
> +
> + enum {
> +   tA = 0,
> +   tB = 1
> + };
> +
> + struct MyStruct {
> +   unsigned long A;
> +   void * B;
> + };
> +
> + void bar(){
> + struct MyStruct MS = { tB, 0 };
> + }
>
>
>
> ___
> 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/C++Frontend/2007-04-05-PackedBitFields-1.cpp 2007-04-05-PackedBitFieldsOverlap-2.cpp 2007-04-05-PackedBitFieldsOverlap.cpp 2007-04-05-PackedBitFieldsSmall.cpp 2007-04-05-

2007-04-05 Thread Devang Patel


Changes in directory llvm/test/C++Frontend:

2007-04-05-PackedBitFields-1.cpp added (r1.1)
2007-04-05-PackedBitFieldsOverlap-2.cpp added (r1.1)
2007-04-05-PackedBitFieldsOverlap.cpp added (r1.1)
2007-04-05-PackedBitFieldsSmall.cpp added (r1.1)
2007-04-05-StructPackedFieldUnpacked.cpp added (r1.1)
---
Log message:

New tests for Packed structs.


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

 2007-04-05-PackedBitFields-1.cpp |   23 +++
 2007-04-05-PackedBitFieldsOverlap-2.cpp  |   24 
 2007-04-05-PackedBitFieldsOverlap.cpp|   24 
 2007-04-05-PackedBitFieldsSmall.cpp  |   27 +++
 2007-04-05-StructPackedFieldUnpacked.cpp |   25 +
 5 files changed, 123 insertions(+)


Index: llvm/test/C++Frontend/2007-04-05-PackedBitFields-1.cpp
diff -c /dev/null llvm/test/C++Frontend/2007-04-05-PackedBitFields-1.cpp:1.1
*** /dev/null   Thu Apr  5 12:14:31 2007
--- llvm/test/C++Frontend/2007-04-05-PackedBitFields-1.cpp  Thu Apr  5 
12:14:21 2007
***
*** 0 
--- 1,23 
+ // RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+ 
+ #ifdef PACKED
+ #define P __attribute__((packed))
+ #else
+ #define P
+ #endif
+ 
+ struct P M_Packed { 
+   unsigned int l_Packed; 
+   unsigned short k_Packed : 6, 
+ i_Packed : 15,
+ j_Packed : 11;
+   
+ }; 
+ 
+ struct M_Packed sM_Packed; 
+ 
+ int testM_Packed (void) { 
+   struct M_Packed x; 
+   return (x.i_Packed != 0);
+ }
+   


Index: llvm/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap-2.cpp
diff -c /dev/null 
llvm/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap-2.cpp:1.1
*** /dev/null   Thu Apr  5 12:14:38 2007
--- llvm/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap-2.cpp   Thu Apr 
 5 12:14:21 2007
***
*** 0 
--- 1,24 
+ // RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+ 
+ #ifdef PACKED
+ #define P __attribute__((packed))
+ #else
+ #define P
+ #endif
+ 
+ struct P M_Packed { 
+   unsigned long sorted : 1;
+   unsigned long from_array : 1;
+   unsigned long mixed_encoding : 1;
+   unsigned long encoding : 8;
+   unsigned long count : 21;
+ 
+ }; 
+ 
+ struct M_Packed sM_Packed; 
+ 
+ int testM_Packed (void) { 
+   struct M_Packed x; 
+   return (x.count != 0);
+ }
+   


Index: llvm/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap.cpp
diff -c /dev/null 
llvm/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap.cpp:1.1
*** /dev/null   Thu Apr  5 12:14:38 2007
--- llvm/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap.cpp Thu Apr  5 
12:14:21 2007
***
*** 0 
--- 1,24 
+ // RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+ 
+ 
+ #ifdef PACKED
+ #define P __attribute__((packed))
+ #else
+ #define P
+ #endif
+ 
+ struct P M_Packed { 
+   unsigned int l_Packed; 
+   unsigned short k_Packed : 6, 
+ i_Packed : 15;
+   char c;
+   
+ }; 
+ 
+ struct M_Packed sM_Packed; 
+ 
+ int testM_Packed (void) { 
+   struct M_Packed x; 
+   return (x.i_Packed != 0);
+ }
+   


Index: llvm/test/C++Frontend/2007-04-05-PackedBitFieldsSmall.cpp
diff -c /dev/null llvm/test/C++Frontend/2007-04-05-PackedBitFieldsSmall.cpp:1.1
*** /dev/null   Thu Apr  5 12:14:38 2007
--- llvm/test/C++Frontend/2007-04-05-PackedBitFieldsSmall.cpp   Thu Apr  5 
12:14:21 2007
***
*** 0 
--- 1,27 
+ // RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+ 
+ 
+ #ifdef PACKED
+ // This is an example where size of Packed struct is smaller then 
+ // the size of bit field type.
+ #define P __attribute__((packed))
+ #else
+ #define P
+ #endif
+ 
+ struct P M_Packed { 
+   unsigned long long X:50;
+   unsigned Y:2;
+ }; 
+ 
+ struct M_Packed sM_Packed; 
+ 
+ int testM_Packed (void) { 
+   struct M_Packed x; 
+   return (0 != x.Y);
+ }
+   
+ int testM_Packed2 (void) { 
+   struct M_Packed x; 
+   return (0 != x.X);
+ }


Index: llvm/test/C++Frontend/2007-04-05-StructPackedFieldUnpacked.cpp
diff -c /dev/null 
llvm/test/C++Frontend/2007-04-05-StructPackedFieldUnpacked.cpp:1.1
*** /dev/null   Thu Apr  5 12:14:38 2007
--- llvm/test/C++Frontend/2007-04-05-StructPackedFieldUnpacked.cpp  Thu Apr 
 5 12:14:21 2007
***
*** 0 
--- 1,25 
+ // RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+ 
+ #ifdef PACKED
+ #define P __attribute__((packed))
+ #else
+ #define P
+ #endif
+ 
+ struct UnPacked {
+   int X;  
+   int Y;
+ };
+ 
+ struct P M_Packed { 
+   unsigned char A;
+   struct UnPacked B;
+ }; 
+ 
+ struct M_Packed sM_Packed; 
+ 
+ int testM_Packed (void) { 
+   struct M_Packed x; 
+   return (x.B.Y != 0);
+ }
+   



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


[llvm-commits] CVS: llvm-www/DevMtgMay2007.html

2007-04-05 Thread Chris Lattner


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.46 -> 1.47
---
Log message:

update, the mtg will be in a room at the Cupertino Inn.


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

 DevMtgMay2007.html |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)


Index: llvm-www/DevMtgMay2007.html
diff -u llvm-www/DevMtgMay2007.html:1.46 llvm-www/DevMtgMay2007.html:1.47
--- llvm-www/DevMtgMay2007.html:1.46Wed Apr  4 19:58:13 2007
+++ llvm-www/DevMtgMay2007.html Thu Apr  5 13:42:59 2007
@@ -30,8 +30,7 @@
 
 Why: To get acquainted, learn how LLVM is used, and exchange 
 ideas.
-Where: Apple, Inc., 1 Infinite Loop, Cupertino, CA 95014, 
-408.996.1010
+Where: http://www.cupertinoinn.com/";>Cupertino Inn 
- 10889 N De Anza Blvd, Cupertino, 95014 - across the street from Apple
 When: May 25, 2007, 8:00am to 6:00pm
 Who: Everyone is invited to participate and present.  If you
 would like to present, please send your ideas to 
@@ -203,14 +202,15 @@
   to find hotels near the meeting.
   If there is sufficient interest, we may try to set up a discount price at
   one hotel. Please contact Reid if you are interested.
+  Tanya Lattner reports:
+  I have stayed at both the Cupertino Inn and Hilton Garden 
Inn. 
+   The Hilton is nicer but the Cupertino Inn is acceptable and within walking 
+   distance. The Hilton may have a shuttle.  The meeting is actually being
+   held in a room at the Cupertino Inn this year.
   Bill Wendling reports:
   http://www.thecypresshotel.com/";>The Cypress 
Hotel
 is very close to the Apple campus. It's pretty swank, so I'm not sure how 
 pricey it is.
-  Tanya Lattner reports:
-  I have stayed at both the Cupertino Inn and Hilton Garden 
Inn. 
-   The Hilton is nicer but the Cupertino Inn is acceptable and within walking 
-   distance. The Hilton may have a shuttle.
 
 
 Meals
@@ -286,6 +286,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/04/05 00:58:13 $
+Last modified: $Date: 2007/04/05 18:42:59 $
 
 



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


[llvm-commits] CVS: llvm-www/DevMtgMay2007.html

2007-04-05 Thread Chris Lattner


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.47 -> 1.48
---
Log message:

Minor updates, linkify the location


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

 DevMtgMay2007.html |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)


Index: llvm-www/DevMtgMay2007.html
diff -u llvm-www/DevMtgMay2007.html:1.47 llvm-www/DevMtgMay2007.html:1.48
--- llvm-www/DevMtgMay2007.html:1.47Thu Apr  5 13:42:59 2007
+++ llvm-www/DevMtgMay2007.html Thu Apr  5 13:46:44 2007
@@ -30,7 +30,8 @@
 
 Why: To get acquainted, learn how LLVM is used, and exchange 
 ideas.
-Where: http://www.cupertinoinn.com/";>Cupertino Inn 
- 10889 N De Anza Blvd, Cupertino, 95014 - across the street from Apple
+Where: http://www.cupertinoinn.com/";>Cupertino Inn
+ - http://maps.google.com/maps?f=q&hl=en&q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014&sll=37.0625,-95.677068&sspn=48.106236,62.050781&layer=&ie=UTF8&z=16&om=1&iwloc=addr";>10889
 N De Anza Blvd, Cupertino, CA, 95014 - across the street from Apple
 When: May 25, 2007, 8:00am to 6:00pm
 Who: Everyone is invited to participate and present.  If you
 would like to present, please send your ideas to 
@@ -121,10 +122,10 @@
   
 
   SpeakerTopic
-  Chris Lattner, Apple, Inc.
+  Chris Lattner - Apple, Inc.
 Using LLVM to improve OpenGL
   
-  Sarah Thompson, NASA, Ames Research Center
+  Sarah Thompson - NASA, Ames Research Center
 Using LLVM to support model checking, symbolic execution and static
   analysis
   
@@ -204,8 +205,8 @@
   one hotel. Please contact Reid if you are interested.
   Tanya Lattner reports:
   I have stayed at both the Cupertino Inn and Hilton Garden 
Inn. 
-   The Hilton is nicer but the Cupertino Inn is acceptable and within walking 
-   distance. The Hilton may have a shuttle.  The meeting is actually being
+   The Hilton is nicer but the Cupertino Inn is acceptable. The Hilton may 
+   have a shuttle.  The meeting is actually being
held in a room at the Cupertino Inn this year.
   Bill Wendling reports:
   http://www.thecypresshotel.com/";>The Cypress 
Hotel
@@ -286,6 +287,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/04/05 18:42:59 $
+Last modified: $Date: 2007/04/05 18:46:44 $
 
 



___
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-05-PadBeforeZeroLengthField.c

2007-04-05 Thread Dale Johannesen


Changes in directory llvm/test/CFrontend:

2007-04-05-PadBeforeZeroLengthField.c added (r1.1)
---
Log message:

testcase for padding before zero-length fields.


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

 2007-04-05-PadBeforeZeroLengthField.c |9 +
 1 files changed, 9 insertions(+)


Index: llvm/test/CFrontend/2007-04-05-PadBeforeZeroLengthField.c
diff -c /dev/null llvm/test/CFrontend/2007-04-05-PadBeforeZeroLengthField.c:1.1
*** /dev/null   Thu Apr  5 14:05:53 2007
--- llvm/test/CFrontend/2007-04-05-PadBeforeZeroLengthField.c   Thu Apr  5 
14:05:43 2007
***
*** 0 
--- 1,9 
+ // RUN: %llvmgcc %s -S -o -
+ struct c__ { unsigned int type:4; };
+ union A { struct c__ c;  } __attribute__((aligned(8)));
+ struct B {
+ unsigned int retainCount;
+ union A objects[];
+ };
+ void foo(union A * objects, struct B *array, unsigned long k)
+ {  array->objects[k] = objects[k]; }



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


[llvm-commits] [125748] Handle padding before zero-length fields.

2007-04-05 Thread johannes
Revision: 125748
Author:   johannes
Date: 2007-04-05 12:09:17 -0700 (Thu, 05 Apr 2007)

Log Message:
---
Handle padding before zero-length fields.  Handle consecutive
zero-length fields as the comment indicates they should be.

Modified Paths:
--
apple-local/branches/llvm/gcc/llvm-types.cpp

Modified: apple-local/branches/llvm/gcc/llvm-types.cpp
===
--- apple-local/branches/llvm/gcc/llvm-types.cpp2007-04-05 18:56:15 UTC 
(rev 125747)
+++ apple-local/branches/llvm/gcc/llvm-types.cpp2007-04-05 19:09:17 UTC 
(rev 125748)
@@ -1063,12 +1063,23 @@
   return ~0U;
 }
 
-// Handle zero sized fields now.  If the next field is zero sized, return
-// it.  This is a nicety that causes us to assign C fields different LLVM
-// fields in cases like struct X {}; struct Y { struct X a, b, c };
+// Handle zero sized fields now.
+
+// Skip over LLVM fields that start and end before the GCC field starts.
+// Such fields are always nonzero sized, and we don't want to skip past 
+// zero sized ones as well, which happens if you use only the Offset
+// comparison.
+while (CurFieldNo < ElementOffsetInBytes.size() &&
+   getFieldEndOffsetInBytes(CurFieldNo)*8 <= FieldOffsetInBits &&
+   ElementSizeInBytes[CurFieldNo] != 0)
+  ++CurFieldNo;
+
+// If the next field is zero sized, advance past this one.  This is a 
nicety 
+// that causes us to assign C fields different LLVM fields in cases like 
+// struct X {}; struct Y { struct X a, b, c };
 if (CurFieldNo+1 < ElementOffsetInBytes.size() &&
 ElementSizeInBytes[CurFieldNo+1] == 0) {
-  return ++CurFieldNo;
+  return CurFieldNo++;
 }
 
 // Otherwise, if this is a zero sized field, return it.


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


[llvm-commits] CVS: llvm-www/DevMtgMay2007.html

2007-04-05 Thread Reid Spencer


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.48 -> 1.49
---
Log message:

Add Scott Michel's talk.


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

 DevMtgMay2007.html |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm-www/DevMtgMay2007.html
diff -u llvm-www/DevMtgMay2007.html:1.48 llvm-www/DevMtgMay2007.html:1.49
--- llvm-www/DevMtgMay2007.html:1.48Thu Apr  5 13:46:44 2007
+++ llvm-www/DevMtgMay2007.html Thu Apr  5 16:07:22 2007
@@ -129,6 +129,8 @@
 Using LLVM to support model checking, symbolic execution and static
   analysis
   
+  Scott MichelBuilding The Cell BE Symbiotic Processor Element
+  Backend: Practice and Experience
 
 
 
@@ -287,6 +289,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/04/05 18:46:44 $
+Last modified: $Date: 2007/04/05 21:07:22 $
 
 



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


[llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp

2007-04-05 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/IPO:

GlobalOpt.cpp updated: 1.99 -> 1.100
---
Log message:

Fix Transforms/GlobalOpt/2007-04-05-Crash.ll


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

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


Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.99 
llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.100
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.99  Thu Mar  1 18:28:51 2007
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp   Thu Apr  5 16:09:42 2007
@@ -1347,7 +1347,7 @@
 if (GV->getType()->getElementType() != Type::Int1Ty &&
 !GV->getType()->getElementType()->isFloatingPoint() &&
 !isa(GV->getType()->getElementType()) &&
-!GS.HasPHIUser) {
+!GS.HasPHIUser && !GS.isNotSuitableForSRA) {
   DOUT << "   *** SHRINKING TO BOOL: " << *GV;
   ShrinkGlobalToBoolean(GV, SOVConstant);
   ++NumShrunkToBool;



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


[llvm-commits] CVS: llvm/test/Transforms/GlobalOpt/2007-04-05-Crash.ll

2007-04-05 Thread Chris Lattner


Changes in directory llvm/test/Transforms/GlobalOpt:

2007-04-05-Crash.ll added (r1.1)
---
Log message:

new testcase that  crashes globalopt



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

 2007-04-05-Crash.ll |   34 ++
 1 files changed, 34 insertions(+)


Index: llvm/test/Transforms/GlobalOpt/2007-04-05-Crash.ll
diff -c /dev/null llvm/test/Transforms/GlobalOpt/2007-04-05-Crash.ll:1.1
*** /dev/null   Thu Apr  5 16:09:39 2007
--- llvm/test/Transforms/GlobalOpt/2007-04-05-Crash.ll  Thu Apr  5 16:09:29 2007
***
*** 0 
--- 1,34 
+ ; RUN: llvm-as < %s | opt -globalopt -disable-output
+ 
+ target datalayout = 
"e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32"
+ target triple = "thumb-apple-darwin8"
+ @replacementUnichar = internal global i16 -3  ;  [#uses=2]
+ @"L_OBJC_IMAGE_INFO" = internal global [2 x i32] zeroinitializer 
; <[2 x i32]*> [#uses=1]
+ @llvm.used = appending global [1 x i8*] [ i8* bitcast ([2 x i32]* 
@"L_OBJC_IMAGE_INFO" to i8*) ] ; <[1 x i8*]*> [#uses=0]
+ 
+ define i16 @__NSCharToUnicharCFWrapper(i8 zext  %ch) zext  {
+ entry:
+   %iftmp.0.0.in.in = select i1 false, i16* @replacementUnichar, i16* null 
;  [#uses=1]
+   %iftmp.0.0.in = load i16* %iftmp.0.0.in.in  ;  
[#uses=1]
+   ret i16 %iftmp.0.0.in
+ }
+ 
+ define void @__NSASCIICharToUnichar() {
+ entry:
+   ret void
+ }
+ 
+ define void @_NSDefaultCStringEncoding() {
+ entry:
+   call void @__NSSetCStringCharToUnichar( )
+   br i1 false, label %cond_true6, label %cond_next8
+ 
+ cond_true6:   ; preds = %entry
+   store i16 -2, i16* @replacementUnichar
+   ret void
+ 
+ cond_next8:   ; preds = %entry
+   ret void
+ }
+ 
+ declare void @__NSSetCStringCharToUnichar()



___
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/CommandLine.h

2007-04-05 Thread Chris Lattner


Changes in directory llvm/include/llvm/Support:

CommandLine.h updated: 1.58 -> 1.59
---
Log message:

remove the dead removeArgument method, rename Options to OptionsMap.


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

 CommandLine.h |1 -
 1 files changed, 1 deletion(-)


Index: llvm/include/llvm/Support/CommandLine.h
diff -u llvm/include/llvm/Support/CommandLine.h:1.58 
llvm/include/llvm/Support/CommandLine.h:1.59
--- llvm/include/llvm/Support/CommandLine.h:1.58Wed Jan 31 19:43:37 2007
+++ llvm/include/llvm/Support/CommandLine.h Thu Apr  5 16:58:17 2007
@@ -219,7 +219,6 @@
   // occurrences of -ArgStr on the command line.
   //
   void addArgument(const char *ArgStr);
-  void removeArgument(const char *ArgStr);
 
   // Return the width of the option tag for printing...
   virtual unsigned getOptionWidth() const = 0;



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


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

2007-04-05 Thread Chris Lattner


Changes in directory llvm/lib/Support:

CommandLine.cpp updated: 1.82 -> 1.83
---
Log message:

remove the dead removeArgument method, rename Options to OptionsMap.


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

 CommandLine.cpp |   91 ++--
 1 files changed, 30 insertions(+), 61 deletions(-)


Index: llvm/lib/Support/CommandLine.cpp
diff -u llvm/lib/Support/CommandLine.cpp:1.82 
llvm/lib/Support/CommandLine.cpp:1.83
--- llvm/lib/Support/CommandLine.cpp:1.82   Wed Jan 31 19:43:37 2007
+++ llvm/lib/Support/CommandLine.cppThu Apr  5 16:58:17 2007
@@ -75,12 +75,12 @@
 // Basic, shared command line option processing machinery.
 //
 
-static ManagedStatic > Options;
+static ManagedStatic > OptionsMap;
 static ManagedStatic > PositionalOptions;
 
 static Option *getOption(const std::string &Str) {
-  std::map::iterator I = Options->find(Str);
-  return I != Options->end() ? I->second : 0;
+  std::map::iterator I = OptionsMap->find(Str);
+  return I != OptionsMap->end() ? I->second : 0;
 }
 
 static void AddArgument(const char *ArgName, Option *Opt) {
@@ -89,23 +89,31 @@
  << ArgName << "' defined more than once!\n";
   } else {
 // Add argument to the argument map!
-(*Options)[ArgName] = Opt;
+(*OptionsMap)[ArgName] = Opt;
   }
 }
 
-// RemoveArgument - It's possible that the argument is no longer in the map if
-// options have already been processed and the map has been deleted!
-//
-static void RemoveArgument(const char *ArgName, Option *Opt) {
-  if (Options->empty()) return;
-
-#ifndef NDEBUG
-  // This disgusting HACK is brought to you courtesy of GCC 3.3.2, which ICE's
-  // If we pass ArgName directly into getOption here.
-  std::string Tmp = ArgName;
-  assert(getOption(Tmp) == Opt && "Arg not in map!");
-#endif
-  Options->erase(ArgName);
+/// LookupOption - Lookup the option specified by the specified option on the
+/// command line.  If there is a value specified (after an equal sign) return
+/// that as well.
+static Option *LookupOption(const char *&Arg, const char *&Value) {
+  while (*Arg == '-') ++Arg;  // Eat leading dashes
+  
+  const char *ArgEnd = Arg;
+  while (*ArgEnd && *ArgEnd != '=')
+++ArgEnd; // Scan till end of argument name.
+  
+  if (*ArgEnd == '=')  // If we have an equals sign...
+Value = ArgEnd+1;  // Get the value, not the equals
+  
+  
+  if (*Arg == 0) return 0;
+  
+  // Look up the option.
+  std::map &Opts = *OptionsMap;
+  std::map::iterator I =
+Opts.find(std::string(Arg, ArgEnd));
+  return (I != Opts.end()) ? I->second : 0;
 }
 
 static inline bool ProvideOption(Option *Handler, const char *ArgName,
@@ -276,32 +284,9 @@
 free (*i);
 }
 
-/// LookupOption - Lookup the option specified by the specified option on the
-/// command line.  If there is a value specified (after an equal sign) return
-/// that as well.
-static Option *LookupOption(const char *&Arg, const char *&Value) {
-  while (*Arg == '-') ++Arg;  // Eat leading dashes
-
-  const char *ArgEnd = Arg;
-  while (*ArgEnd && *ArgEnd != '=')
-++ArgEnd; // Scan till end of argument name.
-
-  if (*ArgEnd == '=')  // If we have an equals sign...
-Value = ArgEnd+1;  // Get the value, not the equals
-
-
-  if (*Arg == 0) return 0;
-
-  // Look up the option.
-  std::map &Opts = *Options;
-  std::map::iterator I =
-Opts.find(std::string(Arg, ArgEnd));
-  return (I != Opts.end()) ? I->second : 0;
-}
-
 void cl::ParseCommandLineOptions(int &argc, char **argv,
  const char *Overview) {
-  assert((!Options->empty() || !PositionalOptions->empty()) &&
+  assert((!OptionsMap->empty() || !PositionalOptions->empty()) &&
  "No options specified, or ParseCommandLineOptions called more"
  " than once!");
   sys::Path progname(argv[0]);
@@ -314,7 +299,7 @@
   ProgramOverview = Overview;
   bool ErrorParsing = false;
 
-  std::map &Opts = *Options;
+  std::map &Opts = *OptionsMap;
   std::vector &PositionalOpts = *PositionalOptions;
 
   // Check out the positional arguments to collect information about them.
@@ -665,22 +650,6 @@
   }
 }
 
-void Option::removeArgument(const char *ArgStr) {
-  if (ArgStr[0])
-RemoveArgument(ArgStr, this);
-
-  if (getFormattingFlag() == Positional) {
-std::vector::iterator I =
-  std::find(PositionalOptions->begin(), PositionalOptions->end(), this);
-assert(I != PositionalOptions->end() && "Arg not registered!");
-PositionalOptions->erase(I);
-  } else if (getNumOccurrencesFlag() == ConsumeAfter) {
-assert(!PositionalOptions->empty() && (*PositionalOptions)[0] == this &&
-   "Arg not registered correctly!");
-PositionalOptions->erase(PositionalOptions->begin());
-  }
-}
-
 
 // getValueStr - Get the value description string, using "DefaultMsg" if 
nothing
 // has been specified yet.
@@ -900,7 +869,7 @@
 
 // Copy Options into a vector so we can sort them as we like...
 std::vector > Opts;
-copy(Options->

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

2007-04-05 Thread Chris Lattner


Changes in directory llvm/include/llvm/Support:

CommandLine.h updated: 1.59 -> 1.60
---
Log message:

eliminate a virtual method


---
Diffs of the changes:  (+39 -42)

 CommandLine.h |   81 +++---
 1 files changed, 39 insertions(+), 42 deletions(-)


Index: llvm/include/llvm/Support/CommandLine.h
diff -u llvm/include/llvm/Support/CommandLine.h:1.59 
llvm/include/llvm/Support/CommandLine.h:1.60
--- llvm/include/llvm/Support/CommandLine.h:1.59Thu Apr  5 16:58:17 2007
+++ llvm/include/llvm/Support/CommandLine.h Thu Apr  5 17:21:39 2007
@@ -138,9 +138,6 @@
   virtual bool handleOccurrence(unsigned pos, const char *ArgName,
 const std::string &Arg) = 0;
 
-  virtual enum NumOccurrences getNumOccurrencesFlagDefault() const {
-return Optional;
-  }
   virtual enum ValueExpected getValueExpectedFlagDefault() const {
 return ValueOptional;
   }
@@ -163,9 +160,7 @@
   const char *ValueStr; // String describing what the value of this option is
 
   inline enum NumOccurrences getNumOccurrencesFlag() const {
-int NO = Flags & OccurrencesMask;
-return NO ? static_cast(NO)
-  : getNumOccurrencesFlagDefault();
+return (enum NumOccurrences)(Flags & OccurrencesMask);
   }
   inline enum ValueExpected getValueExpectedFlag() const {
 int VE = Flags & ValueMask;
@@ -211,8 +206,9 @@
   void setMiscFlag(enum MiscFlags M) { setFlag(M, M); }
   void setPosition(unsigned pos) { Position = pos; }
 protected:
-  Option() : NumOccurrences(0), Flags(0), Position(0),
- ArgStr(""), HelpStr(""), ValueStr("") {}
+  Option(enum NumOccurrences DefaultOccFlag)
+: NumOccurrences(0), Flags(DefaultOccFlag), Position(0),
+  ArgStr(""), HelpStr(""), ValueStr("") {}
 
 public:
   // addArgument - Tell the system that this Option subclass will handle all
@@ -809,34 +805,35 @@
 
   // One option...
   template
-  opt(const M0t &M0) {
+  opt(const M0t &M0) : Option(Optional) {
 apply(M0, this);
 done();
   }
 
   // Two options...
   template
-  opt(const M0t &M0, const M1t &M1) {
+  opt(const M0t &M0, const M1t &M1) : Option(Optional) {
 apply(M0, this); apply(M1, this);
 done();
   }
 
   // Three options...
   template
-  opt(const M0t &M0, const M1t &M1, const M2t &M2) {
+  opt(const M0t &M0, const M1t &M1, const M2t &M2) : Option(Optional) {
 apply(M0, this); apply(M1, this); apply(M2, this);
 done();
   }
   // Four options...
   template
-  opt(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3) {
+  opt(const M0t &M0, const M1t &M1, const M2t &M2,
+  const M3t &M3) : Option(Optional) {
 apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
 done();
   }
   // Five options...
   template
   opt(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
-  const M4t &M4) {
+  const M4t &M4) : Option(Optional) {
 apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
 apply(M4, this);
 done();
@@ -845,7 +842,7 @@
   template
   opt(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
-  const M4t &M4, const M5t &M5) {
+  const M4t &M4, const M5t &M5) : Option(Optional) {
 apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
 apply(M4, this); apply(M5, this);
 done();
@@ -854,7 +851,7 @@
   template
   opt(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
-  const M4t &M4, const M5t &M5, const M6t &M6) {
+  const M4t &M4, const M5t &M5, const M6t &M6) : Option(Optional) {
 apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
 apply(M4, this); apply(M5, this); apply(M6, this);
 done();
@@ -863,7 +860,8 @@
   template
   opt(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
-  const M4t &M4, const M5t &M5, const M6t &M6, const M7t &M7) {
+  const M4t &M4, const M5t &M5, const M6t &M6,
+  const M7t &M7) : Option(Optional) {
 apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
 apply(M4, this); apply(M5, this); apply(M6, this); apply(M7, this);
 done();
@@ -926,9 +924,6 @@
   std::vector Positions;
   ParserClass Parser;
 
-  virtual enum NumOccurrences getNumOccurrencesFlagDefault() const {
-return ZeroOrMore;
-  }
   virtual enum ValueExpected getValueExpectedFlagDefault() const {
 return Parser.getValueExpectedFlagDefault();
   }
@@ -965,32 +960,33 @@
 
   // One option...
   template
-  list(const M0t &M0) {
+  list(const M0t &M0) : Option(ZeroOrMore) {
 apply(M0, this);
 done();
   }
   // Two options...
   template
-  list(const M0t &M0, const M1t &M1) {
+  list(const M0t &M0, const M1t &M1) : Option(ZeroOrMore) {
 apply(M0, this); apply(M1, this);
 done();
   }
   // Three options...
   template
-  list(const M0t &M0, const M1t &M1, const M2t &M2) {
+  list(const M0t &M0, const M1t &M1, const M2t &M2) : Option(ZeroOrMore) {
 apply(M0, this

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

2007-04-05 Thread Nick Lewycky
Huh? What is the DCE pass doing that the global-dce isn't?

Chris Lattner wrote:
> 
> Changes in directory llvm/tools/llvm-ld:
> 
> Optimize.cpp updated: 1.18 -> 1.19
> ---
> Log message:
> 
> run a late dce pass to clean up extra cruft.
> 
> 
> ---
> Diffs of the changes:  (+1 -0)
> 
>  Optimize.cpp |1 +
>  1 files changed, 1 insertion(+)
> 
> 
> Index: llvm/tools/llvm-ld/Optimize.cpp
> diff -u llvm/tools/llvm-ld/Optimize.cpp:1.18 
> llvm/tools/llvm-ld/Optimize.cpp:1.19
> --- llvm/tools/llvm-ld/Optimize.cpp:1.18  Tue Mar  6 22:41:30 2007
> +++ llvm/tools/llvm-ld/Optimize.cpp   Thu Apr  5 11:50:20 2007
> @@ -201,6 +201,7 @@
>if (!DisableOptimizations) {
>  addPass(Passes, createInstructionCombiningPass());
>  addPass(Passes, createCFGSimplificationPass());
> +addPass(Passes, createDeadCodeEliminationPass());
>  addPass(Passes, createGlobalDCEPass());
>}
>  
> 
> 
> 
> ___
> 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/Generic/bit-intrinsics.ll

2007-04-05 Thread Reid Spencer


Changes in directory llvm/test/CodeGen/Generic:

bit-intrinsics.ll updated: 1.1 -> 1.2
---
Log message:

XFAIL this test for now. It will be a while before I can implement this
intrinsic properly in SDISel.


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

 bit-intrinsics.ll |1 +
 1 files changed, 1 insertion(+)


Index: llvm/test/CodeGen/Generic/bit-intrinsics.ll
diff -u llvm/test/CodeGen/Generic/bit-intrinsics.ll:1.1 
llvm/test/CodeGen/Generic/bit-intrinsics.ll:1.2
--- llvm/test/CodeGen/Generic/bit-intrinsics.ll:1.1 Wed Apr  4 18:48:25 2007
+++ llvm/test/CodeGen/Generic/bit-intrinsics.ll Thu Apr  5 17:57:45 2007
@@ -1,6 +1,7 @@
 ; Make sure this testcase is supported by all code generators. Either the
 ; intrinsic is supported natively or IntrinsicLowering provides it.
 ; RUN: llvm-as < %s | llc
+; XFAIL: *
 
 
 declare i32 @llvm.bit.part.select.i32.i32(i32 %x, i32 %hi, i32 %lo)



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


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

2007-04-05 Thread Chris Lattner
On Thu, 5 Apr 2007, Nick Lewycky wrote:
> Huh? What is the DCE pass doing that the global-dce isn't?

globaldce deletes globals and functions, not  code within functions.

-Chris

> Chris Lattner wrote:
>>
>> Changes in directory llvm/tools/llvm-ld:
>>
>> Optimize.cpp updated: 1.18 -> 1.19
>> ---
>> Log message:
>>
>> run a late dce pass to clean up extra cruft.
>>
>>
>> ---
>> Diffs of the changes:  (+1 -0)
>>
>>  Optimize.cpp |1 +
>>  1 files changed, 1 insertion(+)
>>
>>
>> Index: llvm/tools/llvm-ld/Optimize.cpp
>> diff -u llvm/tools/llvm-ld/Optimize.cpp:1.18 
>> llvm/tools/llvm-ld/Optimize.cpp:1.19
>> --- llvm/tools/llvm-ld/Optimize.cpp:1.18 Tue Mar  6 22:41:30 2007
>> +++ llvm/tools/llvm-ld/Optimize.cpp  Thu Apr  5 11:50:20 2007
>> @@ -201,6 +201,7 @@
>>if (!DisableOptimizations) {
>>  addPass(Passes, createInstructionCombiningPass());
>>  addPass(Passes, createCFGSimplificationPass());
>> +addPass(Passes, createDeadCodeEliminationPass());
>>  addPass(Passes, createGlobalDCEPass());
>>}
>>
>>
>>
>>
>> ___
>> llvm-commits mailing list
>> llvm-commits@cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>

-Chris

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


[llvm-commits] CVS: llvm-www/InTheNews.html

2007-04-05 Thread Reid Spencer


Changes in directory llvm-www:

InTheNews.html updated: 1.14 -> 1.15
---
Log message:

Add CliffHacks: Experimenting with LLVM.


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

 InTheNews.html |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm-www/InTheNews.html
diff -u llvm-www/InTheNews.html:1.14 llvm-www/InTheNews.html:1.15
--- llvm-www/InTheNews.html:1.14Sat Mar 24 02:08:03 2007
+++ llvm-www/InTheNews.html Thu Apr  5 19:05:08 2007
@@ -75,6 +75,8 @@
   Info
 http://www.freshports.org/devel/llvm";>FRESHports LLVM page
 
+http://cliffhacks.blogspot.com/2007/03/experimenting-with-llvm.html";>
+  CliffHacks: Experimenting with LLVM
 http://technorati.com/tag/LLVM";>Technorati Tag LLVM
 http://www.google.com/url?sa=t&ct=res&cd=19&url=http%3A%2F%2Fgcc.gnu.org%2Fml%2Fgcc%2F2003-10%2Fmsg01218.html&ei=czAARqzuKa_giwHtl6DHDA&usg=__UMlQ8OtGF-PBZb1OKgatM0ZF_lM=&sig2=S4qUiyjXs77aUyc4Zho1vA";>
@@ -90,6 +92,6 @@
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
 
-  Last modified: $Date: 2007/03/24 07:08:03 $
+  Last modified: $Date: 2007/04/06 00:05:08 $
 
 



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


[llvm-commits] CVS: llvm-www/InTheNews.html

2007-04-05 Thread Reid Spencer


Changes in directory llvm-www:

InTheNews.html updated: 1.15 -> 1.16
---
Log message:

Use sections. Add section for bloggers.


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

 InTheNews.html |   43 ++-
 1 files changed, 30 insertions(+), 13 deletions(-)


Index: llvm-www/InTheNews.html
diff -u llvm-www/InTheNews.html:1.15 llvm-www/InTheNews.html:1.16
--- llvm-www/InTheNews.html:1.15Thu Apr  5 19:05:08 2007
+++ llvm-www/InTheNews.html Thu Apr  5 19:50:24 2007
@@ -12,6 +12,7 @@
   
   
   
+  News Articles
   2007
   
 http://arstechnica.com/journals/apple.ars/2007/03/19/apple-putting-llvm-to-good-use";>2007-03-20,
@@ -61,22 +62,38 @@
 Lambda the Ultimate, "Udell at OSCON: IronPython news", Ehud
 Lamm.
   
+  Blog Sites
+  Here are some blog sites that discuss LLVM
+  
+http://blogsearch.google.com/blogsearch?q=LLVM";>Google 
BlogSearch For 
+  LLVM
+http://tromey.com/blog/";>Cliffs Of Inanity (T. Romey)
+
+  http://tromey.com/blog/?p=108";>Why LLVM Matters
+  http://tromey.com/blog/?p=15";>LLVM Thoughts
+  http://tromey.com/blog/?p=14";>LLVM Update
+  http://tromey.com/blog/?p=13";>LLVM JIT now 
accessible
+
+http://cliffhacks.blogspot.com/";>CliffHacks (Cliff L.  
Biffle)
+
+  http://cliffhacks.blogspot.com/2007/03/experimenting-with-llvm.html";>
+CliffHacks: Experimenting with LLVM
+
+  
+  LLVM In Distributions
+  The links below reference the status of LLVM in various operating system
+  distributions.
+  
+http://packages.debian.org/unstable/devel/llvm";>Debian 
Package Info
+http://packages.ubuntu.com/dapper/devel/llvm";>Ubuntu Package 
Info
+http://www.freshports.org/devel/llvm";>FRESHports LLVM page
+  
   
+  Other LLVM References
   Here are some other links about LLVM, of general interest.
   
 http://en.wikipedia.org/wiki/LLVM";>Wikipedia Article
-http://freshmeat.net/projects/llvm/";>LLVM's FreshMeat Page
-
-http://blogsearch.google.com/blogsearch?q=LLVM";>Google
-  BlogSearch For LLVM
-http://packages.debian.org/unstable/devel/llvm";>Debian Package
-  Info
-http://packages.ubuntu.com/dapper/devel/llvm";>Ubuntu Package
-  Info
-http://www.freshports.org/devel/llvm";>FRESHports LLVM page
-
-http://cliffhacks.blogspot.com/2007/03/experimenting-with-llvm.html";>
-  CliffHacks: Experimenting with LLVM
+http://freshmeat.net/projects/llvm/";>LLVM's FreshMeat 
Page
 http://technorati.com/tag/LLVM";>Technorati Tag LLVM
 http://www.google.com/url?sa=t&ct=res&cd=19&url=http%3A%2F%2Fgcc.gnu.org%2Fml%2Fgcc%2F2003-10%2Fmsg01218.html&ei=czAARqzuKa_giwHtl6DHDA&usg=__UMlQ8OtGF-PBZb1OKgatM0ZF_lM=&sig2=S4qUiyjXs77aUyc4Zho1vA";>
@@ -92,6 +109,6 @@
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
 
-  Last modified: $Date: 2007/04/06 00:05:08 $
+  Last modified: $Date: 2007/04/06 00:50:24 $
 
 



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


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

2007-04-05 Thread Reid Spencer


Changes in directory llvm/lib/VMCore:

Type.cpp updated: 1.177 -> 1.178
---
Log message:

For PR1209: http://llvm.org/PR1209 :
Implement Type class's ContainedTys without using a std::vector.


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

 Type.cpp |   80 +--
 1 files changed, 63 insertions(+), 17 deletions(-)


Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.177 llvm/lib/VMCore/Type.cpp:1.178
--- llvm/lib/VMCore/Type.cpp:1.177  Wed Mar 21 21:14:48 2007
+++ llvm/lib/VMCore/Type.cppThu Apr  5 21:02:20 2007
@@ -63,11 +63,52 @@
   std::string> > AbstractTypeDescriptions;
 
 Type::Type(const char *Name, TypeID id)
-  : ID(id), Abstract(false),  SubclassData(0), RefCount(0), ForwardType(0) {
+  : ID(id), Abstract(false),  SubclassData(0), RefCount(0), ForwardType(0),
+NumContainedTys(0),  ContainedTys(0) {
   assert(Name && Name[0] && "Should use other ctor if no name!");
   (*ConcreteTypeDescriptions)[this] = Name;
 }
 
+/// Because of the way Type subclasses are allocated, this function is 
necessary
+/// to use the correct kind of "delete" operator to deallocate the Type object.
+/// Some type objects (FunctionTy, StructTy) allocate additional space after 
+/// the space for their derived type to hold the contained types array of
+/// PATypeHandles. Using this allocation scheme means all the PATypeHandles are
+/// allocated with the type object, decreasing allocations and eliminating the
+/// need for a std::vector to be used in the Type class itself. 
+/// @brief Type destruction function
+void Type::destroy() const {
+
+  // Structures and Functions allocate their contained types past the end of
+  // the type object itself. These need to be destroyed differently than the
+  // other types.
+  if (isa(this) || isa(this)) {
+// First, make sure we destruct any PATypeHandles allocated by these
+// subclasses.  They must be manually destructed. 
+for (unsigned i = 0; i < NumContainedTys; ++i)
+  ContainedTys[i].PATypeHandle::~PATypeHandle();
+
+// Now call the destructor for the subclass directly because we're going
+// to delete this as an array of char.
+if (isa(this))
+  ((FunctionType*)this)->FunctionType::~FunctionType();
+else
+  ((StructType*)this)->StructType::~StructType();
+
+// Finally, remove the memory as an array deallocation of the chars it was
+// constructed from.
+delete [] reinterpret_cast(this); 
+
+return;
+  }
+
+  // For all the other type subclasses, there is either no contained types or 
+  // just one (all Sequentials). For Sequentials, the PATypeHandle is not
+  // allocated past the type object, its included directly in the 
SequentialType
+  // class. This means we can safely just do "normal" delete of this object and
+  // all the destructors that need to run will be run.
+  delete this; 
+}
 
 const Type *Type::getPrimitiveType(TypeID IDNumber) {
   switch (IDNumber) {
@@ -330,7 +371,7 @@
   // Structure indexes require 32-bit integer constants.
   if (V->getType() == Type::Int32Ty)
 if (const ConstantInt *CU = dyn_cast(V))
-  return CU->getZExtValue() < ContainedTys.size();
+  return CU->getZExtValue() < NumContainedTys;
   return false;
 }
 
@@ -371,19 +412,19 @@
 FunctionType::FunctionType(const Type *Result,
const std::vector &Params,
bool IsVarArgs, const ParamAttrsList &Attrs) 
-  : DerivedType(FunctionTyID), isVarArgs(IsVarArgs) {
+  : DerivedType(FunctionTyID), isVarArgs(IsVarArgs), ParamAttrs(0) {
+  ContainedTys = reinterpret_cast(this+1);
+  NumContainedTys = Params.size() + 1; // + 1 for result type
   assert((Result->isFirstClassType() || Result == Type::VoidTy ||
  isa(Result)) &&
  "LLVM functions cannot return aggregates");
   bool isAbstract = Result->isAbstract();
-  ContainedTys.reserve(Params.size()+1);
-  ContainedTys.push_back(PATypeHandle(Result, this));
+  new (&ContainedTys[0]) PATypeHandle(Result, this);
 
   for (unsigned i = 0; i != Params.size(); ++i) {
 assert((Params[i]->isFirstClassType() || isa(Params[i])) &&
"Function arguments must be value types!");
-
-ContainedTys.push_back(PATypeHandle(Params[i], this));
+new (&ContainedTys[i+1]) PATypeHandle(Params[i],this);
 isAbstract |= Params[i]->isAbstract();
   }
 
@@ -400,12 +441,13 @@
 
 StructType::StructType(const std::vector &Types, bool isPacked)
   : CompositeType(StructTyID) {
+  ContainedTys = reinterpret_cast(this + 1);
+  NumContainedTys = Types.size();
   setSubclassData(isPacked);
-  ContainedTys.reserve(Types.size());
   bool isAbstract = false;
   for (unsigned i = 0; i < Types.size(); ++i) {
 assert(Types[i] != Type::VoidTy && "Void type for structure field!!");
-ContainedTys.push_back(PATypeHandle(Types[i], this));
+ new (&ContainedTys[i]) PATypeHandle(Types[i], this);
 isAbstract |= Types[i]

[llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h Type.h

2007-04-05 Thread Reid Spencer


Changes in directory llvm/include/llvm:

DerivedTypes.h updated: 1.89 -> 1.90
Type.h updated: 1.105 -> 1.106
---
Log message:

For PR1209: http://llvm.org/PR1209 :
Implement Type class's ContainedTys without using a std::vector.


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

 DerivedTypes.h |   27 +++
 Type.h |   53 +++--
 2 files changed, 50 insertions(+), 30 deletions(-)


Index: llvm/include/llvm/DerivedTypes.h
diff -u llvm/include/llvm/DerivedTypes.h:1.89 
llvm/include/llvm/DerivedTypes.h:1.90
--- llvm/include/llvm/DerivedTypes.h:1.89   Fri Mar 23 13:44:11 2007
+++ llvm/include/llvm/DerivedTypes.hThu Apr  5 21:02:19 2007
@@ -163,6 +163,7 @@
bool IsVarArgs, const ParamAttrsList &Attrs);
 
 public:
+  virtual ~FunctionType() { delete ParamAttrs; }
   /// FunctionType::get - This static method is the primary way of constructing
   /// a FunctionType. 
   ///
@@ -179,9 +180,9 @@
   inline bool isVarArg() const { return isVarArgs; }
   inline const Type *getReturnType() const { return ContainedTys[0]; }
 
-  typedef std::vector::const_iterator param_iterator;
-  param_iterator param_begin() const { return ContainedTys.begin()+1; }
-  param_iterator param_end() const { return ContainedTys.end(); }
+  typedef Type::subtype_iterator param_iterator;
+  param_iterator param_begin() const { return ContainedTys + 1; }
+  param_iterator param_end() const { return &ContainedTys[NumContainedTys]; }
 
   // Parameter type accessors...
   const Type *getParamType(unsigned i) const { return ContainedTys[i+1]; }
@@ -189,7 +190,7 @@
   /// getNumParams - Return the number of fixed parameters this function type
   /// requires.  This does not consider varargs.
   ///
-  unsigned getNumParams() const { return unsigned(ContainedTys.size()-1); }
+  unsigned getNumParams() const { return NumContainedTys - 1; }
 
   bool isStructReturn() const {
 return (getNumParams() && paramHasAttr(1, StructRetAttribute));
@@ -265,14 +266,14 @@
  bool isPacked=false);
 
   // Iterator access to the elements
-  typedef std::vector::const_iterator element_iterator;
-  element_iterator element_begin() const { return ContainedTys.begin(); }
-  element_iterator element_end() const { return ContainedTys.end(); }
+  typedef Type::subtype_iterator element_iterator;
+  element_iterator element_begin() const { return ContainedTys; }
+  element_iterator element_end() const { return 
&ContainedTys[NumContainedTys];}
 
   // Random access to the elements
-  unsigned getNumElements() const { return unsigned(ContainedTys.size()); }
+  unsigned getNumElements() const { return NumContainedTys; }
   const Type *getElementType(unsigned N) const {
-assert(N < ContainedTys.size() && "Element number out of range!");
+assert(N < NumContainedTys && "Element number out of range!");
 return ContainedTys[N];
   }
 
@@ -305,12 +306,14 @@
 /// components out in memory identically.
 ///
 class SequentialType : public CompositeType {
+  PATypeHandle ContainedType; ///< Storage for the single contained type
   SequentialType(const SequentialType &);  // Do not implement!
   const SequentialType &operator=(const SequentialType &); // Do not implement!
 protected:
-  SequentialType(TypeID TID, const Type *ElType) : CompositeType(TID) {
-ContainedTys.reserve(1);
-ContainedTys.push_back(PATypeHandle(ElType, this));
+  SequentialType(TypeID TID, const Type *ElType) 
+: CompositeType(TID), ContainedType(ElType, this) {
+ContainedTys = &ContainedType; 
+NumContainedTys = 1;
   }
 
 public:


Index: llvm/include/llvm/Type.h
diff -u llvm/include/llvm/Type.h:1.105 llvm/include/llvm/Type.h:1.106
--- llvm/include/llvm/Type.h:1.105  Fri Mar 23 13:44:11 2007
+++ llvm/include/llvm/Type.hThu Apr  5 21:02:19 2007
@@ -101,12 +101,18 @@
   mutable unsigned RefCount;
 
   const Type *getForwardedTypeInternal() const;
+
+  // Some Type instances are allocated as arrays, some aren't. So we provide
+  // this method to get the right kind of destruction for the type of Type.
+  void destroy() const; // const is a lie, this does "delete this"!
+
 protected:
   Type(const char *Name, TypeID id);
   explicit Type(TypeID id) : ID(id), Abstract(false), SubclassData(0),
- RefCount(0), ForwardType(0) {}
+ RefCount(0), ForwardType(0), NumContainedTys(0),
+ ContainedTys(0) {}
   virtual ~Type() {
-assert(AbstractTypeUsers.empty());
+assert(AbstractTypeUsers.empty() && "Abstract types remain");
   }
 
   /// Types can become nonabstract later, if they are refined.
@@ -123,19 +129,31 @@
   /// to the more refined type.  Only abstract types can be forwarded.
   mutable const Type *ForwardType;
 
-  /// ContainedTys - The list of types contained by this one.  For example, 
this
-  /// includes the arguments of a function type, the elements

[llvm-commits] CVS: llvm-www/InTheNews.html

2007-04-05 Thread Reid Spencer


Changes in directory llvm-www:

InTheNews.html updated: 1.16 -> 1.17
---
Log message:

Add more blogs.


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

 InTheNews.html |   18 ++
 1 files changed, 6 insertions(+), 12 deletions(-)


Index: llvm-www/InTheNews.html
diff -u llvm-www/InTheNews.html:1.16 llvm-www/InTheNews.html:1.17
--- llvm-www/InTheNews.html:1.16Thu Apr  5 19:50:24 2007
+++ llvm-www/InTheNews.html Thu Apr  5 21:32:10 2007
@@ -63,7 +63,6 @@
 Lamm.
   
   Blog Sites
-  Here are some blog sites that discuss LLVM
   
 http://blogsearch.google.com/blogsearch?q=LLVM";>Google 
BlogSearch For 
   LLVM
@@ -74,23 +73,18 @@
   http://tromey.com/blog/?p=14";>LLVM Update
   http://tromey.com/blog/?p=13";>LLVM JIT now 
accessible
 
-http://cliffhacks.blogspot.com/";>CliffHacks (Cliff L.  
Biffle)
-
-  http://cliffhacks.blogspot.com/2007/03/experimenting-with-llvm.html";>
+http://cliffhacks.blogspot.com/2007/03/experimenting-with-llvm.html";>
 CliffHacks: Experimenting with LLVM
-
+http://ansemond.com/blog/?p=28";>WWDC: LLVM & 3D on the 
Mac
+http://shilbert.com/wp/?p=14";>Homebrew LLVM 1.8 VC8 
patch
   
-  LLVM In Distributions
-  The links below reference the status of LLVM in various operating system
-  distributions.
+  Distributions
   
 http://packages.debian.org/unstable/devel/llvm";>Debian 
Package Info
 http://packages.ubuntu.com/dapper/devel/llvm";>Ubuntu Package 
Info
 http://www.freshports.org/devel/llvm";>FRESHports LLVM page
   
-  
-  Other LLVM References
-  Here are some other links about LLVM, of general interest.
+  Other References
   
 http://en.wikipedia.org/wiki/LLVM";>Wikipedia Article
 http://freshmeat.net/projects/llvm/";>LLVM's FreshMeat 
Page
@@ -109,6 +103,6 @@
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
 
-  Last modified: $Date: 2007/04/06 00:50:24 $
+  Last modified: $Date: 2007/04/06 02:32:10 $
 
 



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


[llvm-commits] CVS: llvm-www/SVNMigration.html

2007-04-05 Thread Reid Spencer


Changes in directory llvm-www:

SVNMigration.html updated: 1.4 -> 1.5
---
Log message:

Update status about SVN Migration.


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

 SVNMigration.html |9 -
 1 files changed, 8 insertions(+), 1 deletion(-)


Index: llvm-www/SVNMigration.html
diff -u llvm-www/SVNMigration.html:1.4 llvm-www/SVNMigration.html:1.5
--- llvm-www/SVNMigration.html:1.4  Tue Apr  3 00:02:58 2007
+++ llvm-www/SVNMigration.html  Thu Apr  5 21:55:25 2007
@@ -4,6 +4,13 @@
 
   This document contains notes about the planned migration of the CVS code
   repository to Subversion.
+  Current Status as 04.05.2007The migration is awaiting some
+  research that needs to be done by UIUC's Technical Services Group. A few
+  issues were raised that could lead to loss of functionality for the project 
if
+  not addressed carefully. We have been building a Subversion repository on a
+  test machine every night for a week now and that automated process seems to 
be
+  working smoothly.  The nightly test with check-out from Subversion is also 
+  working smoothly.
 
 
 
@@ -147,6 +154,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/04/03 05:02:58 $
+Last modified: $Date: 2007/04/06 02:55:25 $
 
 



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


[llvm-commits] CVS: llvm-www/SVNMigration.html

2007-04-05 Thread Reid Spencer


Changes in directory llvm-www:

SVNMigration.html updated: 1.5 -> 1.6
---
Log message:

The Adaptive repository won't be migrated.


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

 SVNMigration.html |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm-www/SVNMigration.html
diff -u llvm-www/SVNMigration.html:1.5 llvm-www/SVNMigration.html:1.6
--- llvm-www/SVNMigration.html:1.5  Thu Apr  5 21:55:25 2007
+++ llvm-www/SVNMigration.html  Thu Apr  5 22:19:47 2007
@@ -30,7 +30,6 @@
 llvm-javajava
 llvm-tvtelevision
 llvm-poolallocpoolalloc
-Adaptiveadaptive
 nightlytest-serversidenightly-test
   
   NOTE: Due to synchronization of commits in the conversion process, 
@@ -154,6 +153,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/04/06 02:55:25 $
+Last modified: $Date: 2007/04/06 03:19:47 $
 
 



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


[llvm-commits] CVS: llvm-www/Users.html

2007-04-05 Thread Chris Lattner


Changes in directory llvm-www:

Users.html updated: 1.3 -> 1.4
---
Log message:

Yes it is silly, but we can't talk about "unreleased products"


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

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


Index: llvm-www/Users.html
diff -u llvm-www/Users.html:1.3 llvm-www/Users.html:1.4
--- llvm-www/Users.html:1.3 Wed Apr  4 09:09:36 2007
+++ llvm-www/Users.html Thu Apr  5 23:03:58 2007
@@ -24,7 +24,7 @@
   
   
 Apple Computer
-OpenGL Engine in MacOS X (Leopard)
+OpenGL Engine
   
 
   
@@ -226,6 +226,6 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
 
 mailto:[EMAIL PROTECTED]">LLVM Development List
-  Last modified: $Date: 2007/04/04 14:09:36 $
+  Last modified: $Date: 2007/04/06 04:03:58 $
 
 



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


[llvm-commits] CVS: llvm-www/Users.html

2007-04-05 Thread Chris Lattner


Changes in directory llvm-www:

Users.html updated: 1.4 -> 1.5
---
Log message:

contrary to popular believe, llvm.org is not vikram's research group web page.


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

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


Index: llvm-www/Users.html
diff -u llvm-www/Users.html:1.4 llvm-www/Users.html:1.5
--- llvm-www/Users.html:1.4 Thu Apr  5 23:03:58 2007
+++ llvm-www/Users.html Fri Apr  6 00:30:10 2007
@@ -129,7 +129,7 @@
 http://www.uiuc.edu";>University of Illinois at 
Urbana-Champaign
 
 
-http://llvm.org";>Vikram Adve's Research Group
+http://www-faculty.cs.uiuc.edu/~vadve/";>Vikram Adve's Research 
Group
 
 All LLVM Group Research Projects
   
@@ -226,6 +226,6 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
 
 mailto:[EMAIL PROTECTED]">LLVM Development List
-  Last modified: $Date: 2007/04/06 04:03:58 $
+  Last modified: $Date: 2007/04/06 05:30:10 $
 
 



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


[llvm-commits] CVS: llvm-www/Users.html

2007-04-05 Thread Chris Lattner


Changes in directory llvm-www:

Users.html updated: 1.5 -> 1.6
---
Log message:

comment this out for now


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

 Users.html |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)


Index: llvm-www/Users.html
diff -u llvm-www/Users.html:1.5 llvm-www/Users.html:1.6
--- llvm-www/Users.html:1.5 Fri Apr  6 00:30:10 2007
+++ llvm-www/Users.html Fri Apr  6 00:41:11 2007
@@ -38,11 +38,11 @@
 Electronic System Level (ESL) to Silicon
   
 
-  
+  
 
   
   
@@ -123,7 +123,6 @@
 
   
 
-  
   
 
 http://www.uiuc.edu";>University of Illinois at 
Urbana-Champaign
@@ -226,6 +225,6 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
 
 mailto:[EMAIL PROTECTED]">LLVM Development List
-  Last modified: $Date: 2007/04/06 05:30:10 $
+  Last modified: $Date: 2007/04/06 05:41:11 $
 
 



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


[llvm-commits] CVS: llvm-www/DevMtgMay2007.html

2007-04-05 Thread Chris Lattner


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.49 -> 1.50
---
Log message:

no comma


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

 DevMtgMay2007.html |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)


Index: llvm-www/DevMtgMay2007.html
diff -u llvm-www/DevMtgMay2007.html:1.49 llvm-www/DevMtgMay2007.html:1.50
--- llvm-www/DevMtgMay2007.html:1.49Thu Apr  5 16:07:22 2007
+++ llvm-www/DevMtgMay2007.html Fri Apr  6 01:17:54 2007
@@ -122,7 +122,7 @@
   
 
   SpeakerTopic
-  Chris Lattner - Apple, Inc.
+  Chris Lattner - Apple Inc.
 Using LLVM to improve OpenGL
   
   Sarah Thompson - NASA, Ames Research Center
@@ -238,14 +238,14 @@
 Bob ArcherAdobe Systems Incorporated.
 Owen AndersonIndependent
 Ryan BrownGoogle
-Evan ChengApple, Inc.
+Evan ChengApple Inc.
 Jeff CohenIndependent
 Han GaoAdobe Systems Incorporated.
-Stuart HastingsApple, Inc.
+Stuart HastingsApple Inc.
 Robert HundtGoogle
-Dale JohannesenApple, Inc.
+Dale JohannesenApple Inc.
 Christopher LambAgeia Technologies, Inc.
-Chris LattnerApple, Inc.
+Chris LattnerApple Inc.
 Andrew LenharthUIUC
   
   
@@ -253,19 +253,19 @@
   
 Confirmed Attendees (Ler-Z)
 NameOrganization
-Julien LerougeApple, Inc.
+Julien LerougeApple Inc.
 Nick LewyckyIndependent
 Gabe McArthurIndependent
 Paul McJonesAdobe Systems Incorporated.
 Scott MichelAerospace
-Steve NaroffApple, Inc.
-Devang PatelApple, Inc.
+Steve NaroffApple Inc.
+Devang PatelApple Inc.
 Fernando Magno Quintao PereiraUCLA
 Chuck RoseAdobe Systems Incorporated.
 Mark SchimmelWind River
 Reid SpencerIndependent
 Sarah ThompsonNASA, Ames Research Center
-Bill WendlingApple, Inc.
+Bill WendlingApple Inc.
 Marcel WeiherMetaObject
   
   
@@ -289,6 +289,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/04/05 21:07:22 $
+Last modified: $Date: 2007/04/06 06:17:54 $
 
 



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


[llvm-commits] CVS: llvm-www/InTheNews.html

2007-04-05 Thread Chris Lattner


Changes in directory llvm-www:

InTheNews.html updated: 1.17 -> 1.18
---
Log message:

Remove the obviously wrong articles for now.


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

 InTheNews.html |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)


Index: llvm-www/InTheNews.html
diff -u llvm-www/InTheNews.html:1.17 llvm-www/InTheNews.html:1.18
--- llvm-www/InTheNews.html:1.17Thu Apr  5 21:32:10 2007
+++ llvm-www/InTheNews.html Fri Apr  6 01:21:42 2007
@@ -18,14 +18,14 @@
 http://arstechnica.com/journals/apple.ars/2007/03/19/apple-putting-llvm-to-good-use";>2007-03-20,
 ars technica, "Apple putting LLVM to good use" (Bossa Conference), 
 Erik Kennedy.
-http://www.osnews.com/story.php?news_id=17136";>2007-02-01,
+
+
+
 http://community.freepascal.org:1/bboards/message?message_id=242806&forum_id=24105";>2007-01-23,
 
 free pascal community, "What About LLVM?", Nicola Lugato
 http://www.automotivedesignline.com/news/197000935;jsessionid=TU3SEN4OSVORYQSNDLQCKH0CJUNN2JVN";>2007-01-22,
@@ -103,6 +103,6 @@
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
 
-  Last modified: $Date: 2007/04/06 02:32:10 $
+  Last modified: $Date: 2007/04/06 06:21:42 $
 
 



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


[llvm-commits] CVS: llvm-test/External/Nurbs/Makefile

2007-04-05 Thread Chris Lattner


Changes in directory llvm-test/External/Nurbs:

Makefile updated: 1.1 -> 1.2
---
Log message:

After changing this from an i/o bound app to a cpu bound app, we need to 
increase the problem size :)


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

 Makefile |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-test/External/Nurbs/Makefile
diff -u llvm-test/External/Nurbs/Makefile:1.1 
llvm-test/External/Nurbs/Makefile:1.2
--- llvm-test/External/Nurbs/Makefile:1.1   Mon Apr 17 02:59:47 2006
+++ llvm-test/External/Nurbs/Makefile   Fri Apr  6 01:51:12 2007
@@ -9,6 +9,6 @@
 LDFLAGS = -lstdc++
 LIBS += -lstdc++
 
-RUN_OPTIONS = /k all timed /t 500 /vsteps 64 /usteps 64 /vcp 20 /ucp 20
+RUN_OPTIONS = /k all timed /t 500 /vsteps 192 /usteps 192 /vcp 20 /ucp 20
 
 include $(LEVEL)/MultiSource/Makefile.multisrc



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