[llvm-commits] [llvm-gcc] Patch needed?

2007-02-18 Thread Reid Spencer
Hi,

I found a situation where the following patch is needed. Building
llvm-gcc head (with cummulative patch) fails with SEGV while compiling
the libstdc++. This patch is a bandaid and I don't know if its the
correct thing or not as TYPE_SIZE(Type) should probably not be null, but
it is.

You can probably replicate this by doing a clean llvm-gcc build
including the latest patches.

Reid.

Index: llvm-types.cpp
===
--- llvm-types.cpp  (revision 276)
+++ llvm-types.cpp  (working copy)
@@ -58,7 +58,7 @@
 // refined and replaced by another LLVM Type. This is achieved by
maintaining
 // a map.

-// Collection of LLVM Types and their names
+// Collection of LLVM Types
 static std::vectorconst Type * LTypes;
 typedef DenseMapconst Type *, unsigned LTypesMapTy;
 static LTypesMapTy LTypesMap;
@@ -212,7 +212,8 @@
 bool isPassedByInvisibleReference(tree Type) {
   // FIXME: Search for TREE_ADDRESSABLE in calls.c, and see if there
are other
   // cases that make arguments automatically passed in by reference.
-  return TREE_ADDRESSABLE(Type);
+  return TREE_ADDRESSABLE(Type) ||
+ (TYPE_SIZE(Type)  TREE_CODE(TYPE_SIZE(Type)) !=
INTEGER_CST);
 }

 /// GetTypeName - Return a fully qualified (with namespace prefixes)
name for


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


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

2007-02-18 Thread Reid Spencer


Changes in directory llvm/include/llvm/ADT:

APInt.h updated: 1.12 - 1.13
---
Log message:

1. unsigned - uint32_t to gaurantee its bit width on all platforms.
   Size matters in this case.
2. Remove the unused whichByte private function, which was also broken.
3. Remove the non-const overload of the getWord function, getWord() is
   never used as an lvalue.
4. Rename some local variables for clarity (e.g. API - Result).


---
Diffs of the changes:  (+47 -56)

 APInt.h |  103 +---
 1 files changed, 47 insertions(+), 56 deletions(-)


Index: llvm/include/llvm/ADT/APInt.h
diff -u llvm/include/llvm/ADT/APInt.h:1.12 llvm/include/llvm/ADT/APInt.h:1.13
--- llvm/include/llvm/ADT/APInt.h:1.12  Sat Feb 17 18:44:22 2007
+++ llvm/include/llvm/ADT/APInt.h   Sun Feb 18 12:42:35 2007
@@ -59,7 +59,8 @@
 ///
 /// @brief Class for arbitrary precision integers.
 class APInt {
-  unsigned BitWidth;  /// The number of bits in this APInt.
+public:
+  uint32_t BitWidth;  /// The number of bits in this APInt.
 
   /// This union is used to store the integer value. When the
   /// integer bit-width = 64, it uses VAL; 
@@ -77,7 +78,7 @@
   /// Here one word's bitwidth equals to that of uint64_t.
   /// @returns the number of words to hold the integer value of this APInt.
   /// @brief Get the number of words.
-  inline unsigned getNumWords() const {
+  inline uint32_t getNumWords() const {
 return (BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
   }
 
@@ -88,24 +89,19 @@
   }
 
   /// @returns the word position for the specified bit position.
-  static inline unsigned whichWord(unsigned bitPosition) { 
+  static inline uint32_t whichWord(uint32_t bitPosition) { 
 return bitPosition / APINT_BITS_PER_WORD; 
   }
 
-  /// @returns the byte position for the specified bit position.
-  static inline unsigned whichByte(unsigned bitPosition) { 
-return (bitPosition % APINT_BITS_PER_WORD) / 8; 
-  }
-
   /// @returns the bit position in a word for the specified bit position 
   /// in APInt.
-  static inline unsigned whichBit(unsigned bitPosition) { 
+  static inline uint32_t whichBit(uint32_t bitPosition) { 
 return bitPosition % APINT_BITS_PER_WORD; 
   }
 
   /// @returns a uint64_t type integer with just bit position at
   /// whichBit(bitPosition) setting, others zero.
-  static inline uint64_t maskBit(unsigned bitPosition) { 
+  static inline uint64_t maskBit(uint32_t bitPosition) { 
 return (static_castuint64_t(1))  whichBit(bitPosition); 
   }
 
@@ -122,35 +118,30 @@
   }
 
   /// @returns the corresponding word for the specified bit position.
-  inline uint64_t getWord(unsigned bitPosition) { 
-return isSingleWord() ? VAL : pVal[whichWord(bitPosition)]; 
-  }
-
-  /// @returns the corresponding word for the specified bit position.
   /// This is a constant version.
-  inline uint64_t getWord(unsigned bitPosition) const { 
+  inline uint64_t getWord(uint32_t bitPosition) const { 
 return isSingleWord() ? VAL : pVal[whichWord(bitPosition)]; 
   }
 
   /// @brief Converts a char array into an integer.
-  void fromString(unsigned numBits, const char *StrStart, unsigned slen, 
+  void fromString(uint32_t numBits, const char *StrStart, uint32_t slen, 
   uint8_t radix);
 
 public:
   /// @brief Create a new APInt of numBits bit-width, and initialized as val.
-  APInt(unsigned numBits, uint64_t val);
+  APInt(uint32_t numBits, uint64_t val);
 
   /// @brief Create a new APInt of numBits bit-width, and initialized as 
   /// bigVal[].
-  APInt(unsigned numBits, unsigned numWords, uint64_t bigVal[]);
+  APInt(uint32_t numBits, uint32_t numWords, uint64_t bigVal[]);
 
   /// @brief Create a new APInt by translating the string represented 
   /// integer value.
-  APInt(unsigned numBits, const std::string Val, uint8_t radix);
+  APInt(uint32_t numBits, const std::string Val, uint8_t radix);
 
   /// @brief Create a new APInt by translating the char array represented
   /// integer value.
-  APInt(unsigned numBits, const char StrStart[], unsigned slen, uint8_t radix);
+  APInt(uint32_t numBits, const char StrStart[], uint32_t slen, uint8_t radix);
 
   /// @brief Copy Constructor.
   APInt(const APInt API);
@@ -258,7 +249,7 @@
   }
 
   /// @brief Array-indexing support.
-  bool operator[](unsigned bitPosition) const;
+  bool operator[](uint32_t bitPosition) const;
 
   /// Compare this APInt with the given APInt RHS 
   /// for the validity of the equality relationship.
@@ -332,24 +323,24 @@
 
   /// Arithmetic right-shift this APInt by shiftAmt.
   /// @brief Arithmetic right-shift function.
-  APInt ashr(unsigned shiftAmt) const;
+  APInt ashr(uint32_t shiftAmt) const;
 
   /// Logical right-shift this APInt by shiftAmt.
   /// @brief Logical right-shift function.
-  APInt lshr(unsigned shiftAmt) const;
+  APInt lshr(uint32_t shiftAmt) const;
 
   /// Left-shift this APInt by shiftAmt.
   /// @brief Left-shift 

Re: [llvm-commits] [llvm-gcc] Patch needed?

2007-02-18 Thread Chris Lattner

On Feb 18, 2007, at 12:03 AM, Reid Spencer wrote:

 Hi,

 I found a situation where the following patch is needed. Building
 llvm-gcc head (with cummulative patch) fails with SEGV while compiling
 the libstdc++. This patch is a bandaid and I don't know if its the
 correct thing or not as TYPE_SIZE(Type) should probably not be  
 null, but
 it is.

 You can probably replicate this by doing a clean llvm-gcc build
 including the latest patches.

Very strange, maybe it just hasn't hit the mirror yet, but mainline  
already has that:

bool isPassedByInvisibleReference(tree Type) {
   // FIXME: Search for TREE_ADDRESSABLE in calls.c, and see if there  
are other
   // cases that make arguments automatically passed in by reference.
   return TREE_ADDRESSABLE(Type) || TREE_CODE(TYPE_SIZE(Type)) !=  
INTEGER_CST;
}

-Chris

 Reid.

 Index: llvm-types.cpp
 ===
 --- llvm-types.cpp  (revision 276)
 +++ llvm-types.cpp  (working copy)
 @@ -58,7 +58,7 @@
  // refined and replaced by another LLVM Type. This is achieved by
 maintaining
  // a map.

 -// Collection of LLVM Types and their names
 +// Collection of LLVM Types
  static std::vectorconst Type * LTypes;
  typedef DenseMapconst Type *, unsigned LTypesMapTy;
  static LTypesMapTy LTypesMap;
 @@ -212,7 +212,8 @@
  bool isPassedByInvisibleReference(tree Type) {
// FIXME: Search for TREE_ADDRESSABLE in calls.c, and see if there
 are other
// cases that make arguments automatically passed in by reference.
 -  return TREE_ADDRESSABLE(Type);
 +  return TREE_ADDRESSABLE(Type) ||
 + (TYPE_SIZE(Type)  TREE_CODE(TYPE_SIZE(Type)) !=
 INTEGER_CST);
  }

  /// GetTypeName - Return a fully qualified (with namespace prefixes)
 name for


 ___
 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] Patch needed?

2007-02-18 Thread Reid Spencer
Chris,

On Sun, 2007-02-18 at 11:57 -0800, Chris Lattner wrote:
 On Feb 18, 2007, at 12:03 AM, Reid Spencer wrote:
 
  Hi,
 
  I found a situation where the following patch is needed. Building
  llvm-gcc head (with cummulative patch) fails with SEGV while compiling
  the libstdc++. This patch is a bandaid and I don't know if its the
  correct thing or not as TYPE_SIZE(Type) should probably not be  
  null, but
  it is.
 
  You can probably replicate this by doing a clean llvm-gcc build
  including the latest patches.
 
 Very strange, maybe it just hasn't hit the mirror yet, but mainline  
 already has that:
 
 bool isPassedByInvisibleReference(tree Type) {
// FIXME: Search for TREE_ADDRESSABLE in calls.c, and see if there  
 are other
// cases that make arguments automatically passed in by reference.
return TREE_ADDRESSABLE(Type) || TREE_CODE(TYPE_SIZE(Type)) !=  
 INTEGER_CST;
 }

The mirror doesn't have (last time I checked) the second term of that
expression. However, if you note my patch below, I changed the second
term from:

TREE_CODE(TYPE_SIZE(Type) != INTEGER_CST

to

(TYPE_SIZE(Type)  TREE_CODE(TYPE_SIZE(Type)) != INTEGER_CST)

the key point being that this logic needs to guard against
TYPE_SIZE(Type) == 0x0 because TREE_CODE(0) leads to SEGV.  This can and
does happen. The question is, should TYPE_SIZE(Type) be 0x0 and if not,
then it should be handled at a higher level in the logic. Note that
isPassedByInvisibleReference only has one caller in the same file.

Reid.

 
 -Chris
 
  Reid.
 
  Index: llvm-types.cpp
  ===
  --- llvm-types.cpp  (revision 276)
  +++ llvm-types.cpp  (working copy)
  @@ -58,7 +58,7 @@
   // refined and replaced by another LLVM Type. This is achieved by
  maintaining
   // a map.
 
  -// Collection of LLVM Types and their names
  +// Collection of LLVM Types
   static std::vectorconst Type * LTypes;
   typedef DenseMapconst Type *, unsigned LTypesMapTy;
   static LTypesMapTy LTypesMap;
  @@ -212,7 +212,8 @@
   bool isPassedByInvisibleReference(tree Type) {
 // FIXME: Search for TREE_ADDRESSABLE in calls.c, and see if there
  are other
 // cases that make arguments automatically passed in by reference.
  -  return TREE_ADDRESSABLE(Type);
  +  return TREE_ADDRESSABLE(Type) ||
  + (TYPE_SIZE(Type)  TREE_CODE(TYPE_SIZE(Type)) !=
  INTEGER_CST);
   }
 
   /// GetTypeName - Return a fully qualified (with namespace prefixes)
  name for
 
 
  ___
  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/SingleSource/UnitTests/Integer/APInt/arith.cpp

2007-02-18 Thread Reid Spencer


Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt:

arith.cpp updated: 1.8 - 1.9
---
Log message:

Make use of ability to print signed values.
Fix a bug in the display of != result.


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

 arith.cpp |   15 ---
 1 files changed, 8 insertions(+), 7 deletions(-)


Index: llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp
diff -u llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.8 
llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.9
--- llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.8Sat Feb 
17 02:18:20 2007
+++ llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cppSun Feb 18 
14:21:27 2007
@@ -21,8 +21,8 @@
 
 static std::string temp_str;
 
-const char* str(const APInt X) {
-  temp_str = X.toString();
+const char* str(const APInt X, bool wantSigned = false) {
+  temp_str = X.toString(10,wantSigned);
   return temp_str.c_str(); 
 }
 
@@ -35,10 +35,10 @@
   APInt umax(APInt::getMaxValue(bitwidth, false));
   APInt smin(APInt::getMinValue(bitwidth, true));
   APInt umin(APInt::getMinValue(bitwidth, false));
-  printf(APInt::getMaxValue(%d, true)  = %s\n, bitwidth, str(smax));
-  printf(APInt::getMaxValue(%d, false) = %s\n, bitwidth, str(umax));
-  printf(APInt::getMinValue(%d, true)  = %s\n, bitwidth, str(smin));
+  printf(APInt::getMinValue(%d, true)  = %s\n, bitwidth, str(smin,true));
+  printf(APInt::getMaxValue(%d, true)  = %s\n, bitwidth, str(smax,true));
   printf(APInt::getMinValue(%d, false) = %s\n, bitwidth, str(umin));
+  printf(APInt::getMaxValue(%d, false) = %s\n, bitwidth, str(umax));
   APInt null = APInt::getNullValue(bitwidth);
   APInt allone = APInt::getAllOnesValue(bitwidth);
   printf(APInt::getNullValue(%d) = %s\n, bitwidth, str(null));
@@ -94,7 +94,8 @@
 x = val.byteSwap();
 printf(val.byteSwap() = %d\n, str(x));
   }
-  printf(val.roundToDouble(true) %d = %f\n, val.roundToDouble(true));
+  printf(val.roundToDouble(false) = %f\n, val.roundToDouble(false));
+  printf(val.roundToDouble(true)  = %f\n, val.roundToDouble(true));
   printf(val.getValue() = );
   if (val.getBitWidth()  64)
 printf(too wide\n);
@@ -136,7 +137,7 @@
   result = v1 - v2;
   printf(v1 -  v2: %s\n, str(result));
   printf(v1 == v2: %d\n, v1 == v2);
-  printf(v1 != v2: %d\n, v1 == v2);
+  printf(v1 != v2: %d\n, v1 != v2);
   printf(v1.eq(v2): %d\n, v1.eq(v2));
   printf(v1.ne(v2): %d\n, v1.ne(v2));
   printf(v1.ult(v2): %d\n, v1.ult(v2));



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


[llvm-commits] CVS: llvm/docs/CommandGuide/index.html

2007-02-18 Thread Reid Spencer


Changes in directory llvm/docs/CommandGuide:

index.html updated: 1.30 - 1.31
---
Log message:

Remove broken links to gccas and gccld.


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

 index.html |8 +---
 1 files changed, 1 insertion(+), 7 deletions(-)


Index: llvm/docs/CommandGuide/index.html
diff -u llvm/docs/CommandGuide/index.html:1.30 
llvm/docs/CommandGuide/index.html:1.31
--- llvm/docs/CommandGuide/index.html:1.30  Sat Dec  2 10:35:42 2006
+++ llvm/docs/CommandGuide/index.html   Sun Feb 18 14:37:44 2007
@@ -96,12 +96,6 @@
 lia href=html/llvmgxx.htmlbllvmg++/b/a -
 GCC-based C++ front-end for LLVM/li
 
-lia href=html/gccas.htmlbgccas/b/a -
-compile-time optimizer used by llvm-g++ and llvm-gcc/li
-
-lia href=html/gccld.htmlbgccld/b/a -
-linker and link-time optimizer used by llvm-g++ and llvm-gcc/li
-
 lia href=html/stkrc.htmlbstkrc/b/a -
 front-end compiler for the a href=../Stacker.htmlStacker/a 
 language/li
@@ -159,7 +153,7 @@
   src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a
 
   a href=http://llvm.org;LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2006/12/02 16:35:42 $
+  Last modified: $Date: 2007/02/18 20:37:44 $
 /address
 
 /body



___
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/StripDeadPrototypes.cpp

2007-02-18 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/IPO:

StripDeadPrototypes.cpp updated: 1.3 - 1.4
---
Log message:

simplify pass, delete dead gvar protos as well.


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

 StripDeadPrototypes.cpp |   37 +
 1 files changed, 21 insertions(+), 16 deletions(-)


Index: llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
diff -u llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.3 
llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.4
--- llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.3 Mon Feb  5 15:47:39 2007
+++ llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp Sun Feb 18 16:10:34 2007
@@ -12,13 +12,12 @@
 //
 
//===--===//
 
+#define DEBUG_TYPE strip-dead-prototypes
 #include llvm/Transforms/IPO.h
 #include llvm/Pass.h
 #include llvm/Module.h
 #include llvm/ADT/Statistic.h
-#include llvm/Support/Debug.h
 #include llvm/Support/Compiler.h
-#include vector
 using namespace llvm;
 
 STATISTIC(NumDeadPrototypes, Number of dead prototypes removed);
@@ -37,24 +36,30 @@
 } // end anonymous namespace
 
 bool StripDeadPrototypesPass::runOnModule(Module M) {
-  // Collect all the functions we want to erase
-  std::vectorFunction* FuncsToErase;
-  for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-if (I-isDeclaration()  // Function must be only a prototype
-I-use_empty()) { // Function must not be used
-  FuncsToErase.push_back((*I));
+  bool MadeChange = false;
+  
+  // Erase dead function prototypes.
+  for (Module::iterator I = M.begin(), E = M.end(); I != E; ) {
+Function *F = I++;
+// Function must be a prototype and unused.
+if (F-isDeclaration()  F-use_empty()) {
+  F-eraseFromParent();
+  ++NumDeadPrototypes;
+  MadeChange = true;
 }
+  }
 
-  // Erase the functions
-  for (std::vectorFunction*::iterator I = FuncsToErase.begin(), 
-   E = FuncsToErase.end(); I != E; ++I )
-(*I)-eraseFromParent();
+  // Erase dead function prototypes.
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+   I != E; ) {
+GlobalVariable *GV = I++;
+// Global must be a prototype and unused.
+if (GV-isDeclaration()  GV-use_empty())
+  GV-eraseFromParent();
+  }
   
-  // Increment the statistic
-  NumDeadPrototypes += FuncsToErase.size();
-
   // Return an indication of whether we changed anything or not.
-  return !FuncsToErase.empty();
+  return MadeChange;
 }
 
 ModulePass *llvm::createStripDeadPrototypesPass() {



___
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/StripDeadPrototypes.cpp

2007-02-18 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/IPO:

StripDeadPrototypes.cpp updated: 1.4 - 1.5
---
Log message:

fix comment


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

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


Index: llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
diff -u llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.4 
llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.5
--- llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.4 Sun Feb 18 16:10:34 2007
+++ llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp Sun Feb 18 16:10:58 2007
@@ -49,7 +49,7 @@
 }
   }
 
-  // Erase dead function prototypes.
+  // Erase dead global var prototypes.
   for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ) {
 GlobalVariable *GV = I++;



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


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

2007-02-18 Thread Reid Spencer


Changes in directory llvm/lib/Support:

APInt.cpp updated: 1.20 - 1.21
---
Log message:

1. Fix some indentation and variable names in the get{Min,Max}Value methods.
2. Implement toString for power-of-2 radix without using divide and always
   printing full words. This allows hex/binary to look at the bit 
   respresentation of the APInt as well as avoid bugs in divide.


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

 APInt.cpp |   32 
 1 files changed, 24 insertions(+), 8 deletions(-)


Index: llvm/lib/Support/APInt.cpp
diff -u llvm/lib/Support/APInt.cpp:1.20 llvm/lib/Support/APInt.cpp:1.21
--- llvm/lib/Support/APInt.cpp:1.20 Sun Feb 18 14:09:41 2007
+++ llvm/lib/Support/APInt.cpp  Sun Feb 18 16:29:05 2007
@@ -675,8 +675,22 @@
 return result;
   }
 
+  if (radix != 10) {
+uint64_t mask = radix - 1;
+uint32_t shift = (radix == 16 ? 4 : radix  == 8 ? 3 : 1);
+uint32_t nibbles = APINT_BITS_PER_WORD / shift;
+for (uint32_t i = 0; i  getNumWords(); ++i) {
+  uint64_t value = pVal[i];
+  for (uint32_t j = 0; j  nibbles; ++j) {
+result.insert(0, digits[ value  mask ]);
+value = shift;
+  }
+}
+return result;
+  }
+
   APInt tmp(*this);
-  APInt divisor(tmp.getBitWidth(), radix);
+  APInt divisor(tmp.getBitWidth(), 10);
   APInt zero(tmp.getBitWidth(), 0);
   size_t insert_at = 0;
   if (wantSigned  tmp[BitWidth-1]) {
@@ -705,19 +719,21 @@
 /// for an APInt of the specified bit-width and if isSign == true,
 /// it should be largest signed value, otherwise unsigned value.
 APInt APInt::getMaxValue(uint32_t numBits, bool isSign) {
-  APInt APIVal(numBits, 0);
-  APIVal.set();
-  if (isSign) APIVal.clear(numBits - 1);
-  return APIVal;
+  APInt Result(numBits, 0);
+  Result.set();
+  if (isSign) 
+Result.clear(numBits - 1);
+  return Result;
 }
 
 /// getMinValue - This function returns the smallest value for
 /// an APInt of the given bit-width and if isSign == true,
 /// it should be smallest signed value, otherwise zero.
 APInt APInt::getMinValue(uint32_t numBits, bool isSign) {
-  APInt APIVal(numBits, 0);
-  if (isSign) APIVal.set(numBits - 1);
-  return APIVal;
+  APInt Result(numBits, 0);
+  if (isSign) 
+Result.set(numBits - 1);
+  return Result;
 }
 
 /// getAllOnesValue - This function returns an all-ones value for



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


[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp

2007-02-18 Thread Reid Spencer


Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt:

arith.cpp updated: 1.9 - 1.10
---
Log message:

Consolidate printing of APInt into a single functions.
Always print both the decimal and hexadecimal representations of an APInt.


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

 arith.cpp |  100 +++---
 1 files changed, 50 insertions(+), 50 deletions(-)


Index: llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp
diff -u llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.9 
llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.10
--- llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.9Sun Feb 
18 14:21:27 2007
+++ llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cppSun Feb 18 
16:29:58 2007
@@ -16,18 +16,18 @@
 using namespace llvm;
 
 APInt x(21, 0x1f);
-
 APInt y(21, 0x0f);
 
-static std::string temp_str;
-
-const char* str(const APInt X, bool wantSigned = false) {
-  temp_str = X.toString(10,wantSigned);
-  return temp_str.c_str(); 
+void print(const APInt X, bool wantSigned = false, bool withNL = true) {
+  std::string decstr = X.toString(10,wantSigned);
+  std::string hexstr = X.toString(16,false);
+  printf(%s (%s), decstr.c_str(), hexstr.c_str());
+  if (withNL)
+printf(\n);
 }
 
 void test_interface(const APInt val) {
-  printf(INTERFACE TEST: val = %s\n, str(val));
+  printf(INTERFACE TEST: val = ); print(val);
   unsigned bitwidth = val.getBitWidth();
   unsigned pos = rand() % bitwidth;
   printf(val[%u] = %d\n, pos, val[pos]);
@@ -35,54 +35,54 @@
   APInt umax(APInt::getMaxValue(bitwidth, false));
   APInt smin(APInt::getMinValue(bitwidth, true));
   APInt umin(APInt::getMinValue(bitwidth, false));
-  printf(APInt::getMinValue(%d, true)  = %s\n, bitwidth, str(smin,true));
-  printf(APInt::getMaxValue(%d, true)  = %s\n, bitwidth, str(smax,true));
-  printf(APInt::getMinValue(%d, false) = %s\n, bitwidth, str(umin));
-  printf(APInt::getMaxValue(%d, false) = %s\n, bitwidth, str(umax));
+  printf(APInt::getMinValue(%d, true)  = , bitwidth); print(smin,true);
+  printf(APInt::getMaxValue(%d, true)  = , bitwidth); print(smax,true);
+  printf(APInt::getMinValue(%d, false) = , bitwidth); print(umin);
+  printf(APInt::getMaxValue(%d, false) = , bitwidth); print(umax);
   APInt null = APInt::getNullValue(bitwidth);
   APInt allone = APInt::getAllOnesValue(bitwidth);
-  printf(APInt::getNullValue(%d) = %s\n, bitwidth, str(null));
-  printf(APInt::getAllOnesValue(%d) = %s\n, bitwidth, str(allone));
+  printf(APInt::getNullValue(%d) = , bitwidth); print(null);
+  printf(APInt::getAllOnesValue(%d) = , bitwidth); print(allone);
   APInt x(val);
   x.set(pos);
-  printf(val.set(%d) = %s\n, pos, str(x));
+  printf(val.set(%d) = , pos);  print(x);
   x.set();
-  printf(val.set() = %s\n, str(x));
+  printf(val.set() = ); print(x);
   x = val;
   x.clear(pos);
-  printf(val.clear(%d) = %s\n, pos, str(x));
+  printf(val.clear(%d) = , pos);  print(x);
   x.clear();
-  printf(val.clear() = %s\n, str(x));
+  printf(val.clear() = ); print(x);
   x = val;
   x.flip(pos);
-  printf(val.flip(%d) = %s\n, pos, str(x));
+  printf(val.flip(%d) = , pos); print(x);
   x = val;
   x.flip();
-  printf(val.flip() = %s\n, str(x));
+  printf(val.flip() = ); print(x);
   unsigned bitsize = bitwidth / 2;
-  printf(val.getHiBits(%d) = %s\n, bitsize, str(val.getHiBits(bitsize)));
-  printf(val.getLoBits(%d) = %s\n, bitsize, str(val.getLoBits(bitsize)));
+  printf(val.getHiBits(%d) = , bitsize); print(val.getHiBits(bitsize));
+  printf(val.getLoBits(%d) = , bitsize); print(val.getLoBits(bitsize));
   printf(val.isIntN(%d) = %d\n, bitwidth, val.isIntN(bitwidth));
 }
 
 void test_unops(const APInt val) {
-  printf(UNARY OPERATORS TEST: val = %s\n, str(val));
+  printf(UNARY OPERATORS TEST: val = ); print(val);
   APInt x(val);
   x++;
-  printf(val++ = %s\n, str(x));
+  printf(val++ = ); print(x);
   x = val;
   ++x;
-  printf(++val = %s\n, str(x));
+  printf(++val = ); print(x);
   x = val;
   x--;
-  printf(val-- = %s\n, str(x));
+  printf(val-- = ); print(x);
   x = val;
   --x;
-  printf(--val = %s\n, str(x));
+  printf(--val = ); print(x);
   x = -val;
-  printf(-val = %s\n, str(x));
+  printf(-val = ); print(x);
   x = ~val;
-  printf(~val = %s\n, str(x));
+  printf(~val = ); print(x);
   printf(!val = %d\n, !val);
   printf(val.isPowerOf2() = %d\n, val.isPowerOf2());
   printf(val.logBase2() = %d\n, val.logBase2());
@@ -92,7 +92,7 @@
   printf(val.getBitWidth() = %d\n, val.getBitWidth());
   if (val.getBitWidth() = 16  val.getBitWidth() % 16 == 0) {
 x = val.byteSwap();
-printf(val.byteSwap() = %d\n, str(x));
+printf(val.byteSwap() = ); print(x);
   }
   printf(val.roundToDouble(false) = %f\n, val.roundToDouble(false));
   printf(val.roundToDouble(true)  = %f\n, val.roundToDouble(true));
@@ -104,38 +104,38 @@
 }
 
 void test_binops(const APInt v1, const APInt v2) {
-  printf(BINARY OPERATORS TEST: vl 

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

2007-02-18 Thread Reid Spencer


Changes in directory llvm/include/llvm/ADT:

APInt.h updated: 1.13 - 1.14
---
Log message:

Add some new constants.


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

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


Index: llvm/include/llvm/ADT/APInt.h
diff -u llvm/include/llvm/ADT/APInt.h:1.13 llvm/include/llvm/ADT/APInt.h:1.14
--- llvm/include/llvm/ADT/APInt.h:1.13  Sun Feb 18 12:42:35 2007
+++ llvm/include/llvm/ADT/APInt.h   Sun Feb 18 21:18:22 2007
@@ -72,7 +72,8 @@
 
   /// This enum is just used to hold a constant we needed for APInt.
   enum {
-APINT_BITS_PER_WORD = sizeof(uint64_t) * 8
+APINT_BITS_PER_WORD = sizeof(uint64_t) * 8,
+APINT_WORD_SIZE = sizeof(uint64_t)
   };
 
   /// Here one word's bitwidth equals to that of uint64_t.



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

2007-02-18 Thread Reid Spencer


Changes in directory llvm/lib/Target/ARM:

ARMRegisterInfo.cpp updated: 1.67 - 1.68
ARMRegisterInfo.h updated: 1.8 - 1.9
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


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

 ARMRegisterInfo.cpp |   15 ---
 ARMRegisterInfo.h   |2 --
 2 files changed, 17 deletions(-)


Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp
diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.67 
llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.68
--- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.67Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Sun Feb 18 21:20:00 2007
@@ -28,7 +28,6 @@
 #include llvm/Target/TargetFrameInfo.h
 #include llvm/Target/TargetMachine.h
 #include llvm/Target/TargetOptions.h
-#include llvm/ADT/BitVector.h
 #include llvm/ADT/SmallVector.h
 #include llvm/ADT/STLExtras.h
 #include algorithm
@@ -298,20 +297,6 @@
   return CalleeSavedRegClasses;
 }
 
-BitVector ARMRegisterInfo::getReservedRegs(const MachineFunction MF) const {
-  BitVector Reserved(getNumRegs());
-  Reserved.set(ARM::SP);
-  if (STI.isTargetDarwin() || hasFP(MF))
-Reserved.set(FramePtr);
-  // Some targets reserve R9.
-  if (STI.isR9Reserved())
-Reserved.set(ARM::R9);
-  // At PEI time, if LR is used, it will be spilled upon entry.
-  if (MF.getUsedPhysregs()  !MF.isPhysRegUsed((unsigned)ARM::LR))
-Reserved.set(ARM::LR);
-  return Reserved;
-}
-
 /// hasFP - Return true if the specified function should have a dedicated frame
 /// pointer register.  This is true if the function has variable sized allocas
 /// or if frame pointer elimination is disabled.


Index: llvm/lib/Target/ARM/ARMRegisterInfo.h
diff -u llvm/lib/Target/ARM/ARMRegisterInfo.h:1.8 
llvm/lib/Target/ARM/ARMRegisterInfo.h:1.9
--- llvm/lib/Target/ARM/ARMRegisterInfo.h:1.8   Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/ARM/ARMRegisterInfo.h   Sun Feb 18 21:20:00 2007
@@ -67,8 +67,6 @@
 
   const TargetRegisterClass* const* getCalleeSavedRegClasses() const;
 
-  BitVector getReservedRegs(const MachineFunction MF) const;
-
   bool hasFP(const MachineFunction MF) const;
 
   void eliminateCallFramePseudoInstr(MachineFunction MF,



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


[llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h LiveVariables.h MachineBasicBlock.h MachineInstr.h

2007-02-18 Thread Reid Spencer


Changes in directory llvm/include/llvm/CodeGen:

LiveIntervalAnalysis.h updated: 1.69 - 1.70
LiveVariables.h updated: 1.33 - 1.34
MachineBasicBlock.h updated: 1.56 - 1.57
MachineInstr.h updated: 1.210 - 1.211
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


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

 LiveIntervalAnalysis.h |   18 ++
 LiveVariables.h|9 -
 MachineBasicBlock.h|   13 +++--
 MachineInstr.h |4 
 4 files changed, 9 insertions(+), 35 deletions(-)


Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.69 
llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.70
--- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.69   Sat Feb 17 
05:15:40 2007
+++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.hSun Feb 18 21:20:00 2007
@@ -118,11 +118,6 @@
   return I-second;
 }
 
-bool hasInterval(unsigned reg) const {
-  Reg2IntervalMap::const_iterator I = r2iMap_.find(reg);
-  return I != r2iMap_.end();
-}
-
 /// getMBBStartIdx - Return the base index of the first instruction in the
 /// specified MachineBasicBlock.
 unsigned getMBBStartIdx(MachineBasicBlock *MBB) const {
@@ -194,7 +189,6 @@
 /// copies that cannot yet be coallesced into the TryAgain list.
 void CopyCoallesceInMBB(MachineBasicBlock *MBB,
 std::vectorCopyRec TryAgain);
-
 /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg,
 /// which are the src/dst of the copy instruction CopyMI.  This returns 
true
 /// if the copy was successfully coallesced away, or if it is never 
possible
@@ -239,9 +233,6 @@
LiveInterval interval,
unsigned SrcReg);
 
-/// handleLiveInRegister - Create interval for a livein register.
-void handleLiveInRegister(MachineBasicBlock* mbb, LiveInterval interval);
-
 /// Return true if the two specified registers belong to different
 /// register classes.  The registers may be either phys or virt regs.
 bool differingRegisterClasses(unsigned RegA, unsigned RegB) const;
@@ -250,16 +241,11 @@
 bool AdjustCopiesBackFrom(LiveInterval IntA, LiveInterval IntB,
   MachineInstr *CopyMI);
 
-/// hasRegisterUse - Returns true if there is any use of the specific
-/// reg between indexes Start and End.
-bool hasRegisterUse(unsigned Reg, unsigned Start, unsigned End);
+bool overlapsAliases(const LiveInterval *lhs,
+ const LiveInterval *rhs) const;
 
 static LiveInterval createInterval(unsigned Reg);
 
-void removeInterval(unsigned Reg) {
-  r2iMap_.erase(Reg);
-}
-
 LiveInterval getOrCreateInterval(unsigned reg) {
   Reg2IntervalMap::iterator I = r2iMap_.find(reg);
   if (I == r2iMap_.end())


Index: llvm/include/llvm/CodeGen/LiveVariables.h
diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.33 
llvm/include/llvm/CodeGen/LiveVariables.h:1.34
--- llvm/include/llvm/CodeGen/LiveVariables.h:1.33  Sat Feb 17 05:07:08 2007
+++ llvm/include/llvm/CodeGen/LiveVariables.h   Sun Feb 18 21:20:00 2007
@@ -36,7 +36,6 @@
 namespace llvm {
 
 class MRegisterInfo;
-class BitVector;
 
 class LiveVariables : public MachineFunctionPass {
 public:
@@ -109,11 +108,11 @@
   ///
   std::vectorVarInfo VirtRegInfo;
 
-  /// ReservedRegisters - This vector keeps track of which registers
-  /// are reserved register which are not allocatable by the target machine.
-  /// We can not track liveness for values that are in this set.
+  /// AllocatablePhysicalRegisters - This vector keeps track of which registers
+  /// are actually register allocatable by the target machine.  We can not 
track
+  /// liveness for values that are not in this set.
   ///
-  BitVector ReservedRegisters;
+  BitVector AllocatablePhysicalRegisters;
 
 private:   // Intermediate data structures
   const MRegisterInfo *RegInfo;


Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h
diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.56 
llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.57
--- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.56  Sat Feb 17 05:07:41 2007
+++ llvm/include/llvm/CodeGen/MachineBasicBlock.h   Sun Feb 18 21:20:00 2007
@@ -138,18 +138,11 @@
   /// is an error to add the same register to the same set more than once.
   void addLiveIn(unsigned Reg)  { LiveIns.push_back(Reg); }
 
-  /// removeLiveIn - Remove the specified register from the live in set.
-  ///
-  void removeLiveIn(unsigned Reg);
-
   // Iteration support for live in sets.  These sets are kept in sorted
   // order by their register number.
-  typedef std::vectorunsigned::iterator   livein_iterator;
-  typedef std::vectorunsigned::const_iterator 

[llvm-commits] CVS: llvm/lib/Target/IA64/IA64RegisterInfo.cpp IA64RegisterInfo.h

2007-02-18 Thread Reid Spencer


Changes in directory llvm/lib/Target/IA64:

IA64RegisterInfo.cpp updated: 1.29 - 1.30
IA64RegisterInfo.h updated: 1.12 - 1.13
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


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

 IA64RegisterInfo.cpp |   14 --
 IA64RegisterInfo.h   |2 --
 2 files changed, 16 deletions(-)


Index: llvm/lib/Target/IA64/IA64RegisterInfo.cpp
diff -u llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.29 
llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.30
--- llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.29  Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/IA64/IA64RegisterInfo.cpp   Sun Feb 18 21:20:00 2007
@@ -28,7 +28,6 @@
 #include llvm/Target/TargetOptions.h
 #include llvm/Target/TargetInstrInfo.h
 #include llvm/Support/CommandLine.h
-#include llvm/ADT/BitVector.h
 #include llvm/ADT/STLExtras.h
 using namespace llvm;
 
@@ -107,19 +106,6 @@
   return CalleeSavedRegClasses;
 }
 
-BitVector IA64RegisterInfo::getReservedRegs(const MachineFunction MF) const {
-  BitVector Reserved(getNumRegs());
-  Reserved.set(IA64::r0);
-  Reserved.set(IA64::r1);
-  Reserved.set(IA64::r2);
-  Reserved.set(IA64::r5);
-  Reserved.set(IA64::r12);
-  Reserved.set(IA64::r13);
-  Reserved.set(IA64::r22);
-  Reserved.set(IA64::rp);
-  return Reserved;
-}
-
 
//===--===//
 // Stack Frame Processing methods
 
//===--===//


Index: llvm/lib/Target/IA64/IA64RegisterInfo.h
diff -u llvm/lib/Target/IA64/IA64RegisterInfo.h:1.12 
llvm/lib/Target/IA64/IA64RegisterInfo.h:1.13
--- llvm/lib/Target/IA64/IA64RegisterInfo.h:1.12Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/IA64/IA64RegisterInfo.h Sun Feb 18 21:20:00 2007
@@ -48,8 +48,6 @@
 
   const TargetRegisterClass* const* getCalleeSavedRegClasses() const;
 
-  BitVector getReservedRegs(const MachineFunction MF) const;
-
   bool hasFP(const MachineFunction MF) const;
 
   void eliminateCallFramePseudoInstr(MachineFunction MF,



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


[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp AlphaRegisterInfo.h

2007-02-18 Thread Reid Spencer


Changes in directory llvm/lib/Target/Alpha:

AlphaRegisterInfo.cpp updated: 1.58 - 1.59
AlphaRegisterInfo.h updated: 1.18 - 1.19
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


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

 AlphaRegisterInfo.cpp |9 -
 AlphaRegisterInfo.h   |2 --
 2 files changed, 11 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp
diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.58 
llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.59
--- llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.58Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp Sun Feb 18 21:20:00 2007
@@ -28,7 +28,6 @@
 #include llvm/Target/TargetInstrInfo.h
 #include llvm/Support/CommandLine.h
 #include llvm/Support/Debug.h
-#include llvm/ADT/BitVector.h
 #include llvm/ADT/STLExtras.h
 #include cstdlib
 using namespace llvm;
@@ -179,14 +178,6 @@
   return CalleeSavedRegClasses;
 }
 
-BitVector AlphaRegisterInfo::getReservedRegs(const MachineFunction MF) const {
-  BitVector Reserved(getNumRegs());
-  Reserved.set(Alpha::R15);
-  Reserved.set(Alpha::R30);
-  Reserved.set(Alpha::R31);
-  return Reserved;
-}
-
 
//===--===//
 // Stack Frame Processing methods
 
//===--===//


Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.h
diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.18 
llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.19
--- llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.18  Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/Alpha/AlphaRegisterInfo.h   Sun Feb 18 21:20:00 2007
@@ -49,8 +49,6 @@
 
   const TargetRegisterClass* const* getCalleeSavedRegClasses() const;
 
-  BitVector getReservedRegs(const MachineFunction MF) const;
-
   bool hasFP(const MachineFunction MF) const;
 
   void eliminateCallFramePseudoInstr(MachineFunction MF,



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


[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCRegisterInfo.h

2007-02-18 Thread Reid Spencer


Changes in directory llvm/lib/Target/PowerPC:

PPCRegisterInfo.cpp updated: 1.106 - 1.107
PPCRegisterInfo.h updated: 1.25 - 1.26
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


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

 PPCRegisterInfo.cpp |   39 +--
 PPCRegisterInfo.h   |2 --
 2 files changed, 9 insertions(+), 32 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.106 
llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.107
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.106   Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Sun Feb 18 21:20:00 2007
@@ -34,7 +34,6 @@
 #include llvm/Support/CommandLine.h
 #include llvm/Support/Debug.h
 #include llvm/Support/MathExtras.h
-#include llvm/ADT/BitVector.h
 #include llvm/ADT/STLExtras.h
 #include cstdlib
 using namespace llvm;
@@ -339,35 +338,6 @@
Darwin32_CalleeSavedRegClasses;
 }
 
-// needsFP - Return true if the specified function should have a dedicated 
frame
-// pointer register.  This is true if the function has variable sized allocas 
or
-// if frame pointer elimination is disabled.
-//
-static bool needsFP(const MachineFunction MF) {
-  const MachineFrameInfo *MFI = MF.getFrameInfo();
-  return NoFramePointerElim || MFI-hasVarSizedObjects();
-}
-
-BitVector PPCRegisterInfo::getReservedRegs(const MachineFunction MF) const {
-  BitVector Reserved(getNumRegs());
-  Reserved.set(PPC::R0);
-  Reserved.set(PPC::R1);
-  Reserved.set(PPC::LR);
-  // In Linux, r2 is reserved for the OS.
-  if (!Subtarget.isDarwin())
-Reserved.set(PPC::R2);
-  // On PPC64, r13 is the thread pointer.  Never allocate this register.
-  // Note that this is overconservative, as it also prevents allocation of
-  // R31 when the FP is not needed.
-  if (Subtarget.isPPC64()) {
-Reserved.set(PPC::R13);
-Reserved.set(PPC::R31);
-  }
-  if (needsFP(MF))
-Reserved.set(PPC::R31);
-  return Reserved;
-}
-
 /// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into
 /// copy instructions, turning them into load/store instructions.
 MachineInstr *PPCRegisterInfo::foldMemoryOperand(MachineInstr *MI,
@@ -428,6 +398,15 @@
 // Stack Frame Processing methods
 
//===--===//
 
+// needsFP - Return true if the specified function should have a dedicated 
frame
+// pointer register.  This is true if the function has variable sized allocas 
or
+// if frame pointer elimination is disabled.
+//
+static bool needsFP(const MachineFunction MF) {
+  const MachineFrameInfo *MFI = MF.getFrameInfo();
+  return NoFramePointerElim || MFI-hasVarSizedObjects();
+}
+
 // hasFP - Return true if the specified function actually has a dedicated frame
 // pointer register.  This is true if the function needs a frame pointer and 
has
 // a non-zero stack size.


Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.h
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.25 
llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.26
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.25  Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.h   Sun Feb 18 21:20:00 2007
@@ -58,8 +58,6 @@
 
   const TargetRegisterClass* const* getCalleeSavedRegClasses() const;
 
-  BitVector getReservedRegs(const MachineFunction MF) const;
-
   /// targetHandlesStackFrameRounding - Returns true if the target is
   /// responsible for rounding up the stack frame (probably at emitPrologue
   /// time).



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

2007-02-18 Thread Reid Spencer


Changes in directory llvm/include/llvm/Target:

MRegisterInfo.h updated: 1.92 - 1.93
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


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

 MRegisterInfo.h |   17 -
 1 files changed, 17 deletions(-)


Index: llvm/include/llvm/Target/MRegisterInfo.h
diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.92 
llvm/include/llvm/Target/MRegisterInfo.h:1.93
--- llvm/include/llvm/Target/MRegisterInfo.h:1.92   Sat Feb 17 05:04:35 2007
+++ llvm/include/llvm/Target/MRegisterInfo.hSun Feb 18 21:20:00 2007
@@ -284,17 +284,6 @@
 return false;
   }
 
-  /// regsOverlap - Returns true if the two registers are equal or alias
-  /// each other. The registers may be virtual register.
-  bool regsOverlap(unsigned regA, unsigned regB) const {
-if (regA == regB)
-  return true;
-
-if (isVirtualRegister(regA) || isVirtualRegister(regB))
-  return false;
-return areAliases(regA, regB);
-  }
-
   /// getCalleeSavedRegs - Return a null-terminated list of all of the
   /// callee saved registers on this target. The register should be in the
   /// order of desired callee-save stack frame offset. The first register is
@@ -306,12 +295,6 @@
   /// length of this list match the getCalleeSaveRegs() list.
   virtual const TargetRegisterClass* const *getCalleeSavedRegClasses() const 
=0;
 
-  /// getReservedRegs - Returns a bitset indexed by physical register number
-  /// indicating if a register is a special register that has particular uses 
and
-  /// should be considered unavailable at all times, e.g. SP, RA. This is used 
by
-  /// register scavenger to determine what registers are free.
-  virtual BitVector getReservedRegs(const MachineFunction MF) const = 0;
-
   
//======//
   // Register Class Information
   //



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

2007-02-18 Thread Reid Spencer


Changes in directory llvm/lib/Target/X86:

X86RegisterInfo.cpp updated: 1.201 - 1.202
X86RegisterInfo.h updated: 1.46 - 1.47
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


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

 X86RegisterInfo.cpp |   16 
 X86RegisterInfo.h   |6 --
 2 files changed, 22 deletions(-)


Index: llvm/lib/Target/X86/X86RegisterInfo.cpp
diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.201 
llvm/lib/Target/X86/X86RegisterInfo.cpp:1.202
--- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.201   Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/X86/X86RegisterInfo.cpp Sun Feb 18 21:20:00 2007
@@ -31,7 +31,6 @@
 #include llvm/Target/TargetMachine.h
 #include llvm/Target/TargetOptions.h
 #include llvm/Support/CommandLine.h
-#include llvm/ADT/BitVector.h
 #include llvm/ADT/STLExtras.h
 using namespace llvm;
 
@@ -884,21 +883,6 @@
   return Is64Bit ? CalleeSavedRegClasses64Bit : CalleeSavedRegClasses32Bit;
 }
 
-BitVector X86RegisterInfo::getReservedRegs(const MachineFunction MF) const {
-  BitVector Reserved(getNumRegs());
-  Reserved.set(X86::RSP);
-  Reserved.set(X86::ESP);
-  Reserved.set(X86::SP);
-  Reserved.set(X86::SPL);
-  if (hasFP(MF)) {
-Reserved.set(X86::RBP);
-Reserved.set(X86::EBP);
-Reserved.set(X86::BP);
-Reserved.set(X86::BPL);
-  }
-  return Reserved;
-}
-
 
//===--===//
 // Stack Frame Processing methods
 
//===--===//


Index: llvm/lib/Target/X86/X86RegisterInfo.h
diff -u llvm/lib/Target/X86/X86RegisterInfo.h:1.46 
llvm/lib/Target/X86/X86RegisterInfo.h:1.47
--- llvm/lib/Target/X86/X86RegisterInfo.h:1.46  Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/X86/X86RegisterInfo.h   Sun Feb 18 21:20:00 2007
@@ -78,12 +78,6 @@
   /// length of this list match the getCalleeSavedRegs() list.
   const TargetRegisterClass* const* getCalleeSavedRegClasses() const;
 
-  /// getReservedRegs - Returns a bitset indexed by physical register number
-  /// indicating if a register is a special register that has particular uses 
and
-  /// should be considered unavailable at all times, e.g. SP, RA. This is used 
by
-  /// register scavenger to determine what registers are free.
-  BitVector getReservedRegs(const MachineFunction MF) const;
-
   bool hasFP(const MachineFunction MF) const;
 
   void eliminateCallFramePseudoInstr(MachineFunction MF,



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


[llvm-commits] CVS: llvm/lib/Target/Sparc/SparcRegisterInfo.cpp SparcRegisterInfo.h

2007-02-18 Thread Reid Spencer


Changes in directory llvm/lib/Target/Sparc:

SparcRegisterInfo.cpp updated: 1.52 - 1.53
SparcRegisterInfo.h updated: 1.18 - 1.19
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


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

 SparcRegisterInfo.cpp |   17 -
 SparcRegisterInfo.h   |2 --
 2 files changed, 19 deletions(-)


Index: llvm/lib/Target/Sparc/SparcRegisterInfo.cpp
diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.52 
llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.53
--- llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.52Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/Sparc/SparcRegisterInfo.cpp Sun Feb 18 21:20:00 2007
@@ -20,7 +20,6 @@
 #include llvm/CodeGen/MachineLocation.h
 #include llvm/Target/TargetInstrInfo.h
 #include llvm/Type.h
-#include llvm/ADT/BitVector.h
 #include llvm/ADT/STLExtras.h
 using namespace llvm;
 
@@ -117,22 +116,6 @@
   return CalleeSavedRegs;
 }
 
-BitVector SparcRegisterInfo::getReservedRegs(const MachineFunction MF) const {
-  BitVector Reserved(getNumRegs());
-  Reserved.set(SP::G2);
-  Reserved.set(SP::G3);
-  Reserved.set(SP::G4);
-  Reserved.set(SP::O6);
-  Reserved.set(SP::I6);
-  Reserved.set(SP::I7);
-  Reserved.set(SP::G0);
-  Reserved.set(SP::G5);
-  Reserved.set(SP::G6);
-  Reserved.set(SP::G7);
-  return Reserved;
-}
-
-
 const TargetRegisterClass* const*
 SparcRegisterInfo::getCalleeSavedRegClasses() const {
   static const TargetRegisterClass * const CalleeSavedRegClasses[] = { 0 };


Index: llvm/lib/Target/Sparc/SparcRegisterInfo.h
diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.18 
llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.19
--- llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.18  Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/Sparc/SparcRegisterInfo.h   Sun Feb 18 21:20:00 2007
@@ -52,8 +52,6 @@
 
   const TargetRegisterClass* const* getCalleeSavedRegClasses() const;
 
-  BitVector getReservedRegs(const MachineFunction MF) const;
-
   bool hasFP(const MachineFunction MF) const;
 
   void eliminateCallFramePseudoInstr(MachineFunction MF,



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


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

2007-02-18 Thread Reid Spencer


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.20 - 1.21
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


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

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


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.20 
llvm/lib/Target/MRegisterInfo.cpp:1.21
--- llvm/lib/Target/MRegisterInfo.cpp:1.20  Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/MRegisterInfo.cpp   Sun Feb 18 21:20:00 2007
@@ -41,7 +41,7 @@
 const TargetRegisterClass *RC = *I;
 for (TargetRegisterClass::iterator I = RC-allocation_order_begin(MF),
E = RC-allocation_order_end(MF); I != E; ++I)
-  Allocatable.set(*I);
+  Allocatable[*I] = true;
   }
   return Allocatable;
 }



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


[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp LiveVariables.cpp MachineBasicBlock.cpp MachineInstr.cpp RegAllocLinearScan.cpp

2007-02-18 Thread Reid Spencer


Changes in directory llvm/lib/CodeGen:

LiveIntervalAnalysis.cpp updated: 1.207 - 1.208
LiveVariables.cpp updated: 1.66 - 1.67
MachineBasicBlock.cpp updated: 1.40 - 1.41
MachineInstr.cpp updated: 1.142 - 1.143
RegAllocLinearScan.cpp updated: 1.138 - 1.139
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


---
Diffs of the changes:  (+85 -163)

 LiveIntervalAnalysis.cpp |  188 +--
 LiveVariables.cpp|   36 +++--
 MachineBasicBlock.cpp|8 --
 MachineInstr.cpp |   11 --
 RegAllocLinearScan.cpp   |5 -
 5 files changed, 85 insertions(+), 163 deletions(-)


Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.207 
llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.208
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.207 Sat Feb 17 05:15:40 2007
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp   Sun Feb 18 21:20:00 2007
@@ -98,6 +98,28 @@
 // Set the MBB2IdxMap entry for this MBB.
 MBB2IdxMap[MBB-getNumber()] = MIIndex;
 
+// If this BB has any live ins, insert a dummy instruction at the
+// beginning of the function that we will pretend defines the values. 
This
+// is to make the interval analysis simpler by providing a number.
+if (MBB-livein_begin() != MBB-livein_end()) {
+  unsigned FirstLiveIn = *MBB-livein_begin();
+
+  // Find a reg class that contains this live in.
+  const TargetRegisterClass *RC = 0;
+  for (MRegisterInfo::regclass_iterator RCI = mri_-regclass_begin(),
+ RCE = mri_-regclass_end(); RCI != RCE; ++RCI)
+if ((*RCI)-contains(FirstLiveIn)) {
+  RC = *RCI;
+  break;
+}
+
+  MachineInstr *OldFirstMI = MBB-begin();
+  mri_-copyRegToReg(*MBB, MBB-begin(),
+ FirstLiveIn, FirstLiveIn, RC);
+  assert(OldFirstMI != MBB-begin() 
+ copyRetToReg didn't insert anything!);
+}
+
 for (MachineBasicBlock::iterator I = MBB-begin(), E = MBB-end();
  I != E; ++I) {
   bool inserted = mi2iMap_.insert(std::make_pair(I, MIIndex)).second;
@@ -139,16 +161,7 @@
   if (tii_-isMoveInstr(*mii, srcReg, dstReg) 
   (RegRep = rep(srcReg)) == rep(dstReg)) {
 // remove from def list
-LiveInterval RegInt = getOrCreateInterval(RegRep);
-MachineOperand *MO = mii-findRegisterDefOperand(dstReg);
-// If def of this move instruction is dead, remove its live range from
-// the dstination register's live interval.
-if (MO-isDead()) {
-  unsigned MoveIdx = getDefIndex(getInstructionIndex(mii));
-  RegInt.removeRange(*RegInt.FindLiveRangeContaining(MoveIdx));
-  if (RegInt.empty())
-removeInterval(RegRep);
-}
+getOrCreateInterval(RegRep);
 RemoveMachineInstrFromMaps(mii);
 mii = mbbi-erase(mii);
 ++numPeep;
@@ -172,6 +185,7 @@
 }
   }
 
+  
   for (iterator I = begin(), E = end(); I != E; ++I) {
 LiveInterval LI = I-second;
 if (MRegisterInfo::isVirtualRegister(LI.reg)) {
@@ -656,43 +670,6 @@
   }
 }
 
-void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB,
- LiveInterval interval) {
-  DOUT  \t\tlivein register: ; DEBUG(printRegName(interval.reg));
-
-  // Look for kills, if it reaches a def before it's killed, then it shouldn't
-  // be considered a livein.
-  MachineBasicBlock::iterator mi = MBB-begin();
-  unsigned baseIndex = 0;
-  unsigned start = 0;
-  unsigned end = start;
-  while (mi != MBB-end()) {
-if (lv_-KillsRegister(mi, interval.reg)) {
-  DOUT   killed;
-  end = getUseIndex(baseIndex) + 1;
-  goto exit;
-} else if (lv_-ModifiesRegister(mi, interval.reg)) {
-  // Another instruction redefines the register before it is ever read.
-  // Then the register is essentially dead at the instruction that defines
-  // it. Hence its interval is:
-  // [defSlot(def), defSlot(def)+1)
-  DOUT   dead;
-  end = getDefIndex(start) + 1;
-  goto exit;
-}
-
-baseIndex += InstrSlots::NUM;
-++mi;
-  }
-
-exit:
-  assert(start  end  did not find end of interval?);
-
-  LiveRange LR(start, end, interval.getNextValue(~0U, 0));
-  interval.addRange(LR);
-  DOUT   +  LR  '\n';
-}
-
 /// computeIntervals - computes the live intervals for virtual
 /// registers. for some ordering of the machine instructions [1,N] a
 /// live interval is an interval [i, j) where 1 = i = j  N for
@@ -711,13 +688,17 @@
 MachineBasicBlock::iterator MI = MBB-begin(), miEnd = MBB-end();
 
 if (MBB-livein_begin() != MBB-livein_end()) {
-  // Create intervals for live-ins to this BB first.
-  for (MachineBasicBlock::const_livein_iterator LI = MBB-livein_begin(),
+  // Process live-ins to this BB first.
+  for 

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

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

CodingStandards.html updated: 1.35 - 1.36
---
Log message:

clarify the 'developed by' line


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

 CodingStandards.html |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)


Index: llvm/docs/CodingStandards.html
diff -u llvm/docs/CodingStandards.html:1.35 llvm/docs/CodingStandards.html:1.36
--- llvm/docs/CodingStandards.html:1.35 Sat Feb 10 12:35:31 2007
+++ llvm/docs/CodingStandards.html  Sun Feb 18 21:33:06 2007
@@ -134,7 +134,7 @@
 // 
 // The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
+// This file was developed by lt;whoever started the filegt; and is 
distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
 // 
 
//===--===//
@@ -146,7 +146,9 @@
 /pre
 /div
 
-pA few things to note about this particular format:  The tt-*- C++
+pA few things to note about this particular format:  The 'developed by' line
+should be the name of the person or organization who initially contributed the 
+file.  The tt-*- C++
 -*-/tt string on the first line is there to tell Emacs that the source file
 is a C++ file, not a C file (Emacs assumes .h files are C files by default).
 Note that this tag is not necessary in .cpp files.  The name of the file is 
also
@@ -760,7 +762,7 @@
 
   a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr
   a href=http://llvm.org;LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/02/10 18:35:31 $
+  Last modified: $Date: 2007/02/19 03:33:06 $
 /address
 
 /body



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


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

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

DeveloperPolicy.html updated: 1.19 - 1.20
---
Log message:

A bunch of editting.  I'm still not done with the 'patches' section.



---
Diffs of the changes:  (+224 -202)

 DeveloperPolicy.html |  426 ++-
 1 files changed, 224 insertions(+), 202 deletions(-)


Index: llvm/docs/DeveloperPolicy.html
diff -u llvm/docs/DeveloperPolicy.html:1.19 llvm/docs/DeveloperPolicy.html:1.20
--- llvm/docs/DeveloperPolicy.html:1.19 Wed Feb 14 19:11:54 2007
+++ llvm/docs/DeveloperPolicy.html  Sun Feb 18 21:50:31 2007
@@ -6,44 +6,37 @@
   link rel=stylesheet href=llvm.css type=text/css
 /head
 body
-  div class=doc_warningDRAFT Only. DRAFT Only. DRAFT Only. DRAFT 
Only./div
   
 div class=doc_titleLLVM Developer Policy/div
-table class=layouttr class=layouttd class=layout
-h2Contents/h2
 ol
   lia href=#introductionIntroduction/a/li
   lia href=#generalGeneral Policies/a
   ol
 lia href=#informedStay Informed/a /li
-lia href=#newworkStarting New Work/a/li
+lia href=#newworkStartingnbsp;Newnbsp;Work/a/li
 lia href=#reviewsCode Reviews/a/li
-lia href=#incrementalIncremental Development/a/li
 lia href=#qualityQuality/a/li
 lia href=#testcasesTest Cases/a/li
+lia href=#c_newObtaining Commit Access/a/li
+lia href=#incrementalIncremental Development/a/li
+lia href=#attributionAttribution/a/li
   /ol/li
   lia href=#patchesPatch Policies/a
   ol
 lia href=#p_formPatch Form/a/li
-lia href=#p_testingPatch Testing/a/li
 lia href=#p_submissionPatch Submission/a/li
 lia href=#p_aftersubAfter Submission/a/li
 lia href=#p_aftercommitAfter Commit/a/li
-lia href=#c_accessObtaining Commit Access/a/li
-lia href=#c_newNew Committers/a/li
   /ol/li
   lia href=#candlCopyright and License/a
   ol
-lia href=#attributionAttribution/a/li
 lia href=#copyrightCopyright/a/li
 lia href=#licenseLicense/a/li
 lia href=#devagreeDeveloper Agreements/a/li
   /ol/li
   lia href=#termsTerminology/a/li
-  lia href=#polnotesPolicy Notes/a/li
 /ol
 div class=doc_authorWritten by LLVM Oversight Team/div
-/tdtd class=layout
 
 
!--=--
 div class=doc_sectiona name=introductionIntroduction/a/div
@@ -59,8 +52,7 @@
   ol
 liAttract both users and developers to the LLVM project./li
 liMake life as simple and easy for contributors as possible./li
-liIndicate that LLVM is a mature project with a thriving community and
-sensible policies directing its ongoing development./li
+liKeep the top of tree CVS/SVN trees as stable as possible./li
   /ol
 /div
 
@@ -68,9 +60,12 @@
 div class=doc_sectiona name=generalGeneral Policies/a/div
 
!--=--
 div class=doc_text
-  pThis section contains policies that pertain generally to LLVM developers. 
-  LLVM Developers are expected to meet the following obligations in order 
-  for LLVM to maintain a high standard of quality.p
+  pThis section contains policies that pertain generally to regular LLVM
+  developers.  We always welcome a href=#patchesrandom patches/a from
+  people who do not routinely contribute to LLVM, but expect more from regular
+  contributors to keep the system as efficient as possible for everyone.
+  Regular LLVM developers are expected to meet the following obligations in
+  order for LLVM to maintain a high standard of quality.p
 /div
 
 !-- ___ 
--
@@ -95,78 +90,61 @@
   it back to LLVM, s/he should inform the community with an email to 
   the a href=http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev;llvm-dev/a 
   email list, to the extent possible. The reason for this is to:
-  ul
+  ol
 likeep the community informed about future changes to LLVM, /li
 liavoid duplication of effort by having multiple parties working on the
 same thing and not knowing about it, and/li
 liensure that any technical issues around the proposed work are 
 discussed and resolved before any significant work is done./li
-  /ul
+  /ol
   pThe design of LLVM is carefully controlled to ensure that all the pieces
-  fit together well. If you plan to make a major change to the way LLVM works 
or
+  fit together well and are as consistent as possible. If you plan to make a
+  major change to the way LLVM works or
   a major new extension, it is a good idea to get consensus with the 
development
   community before you start working on it./p
 /div
-/td/tr/table
 
 !-- ___ 
--
 div class=doc_subsection a name=reviewsCode Reviews/a/div
 div class=doc_text
-  pLLVM has a code review policy. Code review is an excellent way to ensure
-  high quality in the software. The following policies apply:/p
+  pLLVM has a code review policy. Code review is one way to 

[llvm-commits] CVS: llvm-stacker/lib/compiler/StackerCompiler.cpp

2007-02-18 Thread Reid Spencer


Changes in directory llvm-stacker/lib/compiler:

StackerCompiler.cpp updated: 1.34 - 1.35
---
Log message:

Adjust to CallInst::CallInst interface changes.


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

 StackerCompiler.cpp |   40 
 1 files changed, 24 insertions(+), 16 deletions(-)


Index: llvm-stacker/lib/compiler/StackerCompiler.cpp
diff -u llvm-stacker/lib/compiler/StackerCompiler.cpp:1.34 
llvm-stacker/lib/compiler/StackerCompiler.cpp:1.35
--- llvm-stacker/lib/compiler/StackerCompiler.cpp:1.34  Mon Feb 12 20:45:57 2007
+++ llvm-stacker/lib/compiler/StackerCompiler.cpp   Sun Feb 18 23:05:07 2007
@@ -746,7 +746,7 @@
 if ( Function* true_func = TheModule-getFunction(ifTrue) )
 {
 true_bb-getInstList().push_back(
-new CallInst( true_func, args ) );
+new CallInst( true_func, args[0], args.size() ) );
 true_bb-getInstList().push_back(
 new BranchInst( exit_bb ) );
 }
@@ -764,7 +764,7 @@
 if ( Function* false_func = TheModule-getFunction(ifFalse) )
 {
 false_bb-getInstList().push_back(
-new CallInst( false_func, args ) );
+new CallInst( false_func, args[0], args.size() ) );
 false_bb-getInstList().push_back(
 new BranchInst( exit_bb ) );
 }
@@ -818,7 +818,8 @@
 std::vectorValue* args;
 if ( Function* body_func = TheModule-getFunction(todo) )
 {
-body-getInstList().push_back( new CallInst( body_func, args ) );
+body-getInstList().push_back( new CallInst( body_func, args[0], 
+ args.size() ) );
 body-getInstList().push_back( new BranchInst( test ) );
 }
 else
@@ -844,7 +845,7 @@
 BasicBlock* bb = new BasicBlock((echo?call:));
 if ( func )
 {
-CallInst* call_def = new CallInst( func , no_arguments );
+CallInst* call_def = new CallInst( func );
 bb-getInstList().push_back( call_def );
 }
 else
@@ -899,7 +900,7 @@
 Constant * f = TheModule-getOrInsertFunction(
 _stacker_dump_stack_, DefinitionType);
 std::vectorValue* args;
-bb-getInstList().push_back( new CallInst( f, args ) );
+bb-getInstList().push_back( new CallInst( f, args[0], args.size()));
 break;
 }
 
@@ -1568,7 +1569,8 @@
 {
 if (echo) bb-setName(RECURSE);
 std::vectorValue* params;
-CallInst* call_inst = new CallInst( TheFunction, params );
+CallInst* call_inst = new CallInst(TheFunction, params[0], 
+   params.size());
 bb-getInstList().push_back( call_inst );
 break;
 }
@@ -1591,7 +1593,7 @@
 // Call exit(3)
 std::vectorValue* params;
 params.push_back(caster);
-CallInst* call_inst = new CallInst( TheExit, params );
+CallInst* call_inst = new CallInst( TheExit, params[0], 
params.size());
 bb-getInstList().push_back( call_inst );
 break;
 }
@@ -1614,7 +1616,8 @@
 std::vectorValue* args;
 args.push_back( format_gep );
 args.push_back( newline );
-bb-getInstList().push_back( new CallInst( ThePrintf, args ) );
+bb-getInstList().push_back( new CallInst(ThePrintf, args[0], 
+  args.size()));
 break;
 }
 case SPACE :
@@ -1636,7 +1639,8 @@
 std::vectorValue* args;
 args.push_back( format_gep );
 args.push_back( newline );
-bb-getInstList().push_back( new CallInst( ThePrintf, args ) );
+bb-getInstList().push_back( new CallInst(ThePrintf, args[0], 
+  args.size()));
 break;
 }
 case CR :
@@ -1658,7 +1662,8 @@
 std::vectorValue* args;
 args.push_back( format_gep );
 args.push_back( newline );
-bb-getInstList().push_back( new CallInst( ThePrintf, args ) );
+bb-getInstList().push_back( new CallInst(ThePrintf, args[0], 
+  args.size()));
 break;
 }
 case IN_STR :
@@ -1680,7 +1685,7 @@
 std::vectorValue* args;
 args.push_back( InStrFormat );
 args.push_back( caster );
-CallInst* scanf = new CallInst( TheScanf, args );
+CallInst* scanf = new CallInst( TheScanf, args[0], args.size());
 bb-getInstList().push_back( scanf );
 
 // Store the result
@@ -1704,7 +1709,7 @@
 std::vectorValue* args;
 args.push_back( InStrFormat );
 args.push_back( gep_value );
-CallInst* scanf = new CallInst( TheScanf, args );
+CallInst* scanf = new CallInst( TheScanf, args[0], args.size());
 bb-getInstList().push_back( scanf );
 
 // Store the result
@@ -1728,7 +1733,7 @@
 std::vectorValue* args;
 

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

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

DeveloperPolicy.html updated: 1.20 - 1.21
---
Log message:

Transmogrify 'Starting New Work' into 'Making a Major Change', add
incremental development as a subsection of it.


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

 DeveloperPolicy.html |   72 +--
 1 files changed, 42 insertions(+), 30 deletions(-)


Index: llvm/docs/DeveloperPolicy.html
diff -u llvm/docs/DeveloperPolicy.html:1.20 llvm/docs/DeveloperPolicy.html:1.21
--- llvm/docs/DeveloperPolicy.html:1.20 Sun Feb 18 21:50:31 2007
+++ llvm/docs/DeveloperPolicy.html  Sun Feb 18 23:43:04 2007
@@ -13,13 +13,15 @@
   lia href=#generalGeneral Policies/a
   ol
 lia href=#informedStay Informed/a /li
-lia href=#newworkStartingnbsp;Newnbsp;Work/a/li
 lia href=#reviewsCode Reviews/a/li
 lia href=#qualityQuality/a/li
 lia href=#testcasesTest Cases/a/li
 lia href=#c_newObtaining Commit Access/a/li
-lia href=#incrementalIncremental Development/a/li
-lia href=#attributionAttribution/a/li
+lia href=#newworkMaking a Major Change/a
+ol
+  lia href=#incrementalIncremental Development/a/li
+/ol/li
+lia href=#attributionAttribution of Changes/a/li
   /ol/li
   lia href=#patchesPatch Policies/a
   ol
@@ -54,6 +56,13 @@
 liMake life as simple and easy for contributors as possible./li
 liKeep the top of tree CVS/SVN trees as stable as possible./li
   /ol
+  
+  pThis policy is aimed at regular contributors to LLVM.  People interested 
in
+  contributing one-off patches can do so in an informal way by sending them to
+  the a href=http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits;
+  llvm-commits mailing list/a and engaging another developer to see it 
through
+  the process./p
+  
 /div
 
 
!--=--
@@ -84,27 +93,6 @@
 /div
 
 !-- ___ 
--
-div class=doc_subsection a name=newworkStarting New Work/a/div
-div class=doc_text
-  pWhen a developer begins a major new project with the aim of contributing 
-  it back to LLVM, s/he should inform the community with an email to 
-  the a href=http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev;llvm-dev/a 
-  email list, to the extent possible. The reason for this is to:
-  ol
-likeep the community informed about future changes to LLVM, /li
-liavoid duplication of effort by having multiple parties working on the
-same thing and not knowing about it, and/li
-liensure that any technical issues around the proposed work are 
-discussed and resolved before any significant work is done./li
-  /ol
-  pThe design of LLVM is carefully controlled to ensure that all the pieces
-  fit together well and are as consistent as possible. If you plan to make a
-  major change to the way LLVM works or
-  a major new extension, it is a good idea to get consensus with the 
development
-  community before you start working on it./p
-/div
-
-!-- ___ 
--
 div class=doc_subsection a name=reviewsCode Reviews/a/div
 div class=doc_text
   pLLVM has a code review policy. Code review is one way to increase the
@@ -226,12 +214,35 @@
 /div
 
 !-- ___ 
--
-div class=doc_subsection a name=incrementalIncremental Development/a
+div class=doc_subsection a name=newworkMaking a Major Change/a/div
+div class=doc_text
+  pWhen a developer begins a major new project with the aim of contributing 
+  it back to LLVM, s/he should inform the community with an email to 
+  the a href=http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev;llvm-dev/a 
+  email list, to the extent possible. The reason for this is to:
+  ol
+likeep the community informed about future changes to LLVM, /li
+liavoid duplication of effort by having multiple parties working on the
+same thing and not knowing about it, and/li
+liensure that any technical issues around the proposed work are 
+discussed and resolved before any significant work is done./li
+  /ol
+  
+  pThe design of LLVM is carefully controlled to ensure that all the pieces
+  fit together well and are as consistent as possible. If you plan to make a
+  major change to the way LLVM works or
+  a major new extension, it is a good idea to get consensus with the 
development
+  community before you start working on it./p
+  
+/div
+
+!-- ___ 
--
+div class=doc_subsubsection a name=incrementalIncremental 
Development/a
 /div
 div class=doc_text
-  pWhen making a large change to LLVM, we use a incremental style of
- development instead of having long-term development branches.  Long-term 
- development branches have a number of drawbacks:/p
+  pOnce the design of the new feature is finalized, the work itself should be
+ done 

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

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

DeveloperPolicy.html updated: 1.21 - 1.22
---
Log message:

remove terminology section (this is not a legal document)
move testcases above quality.  Mention that a testcase is part of quality.


---
Diffs of the changes:  (+33 -57)

 DeveloperPolicy.html |   90 ++-
 1 files changed, 33 insertions(+), 57 deletions(-)


Index: llvm/docs/DeveloperPolicy.html
diff -u llvm/docs/DeveloperPolicy.html:1.21 llvm/docs/DeveloperPolicy.html:1.22
--- llvm/docs/DeveloperPolicy.html:1.21 Sun Feb 18 23:43:04 2007
+++ llvm/docs/DeveloperPolicy.html  Sun Feb 18 23:47:13 2007
@@ -36,7 +36,6 @@
 lia href=#licenseLicense/a/li
 lia href=#devagreeDeveloper Agreements/a/li
   /ol/li
-  lia href=#termsTerminology/a/li
 /ol
 div class=doc_authorWritten by LLVM Oversight Team/div
 
@@ -114,6 +113,33 @@
 else./li
   /ol
 /div
+
+!-- ___ 
--
+div class=doc_subsection a name=testcasesTest Cases/a/div
+div class=doc_text
+  pDevelopers are required to create test cases for any bugs fixed and any 
new
+  features added. The following policies apply:/p
+  ol
+liAll feature and regression test cases must be added to the 
+ttllvm/test/tt directory. The appropriate sub-directory should be 
+selected (see the a href=TestingGuide.htmlTesting Guide/a for 
+details)./li
+liTest cases should be written in 
+a href=LangRef.htmlLLVM assembly language/a unless the
+feature or regression being tested requires another language (e.g. the
+bug being fixed or feature being implemented is in the llvm-gcc C++
+front-end)./li
+liTest cases, especially for regressions, should be reduced as much as 
+possible, by a href=CommandGuide/html/bugpoint.htmlbugpoint/a or
+manually. It is unacceptable 
+to place an entire failing program into ttllvm/test/tt as this creates
+a itime-to-test/i burden on all developers. Please keep them 
short./li
+liMore extensive test cases (applications, benchmarks, etc.) should be 
+added to the ttllvm-test/tt test suite.  This test suite is for 
+coverage: not features or regressions./li
+  /ol
+/div
+
 !-- ___ 
--
 div class=doc_subsection a name=qualityQuality/a/div
 div class=doc_text
@@ -124,14 +150,17 @@
 a href=CodingStandards.htmlLLVM Coding Standards/a./li
 liCode must compile cleanly (no errors, no warnings) on at least one 
 platform./li
-liCode must pass the deja gnu (llvm/test) test suite./li
+liBug fixes and new features should a href=#testcasesinclude a
+testcase/a so we know if the fix/feature ever regresses in the
+future./li
+liCode must pass the dejagnu (llvm/test) test suite./li
 liThe code must not cause regressions on a reasonable subset of 
llvm-test,
 where reasonable depends on the contributor's judgement and the scope
 of the change (more invasive changes require more testing). A 
reasonable
 subset is ttllvm-test/MultiSource/Benchmarks/tt./li
   /ol
   pAdditionally, the committer is responsible for addressing any problems
-  found that the change is responsible for.  For example:/p
+  found in the future that the change is responsible for.  For example:/p
   ul
 liThe code should compile cleanly on all platforms./li
 liThe changes should not cause regressions in the ttllvm-test/tt
@@ -157,32 +186,6 @@
 /div
 
 !-- ___ 
--
-div class=doc_subsection a name=testcasesTest Cases/a/div
-div class=doc_text
-  pDevelopers are required to create test cases for any bugs fixed and any 
new
-  features added. The following policies apply:/p
-  ol
-liAll feature and regression test cases must be added to the 
-ttllvm/test/tt directory. The appropriate sub-directory should be 
-selected (see the a href=TestingGuide.htmlTesting Guide/a for 
-details)./li
-liTest cases should be written in 
-a href=LangRef.htmlLLVM assembly language/a unless the
-feature or regression being tested requires another language (e.g. the
-bug being fixed or feature being implemented is in the llvm-gcc C++
-front-end)./li
-liTest cases, especially for regressions, should be reduced as much as 
-possible, by a href=CommandGuide/html/bugpoint.htmlbugpoint/a or
-manually. It is unacceptable 
-to place an entire failing program into ttllvm/test/tt as this creates
-a itime-to-test/i burden on all developers. Please keep them 
short./li
-liMore extensive test cases (applications, benchmarks, etc.) should be 
-added to the ttllvm-test/tt test suite.  This test suite is for 
-coverage: not features or regressions./li
-  /ol
-/div
-
-!-- ___ 
--
 div class=doc_subsection a 

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

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

DeveloperPolicy.html updated: 1.22 - 1.23
---
Log message:

minor changes


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

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


Index: llvm/docs/DeveloperPolicy.html
diff -u llvm/docs/DeveloperPolicy.html:1.22 llvm/docs/DeveloperPolicy.html:1.23
--- llvm/docs/DeveloperPolicy.html:1.22 Sun Feb 18 23:47:13 2007
+++ llvm/docs/DeveloperPolicy.html  Sun Feb 18 23:49:11 2007
@@ -14,9 +14,9 @@
   ol
 lia href=#informedStay Informed/a /li
 lia href=#reviewsCode Reviews/a/li
-lia href=#qualityQuality/a/li
 lia href=#testcasesTest Cases/a/li
-lia href=#c_newObtaining Commit Access/a/li
+lia href=#qualityQuality/a/li
+lia href=#commitaccessObtaining Commit Access/a/li
 lia href=#newworkMaking a Major Change/a
 ol
   lia href=#incrementalIncremental Development/a/li
@@ -186,7 +186,8 @@
 /div
 
 !-- ___ 
--
-div class=doc_subsection a name=c_newObtaining Commit Access/a/div
+div class=doc_subsection
+  a name=commitaccessObtaining Commit Access/a/div
 div class=doc_text
 
 p
@@ -487,8 +488,7 @@
   assign their copyrights to UIUC for any contribution made so that 
   the entire software base can be managed by a single copyright holder.  This
   implies that any contributions can be licensed under the license that the
-  project uses./li
-  /ul
+  project uses./p
 /div
 
 !-- *** 
--
@@ -501,7 +501,7 @@
   Written by: the 
   a href=mailto:[EMAIL PROTECTED]LLVM Oversight Group/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/02/19 05:47:13 $
+  Last modified: $Date: 2007/02/19 05:49:11 $
 /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/docs/DeveloperPolicy.html

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

DeveloperPolicy.html updated: 1.24 - 1.25
---
Log message:

fix TOC, clarify bullet in incremental dev


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

 DeveloperPolicy.html |   18 +++---
 1 files changed, 7 insertions(+), 11 deletions(-)


Index: llvm/docs/DeveloperPolicy.html
diff -u llvm/docs/DeveloperPolicy.html:1.24 llvm/docs/DeveloperPolicy.html:1.25
--- llvm/docs/DeveloperPolicy.html:1.24 Sun Feb 18 23:57:29 2007
+++ llvm/docs/DeveloperPolicy.html  Sun Feb 18 23:59:30 2007
@@ -24,13 +24,6 @@
 /ol/li
 lia href=#attributionAttribution of Changes/a/li
   /ol/li
-  lia href=#patchesPatch Policies/a
-  ol
-lia href=#p_formPatch Form/a/li
-lia href=#p_submissionPatch Submission/a/li
-lia href=#p_aftersubAfter Submission/a/li
-lia href=#p_aftercommitAfter Commit/a/li
-  /ol/li
   lia href=#candlCopyright and License/a
   ol
 lia href=#copyrightCopyright/a/li
@@ -310,12 +303,15 @@
 liThe remaining inter-related work should be decomposed into unrelated 
 sets of changes if possible.  Once this is done, define the first increment
 and get consensus on what the end goal of the change is./li
-liIncrements can be stand alone (e.g. to fix a bug), or part of a planned
-series of increments towards some development goal./li
-liIncrements should be kept as small as possible. This simplifies your 
+
+liEach change in the set can be stand alone (e.g. to fix a bug), or part
+of a planned series of changes that works towards the development 
goal./li
+
+liEach change should be kept as small as possible. This simplifies your 
 work (into a logical progression), simplifies code review and reduces the
 chance that you will get negative feedback on the change. Small increments
 also facilitate the maintenance of a high quality code base./li
+
 liOften, an independent precursor to a big change is to add a new API and
 slowly migrate clients to use the new API.  Each change to use the new
 API is often obvious and can be committed without review.  Once the 
@@ -460,7 +456,7 @@
   Written by: the 
   a href=mailto:[EMAIL PROTECTED]LLVM Oversight Group/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/02/19 05:57:29 $
+  Last modified: $Date: 2007/02/19 05:59:30 $
 /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/docs/DeveloperPolicy.html

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

DeveloperPolicy.html updated: 1.26 - 1.27
---
Log message:

add strong words about patents


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

 DeveloperPolicy.html |   18 ++
 1 files changed, 14 insertions(+), 4 deletions(-)


Index: llvm/docs/DeveloperPolicy.html
diff -u llvm/docs/DeveloperPolicy.html:1.26 llvm/docs/DeveloperPolicy.html:1.27
--- llvm/docs/DeveloperPolicy.html:1.26 Mon Feb 19 00:05:58 2007
+++ llvm/docs/DeveloperPolicy.html  Mon Feb 19 00:13:50 2007
@@ -442,9 +442,19 @@
 div class=doc_subsectiona name=patentsPatents/a/div
 div class=doc_text
 
-pContributions must not knowingly infringe on any patents. To the best of
-our knowledge, LLVM is free of any existing patent violations and it is our
-intent to keep it that way./p
+pTo the best of our knowledge, LLVM does not infringe on any patents (we have
+   actually removed code from LLVM in the past that was found to infringe).
+   Having code in LLVM that infringes on patents would violate the one of the
+   goals of the project by making it hard or impossible to reuse the code for
+   arbitrary purposes./p
+   
+pWhen contributing code, we expect contributors to notify us of any potential
+   for patent-related trouble with their changes.  If you own the rights to a
+   patent and would like to contribute code to LLVM that relies on it, we
+   require that you sign an agreement that allows any other user of LLVM to
+   freely use your patent.  Please contact the a 
+   href=mailto:[EMAIL PROTECTED]oversight group/a for more
+   details./p
 /div
 
 
@@ -468,7 +478,7 @@
   Written by: the 
   a href=mailto:[EMAIL PROTECTED]LLVM Oversight Group/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/02/19 06:05:58 $
+  Last modified: $Date: 2007/02/19 06:13:50 $
 /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/docs/DeveloperPolicy.html

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

DeveloperPolicy.html updated: 1.27 - 1.28
---
Log message:

wording changes


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

 DeveloperPolicy.html |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)


Index: llvm/docs/DeveloperPolicy.html
diff -u llvm/docs/DeveloperPolicy.html:1.27 llvm/docs/DeveloperPolicy.html:1.28
--- llvm/docs/DeveloperPolicy.html:1.27 Mon Feb 19 00:13:50 2007
+++ llvm/docs/DeveloperPolicy.html  Mon Feb 19 00:15:33 2007
@@ -444,9 +444,9 @@
 
 pTo the best of our knowledge, LLVM does not infringe on any patents (we have
actually removed code from LLVM in the past that was found to infringe).
-   Having code in LLVM that infringes on patents would violate the one of the
-   goals of the project by making it hard or impossible to reuse the code for
-   arbitrary purposes./p
+   Having code in LLVM that infringes on patents would violate an important
+   goal of the project by making it hard or impossible to reuse the code for
+   arbitrary purposes (including commercial use)./p

 pWhen contributing code, we expect contributors to notify us of any potential
for patent-related trouble with their changes.  If you own the rights to a
@@ -475,10 +475,10 @@
   src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a
   a href=http://validator.w3.org/check/referer;img
   src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01! //a
-  Written by: the 
+  Written by the 
   a href=mailto:[EMAIL PROTECTED]LLVM Oversight Group/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/02/19 06:13:50 $
+  Last modified: $Date: 2007/02/19 06:15:33 $
 /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/docs/DeveloperPolicy.html

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

DeveloperPolicy.html updated: 1.28 - 1.29
---
Log message:

rename section to Copyright, License, and Patents


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

 DeveloperPolicy.html |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)


Index: llvm/docs/DeveloperPolicy.html
diff -u llvm/docs/DeveloperPolicy.html:1.28 llvm/docs/DeveloperPolicy.html:1.29
--- llvm/docs/DeveloperPolicy.html:1.28 Mon Feb 19 00:15:33 2007
+++ llvm/docs/DeveloperPolicy.html  Mon Feb 19 00:19:16 2007
@@ -22,7 +22,7 @@
 lia href=#incrementalIncremental Development/a/li
 lia href=#attributionAttribution of Changes/a/li
   /ol/li
-  lia href=#candlCopyright and License/a
+  lia href=#clpCopyright, License, and Patents/a
   ol
 lia href=#copyrightCopyright/a/li
 lia href=#licenseLicense/a/li
@@ -341,7 +341,7 @@
 liThere should be only one name at the top of the file and it should be
 the person who created the file./li
 liPlacing your name in the file does not imply a
-href=#candlcopyright/a: it is only used to attribute the file to
+href=#clpcopyright/a: it is only used to attribute the file to
 its original author./li
 liDevelopers should be aware that after some time has passed, the name at
 the top of a file may become meaningless as maintenance/ownership of files
@@ -358,7 +358,9 @@
 
 
 
!--=--
-div class=doc_sectiona name=candlCopyright and License/a/div
+div class=doc_section
+  a name=clpCopyright, License, and Patents/a
+/div
 
!--=--
 
 div class=doc_text
@@ -478,7 +480,7 @@
   Written by the 
   a href=mailto:[EMAIL PROTECTED]LLVM Oversight Group/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/02/19 06:15:33 $
+  Last modified: $Date: 2007/02/19 06:19:16 $
 /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/docs/DeveloperPolicy.html

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

DeveloperPolicy.html updated: 1.29 - 1.30
---
Log message:

add the definite article


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

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


Index: llvm/docs/DeveloperPolicy.html
diff -u llvm/docs/DeveloperPolicy.html:1.29 llvm/docs/DeveloperPolicy.html:1.30
--- llvm/docs/DeveloperPolicy.html:1.29 Mon Feb 19 00:19:16 2007
+++ llvm/docs/DeveloperPolicy.html  Mon Feb 19 00:24:23 2007
@@ -30,7 +30,7 @@
 lia href=#devagreeDeveloper Agreements/a/li
   /ol/li
 /ol
-div class=doc_authorWritten by LLVM Oversight Team/div
+div class=doc_authorWritten by the LLVM Oversight Team/div
 
 
!--=--
 div class=doc_sectiona name=introductionIntroduction/a/div
@@ -480,7 +480,7 @@
   Written by the 
   a href=mailto:[EMAIL PROTECTED]LLVM Oversight Group/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/02/19 06:19:16 $
+  Last modified: $Date: 2007/02/19 06:24:23 $
 /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/docs/DeveloperPolicy.html

2007-02-18 Thread Chris Lattner


Changes in directory llvm/docs:

DeveloperPolicy.html updated: 1.30 - 1.31
---
Log message:

more wording changes and some minor additions


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

 DeveloperPolicy.html |  103 ++-
 1 files changed, 61 insertions(+), 42 deletions(-)


Index: llvm/docs/DeveloperPolicy.html
diff -u llvm/docs/DeveloperPolicy.html:1.30 llvm/docs/DeveloperPolicy.html:1.31
--- llvm/docs/DeveloperPolicy.html:1.30 Mon Feb 19 00:24:23 2007
+++ llvm/docs/DeveloperPolicy.html  Mon Feb 19 00:57:16 2007
@@ -49,7 +49,7 @@
 liKeep the top of tree CVS/SVN trees as stable as possible./li
   /ol
   
-  pThis policy is aimed at regular contributors to LLVM.  People interested 
in
+  pThis policy is aimed at frequent contributors to LLVM. People interested 
in
   contributing one-off patches can do so in an informal way by sending them to
   the a href=http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits;
   llvm-commits mailing list/a and engaging another developer to see it 
through
@@ -61,11 +61,11 @@
 div class=doc_sectiona name=policiesDeveloper Policies/a/div
 
!--=--
 div class=doc_text
-  pThis section contains policies that pertain generally to regular LLVM
+  pThis section contains policies that pertain to frequent LLVM
   developers.  We always welcome a href=#patchesrandom patches/a from
-  people who do not routinely contribute to LLVM, but expect more from regular
+  people who do not routinely contribute to LLVM, but expect more from frequent
   contributors to keep the system as efficient as possible for everyone.
-  Regular LLVM developers are expected to meet the following obligations in
+  Frequent LLVM contributors are expected to meet the following obligations in
   order for LLVM to maintain a high standard of quality.p
 /div
 
@@ -110,6 +110,11 @@
 ttutils/mkpatch/tt utility takes care of this for you./li
 
   /ol
+  
+  pWhen sending a patch to a mailing list, it is a good idea to send it as an
+  emattachment/em to the message, not embedded into the text of the
+  message.  This ensures that your mailer will not mangle the patch when it 
+  sends it (e.g. by making whitespace changes or by wrapping lines)./p
 /div
 
 !-- ___ 
--
@@ -128,22 +133,25 @@
 reviewed after commit./li
 liThe developer responsible for a code change is also responsible for
 making all necessary review-related changes./li
-liCode review can be an iterative process, which goes until all the patch
+liCode review can be an iterative process, which goes until the patch
 is ready to be committed./li
-liDevelopers should participate in code reviews as both a reviewer and 
-a reviewee. We don't have a dedicated team of reviewers. If someone is
-kind enough to review your code, you should return the favor for someone 
-else./li
   /ol
+  
+  pDevelopers should participate in code reviews as both reviewers and 
+a reviewees. If someone is kind enough to review your code, you should
+return the favor for someone else.  Note that anyone is welcome to review
+and give feedback on a patch,
+but only people with CVS write access can approve it./p
+
 /div
 
 !-- ___ 
--
 div class=doc_subsection a name=testcasesTest Cases/a/div
 div class=doc_text
   pDevelopers are required to create test cases for any bugs fixed and any 
new
-  features added. The following policies apply:/p
+  features added.  Some tips for getting your testcase approved:/p
   ol
-liAll feature and regression test cases must be added to the 
+liAll feature and regression test cases are added to the 
 ttllvm/test/tt directory. The appropriate sub-directory should be 
 selected (see the a href=TestingGuide.htmlTesting Guide/a for 
 details)./li
@@ -151,16 +159,19 @@
 a href=LangRef.htmlLLVM assembly language/a unless the
 feature or regression being tested requires another language (e.g. the
 bug being fixed or feature being implemented is in the llvm-gcc C++
-front-end)./li
+front-end, in which case it must be written in C++)./li
 liTest cases, especially for regressions, should be reduced as much as 
 possible, by a href=CommandGuide/html/bugpoint.htmlbugpoint/a or
 manually. It is unacceptable 
 to place an entire failing program into ttllvm/test/tt as this creates
 a itime-to-test/i burden on all developers. Please keep them 
short./li
-liMore extensive test cases (applications, benchmarks, etc.) should be 
-added to the ttllvm-test/tt test suite.  This test suite is for 
-coverage: not features or regressions./li
   /ol
+  
+  pNote that llvm/test is designed for regression and small feature tests
+only. More extensive test cases (e.g., entire 

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

2007-02-18 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Constants.h updated: 1.124 - 1.125
---
Log message:

add alternate version of constant ctors that don't take a vector.  For now
this offers no performance advantage.


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

 Constants.h |   22 +++---
 1 files changed, 19 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.124 llvm/include/llvm/Constants.h:1.125
--- llvm/include/llvm/Constants.h:1.124 Wed Feb 14 20:26:09 2007
+++ llvm/include/llvm/Constants.h   Mon Feb 19 01:23:24 2007
@@ -248,6 +248,11 @@
 public:
   /// get() - Static factory methods - Return objects of the specified value
   static Constant *get(const ArrayType *T, const std::vectorConstant* );
+  static Constant *get(const ArrayType *T,
+   Constant*const*Vals, unsigned NumVals) {
+// FIXME: make this the primary ctor method.
+return get(T, std::vectorConstant*(Vals, Vals+NumVals));
+  }
 
   /// This method constructs a ConstantArray and initializes it with a text
   /// string. The default behavior (AddNull==true) causes a null terminator to
@@ -308,8 +313,13 @@
   /// get() - Static factory methods - Return objects of the specified value
   ///
   static Constant *get(const StructType *T, const std::vectorConstant* V);
-  static Constant *get(const std::vectorConstant* V, bool packed = false);
-
+  static Constant *get(const std::vectorConstant* V, bool Packed = false);
+  static Constant *get(Constant*const* Vals, unsigned NumVals,
+   bool Packed = false) {
+// FIXME: make this the primary ctor method.
+return get(std::vectorConstant*(Vals, Vals+NumVals), Packed);
+  }
+  
   /// getType() specialization - Reduce amount of casting...
   ///
   inline const StructType *getType() const {
@@ -347,7 +357,11 @@
   /// get() - Static factory methods - Return objects of the specified value
   static Constant *get(const VectorType *T, const std::vectorConstant* );
   static Constant *get(const std::vectorConstant* V);
-
+  static Constant *get(Constant*const* Vals, unsigned NumVals) {
+// FIXME: make this the primary ctor method.
+return get(std::vectorConstant*(Vals, Vals+NumVals));
+  }
+  
   /// getType - Specialize the getType() method to always return an VectorType,
   /// which reduces the amount of casting needed in parts of the compiler.
   ///
@@ -578,6 +592,8 @@
 Constant* const *IdxList, unsigned NumIdx);
   static Constant *getGetElementPtr(Constant *C,
 Value* const *IdxList, unsigned NumIdx);
+  
+  // FIXME: Remove these.
   static Constant *getGetElementPtr(Constant *C,
 const std::vectorConstant* IdxList) {
 return getGetElementPtr(C, IdxList[0], IdxList.size());



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


[llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp RSProfiling.cpp

2007-02-18 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Instrumentation:

ProfilingUtils.cpp updated: 1.15 - 1.16
RSProfiling.cpp updated: 1.19 - 1.20
---
Log message:

eliminate use of deprecated apis


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

 ProfilingUtils.cpp |6 --
 RSProfiling.cpp|3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.15 
llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.16
--- llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.15 Mon Feb 12 
20:10:56 2007
+++ llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp  Mon Feb 19 
01:34:47 2007
@@ -43,7 +43,8 @@
   std::vectorConstant* GEPIndices(2, Constant::getNullValue(Type::Int32Ty));
   unsigned NumElements = 0;
   if (Array) {
-Args[2] = ConstantExpr::getGetElementPtr(Array, GEPIndices);
+Args[2] = ConstantExpr::getGetElementPtr(Array, GEPIndices[0],
+ GEPIndices.size());
 NumElements =
   castArrayType(Array-getType()-getElementType())-getNumElements();
   } else {
@@ -106,7 +107,8 @@
   std::vectorConstant* Indices(2);
   Indices[0] = Constant::getNullValue(Type::Int32Ty);
   Indices[1] = ConstantInt::get(Type::Int32Ty, CounterNum);
-  Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray, Indices);
+  Constant *ElementPtr = 
+ConstantExpr::getGetElementPtr(CounterArray, Indices[0], Indices.size());
 
   // Load, increment and store the value back.
   Value *OldVal = new LoadInst(ElementPtr, OldFuncCounter, InsertPos);


Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp
diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.19 
llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.20
--- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.19Mon Feb  5 
17:32:05 2007
+++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Mon Feb 19 01:34:47 2007
@@ -335,7 +335,8 @@
   std::vectorConstant* Indices(2);
   Indices[0] = Constant::getNullValue(Type::Int32Ty);
   Indices[1] = ConstantInt::get(Type::Int32Ty, CounterNum);
-  Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray, Indices);
+  Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray,
+Indices[0], 2);
   
   // Load, increment and store the value back.
   Value *OldVal = new LoadInst(ElementPtr, OldCounter, InsertPos);



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


[llvm-commits] CVS: llvm/tools/bugpoint/Miscompilation.cpp

2007-02-18 Thread Chris Lattner


Changes in directory llvm/tools/bugpoint:

Miscompilation.cpp updated: 1.88 - 1.89
---
Log message:

remove use of deprecated apis


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

 Miscompilation.cpp |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm/tools/bugpoint/Miscompilation.cpp
diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.88 
llvm/tools/bugpoint/Miscompilation.cpp:1.89
--- llvm/tools/bugpoint/Miscompilation.cpp:1.88 Tue Feb 13 00:05:43 2007
+++ llvm/tools/bugpoint/Miscompilation.cpp  Mon Feb 19 01:41:31 2007
@@ -702,8 +702,7 @@
 
 // GetElementPtr *funcName, ulong 0, ulong 0
 std::vectorConstant* 
GEPargs(2,Constant::getNullValue(Type::Int32Ty));
-Value *GEP =
-  ConstantExpr::getGetElementPtr(funcName, GEPargs);
+Value *GEP = ConstantExpr::getGetElementPtr(funcName, GEPargs[0], 2);
 std::vectorValue* ResolverArgs;
 ResolverArgs.push_back(GEP);
 



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


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

2007-02-18 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Constants.h updated: 1.125 - 1.126
---
Log message:

remove dead methods


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

 Constants.h |   14 --
 1 files changed, 14 deletions(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.125 llvm/include/llvm/Constants.h:1.126
--- llvm/include/llvm/Constants.h:1.125 Mon Feb 19 01:23:24 2007
+++ llvm/include/llvm/Constants.h   Mon Feb 19 01:44:24 2007
@@ -550,10 +550,6 @@
   ///
   static Constant *getSizeOf(const Type *Ty);
 
-  /// getPtrPtrFromArrayPtr constant expr - given a pointer to a constant 
array,
-  /// return a pointer to a pointer of the array element type.
-  static Constant *getPtrPtrFromArrayPtr(Constant *C);
-
   /// ConstantExpr::get - Return a binary or shift operator constant 
expression,
   /// folding if possible.
   ///
@@ -593,16 +589,6 @@
   static Constant *getGetElementPtr(Constant *C,
 Value* const *IdxList, unsigned NumIdx);
   
-  // FIXME: Remove these.
-  static Constant *getGetElementPtr(Constant *C,
-const std::vectorConstant* IdxList) {
-return getGetElementPtr(C, IdxList[0], IdxList.size());
-  }
-  static Constant *getGetElementPtr(Constant *C,
-const std::vectorValue* IdxList) {
-return getGetElementPtr(C, IdxList[0], IdxList.size());
-  }
-  
   static Constant *getExtractElement(Constant *Vec, Constant *Idx);
   static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant 
*Idx);
   static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant 
*Mask);



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


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

2007-02-18 Thread Chris Lattner


Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.211 - 1.212
---
Log message:

remove dead methods


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

 Constants.cpp |   35 +++
 1 files changed, 15 insertions(+), 20 deletions(-)


Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.211 llvm/lib/VMCore/Constants.cpp:1.212
--- llvm/lib/VMCore/Constants.cpp:1.211 Wed Feb 14 21:39:18 2007
+++ llvm/lib/VMCore/Constants.cpp   Mon Feb 19 01:44:24 2007
@@ -22,6 +22,7 @@
 #include llvm/Support/Debug.h
 #include llvm/Support/ManagedStatic.h
 #include llvm/Support/MathExtras.h
+#include llvm/ADT/SmallVector.h
 #include algorithm
 #include map
 using namespace llvm;
@@ -482,13 +483,14 @@
 Op2 = (OpNo == 2) ? Op : getOperand(2);
 return ConstantExpr::getShuffleVector(Op0, Op1, Op2);
   case Instruction::GetElementPtr: {
-std::vectorConstant* Ops;
+SmallVectorConstant*, 8 Ops;
+Ops.resize(getNumOperands());
 for (unsigned i = 1, e = getNumOperands(); i != e; ++i)
-  Ops.push_back(getOperand(i));
+  Ops[i] = getOperand(i);
 if (OpNo == 0)
-  return ConstantExpr::getGetElementPtr(Op, Ops);
+  return ConstantExpr::getGetElementPtr(Op, Ops[0], Ops.size());
 Ops[OpNo-1] = Op;
-return ConstantExpr::getGetElementPtr(getOperand(0), Ops);
+return ConstantExpr::getGetElementPtr(getOperand(0), Ops[0], Ops.size());
   }
   default:
 assert(getNumOperands() == 2  Must be binary operator?);
@@ -535,10 +537,8 @@
 return ConstantExpr::getExtractElement(Ops[0], Ops[1]);
   case Instruction::ShuffleVector:
 return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]);
-  case Instruction::GetElementPtr: {
-std::vectorConstant* ActualOps(Ops.begin()+1, Ops.end());
-return ConstantExpr::getGetElementPtr(Ops[0], ActualOps);
-  }
+  case Instruction::GetElementPtr:
+return ConstantExpr::getGetElementPtr(Ops[0], Ops[1], Ops.size()-1);
   case Instruction::ICmp:
   case Instruction::FCmp:
 return ConstantExpr::getCompare(getPredicate(), Ops[0], Ops[1]);
@@ -1578,16 +1578,10 @@
 
 Constant *ConstantExpr::getSizeOf(const Type *Ty) {
   // sizeof is implemented as: (ulong) gep (Ty*)null, 1
-  return getCast(Instruction::PtrToInt, getGetElementPtr(getNullValue(
-PointerType::get(Ty)), std::vectorConstant*(1, 
-ConstantInt::get(Type::Int32Ty, 1))), Type::Int64Ty);
-}
-
-Constant *ConstantExpr::getPtrPtrFromArrayPtr(Constant *C) {
-  // pointer from array is implemented as: getelementptr arr ptr, 0, 0
-  static std::vectorConstant* Indices(2, ConstantInt::get(Type::Int32Ty, 0));
-
-  return ConstantExpr::getGetElementPtr(C, Indices);
+  Constant *GEPIdx = ConstantInt::get(Type::Int32Ty, 1);
+  Constant *GEP =
+getGetElementPtr(getNullValue(PointerType::get(Ty)), GEPIdx, 1);
+  return getCast(Instruction::PtrToInt, GEP, Type::Int64Ty);
 }
 
 Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode,
@@ -2029,7 +2023,7 @@
   
   Constant *Replacement = 0;
   if (getOpcode() == Instruction::GetElementPtr) {
-std::vectorConstant* Indices;
+SmallVectorConstant*, 8 Indices;
 Constant *Pointer = getOperand(0);
 Indices.reserve(getNumOperands()-1);
 if (Pointer == From) Pointer = To;
@@ -2039,7 +2033,8 @@
   if (Val == From) Val = To;
   Indices.push_back(Val);
 }
-Replacement = ConstantExpr::getGetElementPtr(Pointer, Indices);
+Replacement = ConstantExpr::getGetElementPtr(Pointer,
+ Indices[0], Indices.size());
   } else if (isCast()) {
 assert(getOperand(0) == From  Cast only has one use!);
 Replacement = ConstantExpr::getCast(getOpcode(), To, getType());



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