[llvm-commits] CVS: llvm/utils/TableGen/SubtargetEmitter.cpp

2005-10-22 Thread Jim Laskey


Changes in directory llvm/utils/TableGen:

SubtargetEmitter.cpp updated: 1.1 -> 1.2
---
Log message:

Sort the features and processor lists for the sake of search (and maintainers.)



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

 SubtargetEmitter.cpp |   29 +++--
 1 files changed, 27 insertions(+), 2 deletions(-)


Index: llvm/utils/TableGen/SubtargetEmitter.cpp
diff -u llvm/utils/TableGen/SubtargetEmitter.cpp:1.1 
llvm/utils/TableGen/SubtargetEmitter.cpp:1.2
--- llvm/utils/TableGen/SubtargetEmitter.cpp:1.1Fri Oct 21 14:00:04 2005
+++ llvm/utils/TableGen/SubtargetEmitter.cppSat Oct 22 02:59:56 2005
@@ -20,17 +20,42 @@
 #include 
 using namespace llvm;
 
-// Convenience types
+//
+// Convenience types.
+//
 typedef std::vector RecordList;
 typedef std::vector::iterator RecordListIter;
 
+//
+// Record sort by name function.
+//
+struct LessRecord {
+  bool operator()(const Record *Rec1, const Record *Rec2) const {
+return Rec1->getName() < Rec2->getName();
+  }
+};
 
+//
+// Record sort by field "Name" function.
+//
+struct LessRecordFieldName {
+  bool operator()(const Record *Rec1, const Record *Rec2) const {
+return Rec1->getValueAsString("Name") < Rec2->getValueAsString("Name");
+  }
+};
+
+
+// 
 // SubtargetEmitter::run - Main subtarget enumeration emitter.
 //
 void SubtargetEmitter::run(std::ostream &OS) {
   EmitSourceFileHeader("Subtarget Enumeration Source Fragment", OS);
+  
   RecordList Features = Records.getAllDerivedDefinitions("SubtargetFeature");
+  sort(Features.begin(), Features.end(), LessRecord());
+  
   RecordList Processors = Records.getAllDerivedDefinitions("Processor");
+  sort(Processors.begin(), Processors.end(), LessRecordFieldName());
 
   OS << "namespace llvm {\n\n";
   
@@ -70,7 +95,7 @@
 OS << "};\n";
   }
   
-  { // Feature key values
+  { // CPU key values
 OS << "\n\n"
<< "/// Sorted (by key) array of values for CPU subtype.\n"
<< "static const SubtargetFeatureKV SubTypeKV[] = {\n";



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.td

2005-10-22 Thread Jim Laskey


Changes in directory llvm/lib/Target/PowerPC:

PPC.td updated: 1.5 -> 1.6
---
Log message:

Add g3 back to the mix and reorder to irritate them anal folk.  Actually, it's
to group appropriately and provide cues to maintainers that the lists don't 
need to be ordered.


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

 PPC.td |   19 ++-
 1 files changed, 10 insertions(+), 9 deletions(-)


Index: llvm/lib/Target/PowerPC/PPC.td
diff -u llvm/lib/Target/PowerPC/PPC.td:1.5 llvm/lib/Target/PowerPC/PPC.td:1.6
--- llvm/lib/Target/PowerPC/PPC.td:1.5  Fri Oct 21 17:15:43 2005
+++ llvm/lib/Target/PowerPC/PPC.td  Sat Oct 22 03:04:24 2005
@@ -26,7 +26,7 @@
 
 
 
//===--===//
-// PowerPC Subtarget features (sorted by name).
+// PowerPC Subtarget features.
 //
  
 def Feature64Bit : SubtargetFeature<"64bit",
@@ -35,15 +35,16 @@
 "Should 64 bit registers be used">;
 def FeatureAltivec   : SubtargetFeature<"altivec",
 "Should Altivec instructions be used">;
-def FeatureFSqrt : SubtargetFeature<"fsqrt",
-"Should the fsqrt instruction be used">; 
 def FeatureGPUL  : SubtargetFeature<"gpul",
 "Should GPUL instructions be used">;
+def FeatureFSqrt : SubtargetFeature<"fsqrt",
+"Should the fsqrt instruction be used">; 
 
 
//===--===//
-// PowerPC chips sets supported (sorted by name)
+// PowerPC chips sets supported.
 //
 
+def : Processor<"generic", G3Itineraries, []>;
 def : Processor<"601", G3Itineraries, []>;
 def : Processor<"602", G3Itineraries, []>;
 def : Processor<"603", G3Itineraries, []>;
@@ -52,18 +53,18 @@
 def : Processor<"604", G3Itineraries, []>;
 def : Processor<"604e", G3Itineraries, []>;
 def : Processor<"620", G3Itineraries, []>;
+def : Processor<"g3", G3Itineraries, []>;
 def : Processor<"7400", G4Itineraries, [FeatureAltivec]>;
+def : Processor<"g4", G4Itineraries, [FeatureAltivec]>;
 def : Processor<"7450", G4PlusItineraries, [FeatureAltivec]>;
+def : Processor<"g4+", G4PlusItineraries, [FeatureAltivec]>;
 def : Processor<"750", G3Itineraries, []>;
 def : Processor<"970", G5Itineraries,
   [FeatureAltivec, FeatureGPUL, FeatureFSqrt,
-   Feature64Bit /*, Feature64BitRegs*/]>;
-def : Processor<"g4", G4Itineraries, [FeatureAltivec]>;
-def : Processor<"g4+", G4PlusItineraries, [FeatureAltivec]>;
+   Feature64Bit /*, Feature64BitRegs */]>;
 def : Processor<"g5", G5Itineraries,
   [FeatureAltivec, FeatureGPUL, FeatureFSqrt,
-   Feature64Bit /*, Feature64BitRegs*/]>;
-def : Processor<"generic", G3Itineraries, []>;
+   Feature64Bit /*, Feature64BitRegs */]>;
 
 
 def PPC : Target {



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.53 -> 1.54
---
Log message:

BuildSDIV and BuildUDIV only work for i32/i64, but they don't check that
the input is that type, this caused a failure on gs on X86 last night.
Move the hard checks into Build[US]Div since that is where decisions like
this should be made.



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

 DAGCombiner.cpp |   30 --
 1 files changed, 20 insertions(+), 10 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.53 
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.54
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.53  Fri Oct 21 16:23:25 2005
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp   Sat Oct 22 13:50:15 2005
@@ -817,9 +817,9 @@
   // if integer divide is expensive and we satisfy the requirements, emit an
   // alternate sequence.
   if (N1C && (N1C->getSignExtended() < -1 || N1C->getSignExtended() > 1) && 
-  !TLI.isIntDivCheap() &&
-  TLI.isOperationLegal(ISD::MULHS, VT) && TLI.isTypeLegal(VT)) {
-return BuildSDIV(N);
+  !TLI.isIntDivCheap()) {
+SDOperand Op = BuildSDIV(N);
+if (Op.Val) return Op;
   }
   return SDOperand();
 }
@@ -841,9 +841,11 @@
DAG.getConstant(Log2_64(N1C->getValue()),
TLI.getShiftAmountTy()));
   // fold (udiv x, c) -> alternate
-  if (N1C && N1C->getValue() && TLI.isOperationLegal(ISD::MULHU, VT) &&
-  TLI.isTypeLegal(VT) && !TLI.isIntDivCheap())
-return BuildUDIV(N);
+  if (N1C && N1C->getValue() && !TLI.isIntDivCheap()) {
+SDOperand Op = BuildUDIV(N);
+if (Op.Val) return Op;
+  }
+  
   return SDOperand();
 }
 
@@ -2583,8 +2585,12 @@
 /// 
 SDOperand DAGCombiner::BuildSDIV(SDNode *N) {
   MVT::ValueType VT = N->getValueType(0);
-  assert((VT == MVT::i32 || VT == MVT::i64) && 
- "BuildSDIV only operates on i32 or i64!");
+  
+  // Check to see if we can do this.
+  if (!TLI.isTypeLegal(VT) || (VT != MVT::i32 && VT != MVT::i64))
+return SDOperand();   // BuildSDIV only operates on i32 or i64
+  if (!TLI.isOperationLegal(ISD::MULHS, VT))
+return SDOperand();   // Make sure the target supports MULHS.
   
   int64_t d = cast(N->getOperand(1))->getSignExtended();
   ms magics = (VT == MVT::i32) ? magic32(d) : magic64(d);
@@ -2622,8 +2628,12 @@
 /// 
 SDOperand DAGCombiner::BuildUDIV(SDNode *N) {
   MVT::ValueType VT = N->getValueType(0);
-  assert((VT == MVT::i32 || VT == MVT::i64) && 
- "BuildUDIV only operates on i32 or i64!");
+  
+  // Check to see if we can do this.
+  if (!TLI.isTypeLegal(VT) || (VT != MVT::i32 && VT != MVT::i64))
+return SDOperand();   // BuildUDIV only operates on i32 or i64
+  if (!TLI.isOperationLegal(ISD::MULHU, VT))
+return SDOperand();   // Make sure the target supports MULHU.
   
   uint64_t d = cast(N->getOperand(1))->getValue();
   mu magics = (VT == MVT::i32) ? magicu32(d) : magicu64(d);



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Chris Lattner


Changes in directory llvm/lib/Target/SparcV8:

SparcV8ISelPattern.cpp (r1.7) removed
---
Log message:

This file is entirely ifdef'd out


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

 0 files changed



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/pubs/2005-09-25-CASES05-SegmentProtection.html 2005-09-25-CASES05-SegmentProtection.pdf index.html

2005-10-22 Thread Chris Lattner


Changes in directory llvm-www/pubs:

2005-09-25-CASES05-SegmentProtection.html added (r1.1)
2005-09-25-CASES05-SegmentProtection.pdf added (r1.1)
index.html updated: 1.23 -> 1.24
---
Log message:

add a new paper that uses LLVM


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

 2005-09-25-CASES05-SegmentProtection.html |   60 ++
 2005-09-25-CASES05-SegmentProtection.pdf  |0 
 index.html|7 +++
 3 files changed, 67 insertions(+)


Index: llvm-www/pubs/2005-09-25-CASES05-SegmentProtection.html
diff -c /dev/null llvm-www/pubs/2005-09-25-CASES05-SegmentProtection.html:1.1
*** /dev/null   Sat Oct 22 16:16:20 2005
--- llvm-www/pubs/2005-09-25-CASES05-SegmentProtection.html Sat Oct 22 
16:16:10 2005
***
*** 0 
--- 1,60 
+ 
+ 
+ 
+   
+   
+   Segment Protection for Embedded Systems Using Run-time Checks
+ 
+ 
+ 
+ 
+   Segment Protection for Embedded Systems Using Run-time Checks
+ 
+ 
+   Matthew Simpson, Bhuvan Middha and Rajeev Barua
+ 
+ 
+ 
+ Abstract:
+ 
+ 
+ The lack of virtual memory protection is a serious source of unreliability 
in many embedded systems. Without the segment-level 
+ protection it provides, these systems are subject to memory access 
+ violations, stemming from programmer error, whose results can be 
+ dangerous and catastrophic in safety-critical systems. The traditional method 
of testing embedded software before its deployment 
+ is an insufficient means of detecting and debugging all software 
+ errors, and the reliance on this practice is a severe gamble when 
+ the reliable performance of the embedded device is critical. Additionally, 
the use of safe languages and programming semantic restrictions as prevention 
mechanisms is often infeasible when considering the adoptability and 
compatibility of these languages since 
+ most embedded applications are written in C and C++.
+ 
+ This work improves system reliability by providing a completely 
+ automatic software technique for guaranteeing segment protection 
+ for embedded systems lacking virtual memory. This is done by 
+ inserting optimized run-time checks before memory accesses that 
+ detect segmentation violations in cases in which there would otherwise be no 
error, enabling remedial action before system failure 
+ or corruption. This feature is invaluable for safety-critical embedded 
systems. Other advantages of our method include its low overhead, lack of any 
programming language or semantic restrictions, 
+ and ease of implementation. Our compile-time analysis, known as 
+ intended segment analysis, is a uniquely structured analysis that allows for 
the realization of optimizations used to reduce the number 
+ of required run-time checks and foster our technique into a truly 
+ viable solution for providing segment protection in embedded systems lacking 
virtual memory. 
+ Our experimental results show that these optimizations are effective at 
reducing the performance overheads associated with providing software segment 
protection to low, and in many cases, negligible levels. For the eight 
evaluated embedded benchmarks, the 
+ average increase in run-time is 0.72%, the average increase in energy 
consumption is 0.44%, and the average increase in code size 
+ is 3.60%. 
+ 
+ 
+ Published:
+ 
+   "Segment Protection for Embedded Systems Using Run-time Checks"
+   By Matthew Simpson, Bhuvan Middha and Rajeev Barua.
+   Proceedings of the ACM International Conference on Compilers, 
+   Architecture, and Synthesis for Embedded Systems (CASES),
+   San Francisco, CA, September 25-27, 2005
+ 
+ 
+ Download:
+ 
+   Segment Protection 
for Embedded Systems Using Run-time Checks (PDF)
+ 
+ 
+ 
+ 


Index: llvm-www/pubs/2005-09-25-CASES05-SegmentProtection.pdf


Index: llvm-www/pubs/index.html
diff -u llvm-www/pubs/index.html:1.23 llvm-www/pubs/index.html:1.24
--- llvm-www/pubs/index.html:1.23   Fri Jun 24 22:02:17 2005
+++ llvm-www/pubs/index.htmlSat Oct 22 16:16:10 2005
@@ -48,6 +48,13 @@
 
 
 
+"Segment Protection for
+  Embedded Systems Using Run-time Checks"
+  By Matthew Simpson, Bhuvan Middha and Rajeev Barua.
+  Proceedings of the ACM International Conference on Compilers,
+  Architecture, and Synthesis for Embedded Systems (CASES),
+  San Francisco, CA, September, 2005
+  
 "An Implementation of Swing 
Modulo Scheduling with Extensions for Superblocks"
 Tanya M. Lattner. M.S. Thesis, http://www.cs.uiuc.edu";>Computer
 Science Dept., http://www.uiuc.edu/";>University of Illinois at



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/pubs/index.html

2005-10-22 Thread Chris Lattner


Changes in directory llvm-www/pubs:

index.html updated: 1.24 -> 1.25
---
Log message:

fix run-on link, remove italics 


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

 index.html |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm-www/pubs/index.html
diff -u llvm-www/pubs/index.html:1.24 llvm-www/pubs/index.html:1.25
--- llvm-www/pubs/index.html:1.24   Sat Oct 22 16:16:10 2005
+++ llvm-www/pubs/index.htmlSat Oct 22 16:36:35 2005
@@ -49,10 +49,10 @@
 
 
 "Segment Protection for
-  Embedded Systems Using Run-time Checks"
+  Embedded Systems Using Run-time Checks"
   By Matthew Simpson, Bhuvan Middha and Rajeev Barua.
-  Proceedings of the ACM International Conference on Compilers,
-  Architecture, and Synthesis for Embedded Systems (CASES),
+  Proceedings of the ACM International Conference on Compilers,
+  Architecture, and Synthesis for Embedded Systems (CASES),
   San Francisco, CA, September, 2005
   
 "An Implementation of Swing 
Modulo Scheduling with Extensions for Superblocks"



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/pubs/index.html

2005-10-22 Thread Chris Lattner


Changes in directory llvm-www/pubs:

index.html updated: 1.25 -> 1.26
---
Log message:

Clean this up significantly, remove all links but those to the paper's page
to reduce clutter


---
Diffs of the changes:  (+38 -48)

 index.html |   86 ++---
 1 files changed, 38 insertions(+), 48 deletions(-)


Index: llvm-www/pubs/index.html
diff -u llvm-www/pubs/index.html:1.25 llvm-www/pubs/index.html:1.26
--- llvm-www/pubs/index.html:1.25   Sat Oct 22 16:36:35 2005
+++ llvm-www/pubs/index.htmlSat Oct 22 16:48:02 2005
@@ -4,41 +4,38 @@
 
 
 "The LLVM Compiler Framework and
-Infrastructure Tutorial" Chris Lattner and Vikram Adve.  http://www.ecn.purdue.edu/LCPC2004/";>LCPC'04 http://www.ecn.purdue.edu/LCPC2004/miniws.html";>Mini Workshop on Compiler
-Research Infrastructures, West Lafayette, Indiana, Sep. 2004.
+Infrastructure Tutorial" Chris Lattner and Vikram Adve
+LCPC'04 Mini Workshop on Compiler Research Infrastructures, West 
Lafayette, Indiana, Sep. 2004.
 
 "LLVM: A Compilation Framework for
 Lifelong Program Analysis & Transformation" Chris Lattner and 
Vikram
-Adve.  Proc. of the 2004 http://www.cgo.org/";>International Symposium
-on Code Generation and Optimization (CGO'04), Palo Alto, California, Mar.
+Adve  Proc. of the 2004 International Symposium
+on Code Generation and Optimization (CGO'04), Palo Alto, California, Mar.
 2004.
 
 A previous version is available as:
 "LLVM: A Compilation
 Framework for Lifelong Program Analysis & Transformation" Chris
-Lattner & Vikram Adve.  Technical Report #UIUCDCS-R-2003-2380, Computer
-Science Dept., Univ. of Illinois, Sep. 2003.
+Lattner & Vikram Adve  Technical Report #UIUCDCS-R-2003-2380, 
Computer
+Science Dept., Univ. of Illinois, Sep. 2003.
 
 "LLVA: A Low-level Virtual Instruction Set
 Architecture" Vikram Adve, Chris Lattner, Michael Brukman, Anand 
Shukla,
-and Brian Gaeke.  http://www.microarch.org/micro36/";>Proc. of the
+and Brian Gaeke  Proceedings of the
 36th annual ACM/IEEE international symposium on Microarchitecture
-(MICRO-36), San Diego, CA, December 2003.
+(MICRO-36), San Diego, CA, December 2003.
 
 "Architecture For a Next-Generation
-GCC" Chris Lattner & Vikram Adve,  http://www.gccsummit.org/2003/";>First Annual GCC Developers'
-Summit, Ottawa, Canada, May 2003. 
+GCC" Chris Lattner & Vikram Adve First Annual GCC 
Developers'
+Summit, Ottawa, Canada, May 2003. 
 
 "LLVM: An Infrastructure for
-Multi-Stage Optimization" Chris Lattner. Masters Thesis, 
+Multi-Stage Optimization" Chris Lattner Masters Thesis, 
 Computer Science Dept., University of Illinois at Urbana-Champaign, 
 Dec. 2002
 
 "The LLVM Instruction Set
-and Compilation Strategy" Chris Lattner & Vikram Adve, Technical
+and Compilation Strategy" Chris Lattner & Vikram Adve 
Technical
 Report #UIUCDCS-R-2002-2292, Computer Science Dept., Univ. of Illinois, 
Aug.
 2002. 
 
@@ -50,90 +47,83 @@
 
 "Segment Protection for
   Embedded Systems Using Run-time Checks"
-  By Matthew Simpson, Bhuvan Middha and Rajeev Barua.
-  Proceedings of the ACM International Conference on Compilers,
-  Architecture, and Synthesis for Embedded Systems (CASES),
+  By Matthew Simpson, Bhuvan Middha and Rajeev Barua
+  Proc. of the ACM International Conference on Compilers,
+  Architecture, and Synthesis for Embedded Systems (CASES),
   San Francisco, CA, September, 2005
   
 "An Implementation of Swing 
Modulo Scheduling with Extensions for Superblocks"
-Tanya M. Lattner. M.S. Thesis, http://www.cs.uiuc.edu";>Computer
-Science Dept., http://www.uiuc.edu/";>University of Illinois at
-Urbana-Champaign, June 2005.
+Tanya M. Lattner. M.S. Thesis, Computer Science Dept., University 
of Illinois at
+Urbana-Champaign, June 2005.
 
 "Macroscopic Data Structure
 Analysis and Optimization"
-Chris Lattner. Ph.D. Thesis, http://www.cs.uiuc.edu";>Computer
-Science Dept., http://www.uiuc.edu/";>University of Illinois at
-Urbana-Champaign, May 2005.
+Chris Lattner Ph.D. Thesis, Computer Science Dept., University of 
Illinois at
+Urbana-Champaign, May 2005.
 
 "Automatic Pool Allocation: 
 Improving Performance by Controlling Data Structure Layout in the Heap"
-Chris Lattner and Vikram Adve.  Proc. of the 2005 http://research.ihost.com/pldi2005/";>ACM SIGPLAN Conference on
-Programming Language Design and Implementation (PLDI'05), Chicago, 
Illinois,
+Chris Lattner and Vikram Adve
+  Proc. of the 2005 ACM SIGPLAN Conference on Programming Language Design 
and Implementation (PLDI'05), Chicago, Illinois,
 June, 2005.
 Received PLDI 2005 Best Paper Award.
 
 "Transparent Pointer Compression 
 for Linked Data Structures"
-Chris Lattner and Vikram Adve.  Proceedings of the http://research.microsoft.com/~zorn/MSP05/home.htm";>ACM Workshop on 
-Memory System Performance (MSP'05), Chicago, Illinois, June, 2005.
+Chris Lattner and Vikram Adve  Proceedings of the
+ACM Workshop on Memory System Performance (MSP'05), Chicago, Illinois, 
June, 2005.
 
 
 "Memory Safe

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

2005-10-22 Thread Chris Lattner


Changes in directory llvm/tools/llc:

llc.cpp updated: 1.113 -> 1.114
---
Log message:

document this as experimental


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

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


Index: llvm/tools/llc/llc.cpp
diff -u llvm/tools/llc/llc.cpp:1.113 llvm/tools/llc/llc.cpp:1.114
--- llvm/tools/llc/llc.cpp:1.113Fri Sep  2 14:27:43 2005
+++ llvm/tools/llc/llc.cpp  Sat Oct 22 17:00:45 2005
@@ -67,7 +67,7 @@
clEnumValN(TargetMachine::AssemblyFile,"asm",
   "  Emit an assembly ('.s') file"),
clEnumValN(TargetMachine::ObjectFile,"obj",
-  "  Emit a native object ('.o') file"),
+  "  Emit a native object ('.o') file [experimental]"),
clEnumValN(TargetMachine::DynamicLibrary, "dynlib",
   "  Emit a native dynamic library ('.so') file"),
clEnumValEnd));



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp AlphaISelLowering.h AlphaInstrFormats.td AlphaInstrInfo.td

2005-10-22 Thread Andrew Lenharth


Changes in directory llvm/lib/Target/Alpha:

AlphaISelDAGToDAG.cpp updated: 1.1 -> 1.2
AlphaISelLowering.h updated: 1.2 -> 1.3
AlphaInstrFormats.td updated: 1.9 -> 1.10
AlphaInstrInfo.td updated: 1.66 -> 1.67
---
Log message:

Well, the Constant matching pattern works.  Can't say much about calls or 
globals yet.

---
Diffs of the changes:  (+113 -71)

 AlphaISelDAGToDAG.cpp |  149 --
 AlphaISelLowering.h   |2 
 AlphaInstrFormats.td  |   10 +++
 AlphaInstrInfo.td |   23 +--
 4 files changed, 113 insertions(+), 71 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.1 
llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.2
--- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.1 Wed Oct 19 19:29:02 2005
+++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Sat Oct 22 17:06:58 2005
@@ -26,6 +26,7 @@
 #include "llvm/GlobalValue.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/MathExtras.h"
+#include 
 using namespace llvm;
 
 namespace {
@@ -43,14 +44,10 @@
 
 /// getI64Imm - Return a target constant with the specified value, of type
 /// i64.
-inline SDOperand getI64Imm(unsigned Imm) {
+inline SDOperand getI64Imm(int64_t Imm) {
   return CurDAG->getTargetConstant(Imm, MVT::i64);
 }
 
-virtual bool runOnFunction(Function &Fn) {
-  return SelectionDAGISel::runOnFunction(Fn);
-}
-   
 // Select - Convert the specified operand from a target-independent to a
 // target-specific node if it hasn't already been changed.
 SDOperand Select(SDOperand Op);
@@ -67,56 +64,24 @@
 #include "AlphaGenDAGISel.inc"
 
 private:
+SDOperand getGlobalBaseReg();
+SDOperand SelectCALL(SDOperand Op);
+
   };
 }
 
+/// getGlobalBaseReg - Output the instructions required to put the
+/// GOT address into a register.
+///
+SDOperand AlphaDAGToDAGISel::getGlobalBaseReg() {
+  return CurDAG->getRegister(AlphaLowering.getVRegGP(), MVT::i64);
+}
+
 /// InstructionSelectBasicBlock - This callback is invoked by
 /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
 void AlphaDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
   DEBUG(BB->dump());
   
-  // The selection process is inherently a bottom-up recursive process (users
-  // select their uses before themselves).  Given infinite stack space, we
-  // could just start selecting on the root and traverse the whole graph.  In
-  // practice however, this causes us to run out of stack space on large basic
-  // blocks.  To avoid this problem, select the entry node, then all its uses,
-  // iteratively instead of recursively.
-  std::vector Worklist;
-  Worklist.push_back(DAG.getEntryNode());
-  
-  // Note that we can do this in the Alpha target (scanning forward across 
token
-  // chain edges) because no nodes ever get folded across these edges.  On a
-  // target like X86 which supports load/modify/store operations, this would
-  // have to be more careful.
-  while (!Worklist.empty()) {
-SDOperand Node = Worklist.back();
-Worklist.pop_back();
-
-// Chose from the least deep of the top two nodes.
-if (!Worklist.empty() &&
-Worklist.back().Val->getNodeDepth() < Node.Val->getNodeDepth())
-  std::swap(Worklist.back(), Node);
-
-if ((Node.Val->getOpcode() >= ISD::BUILTIN_OP_END &&
- Node.Val->getOpcode() < AlphaISD::FIRST_NUMBER) ||
-CodeGenMap.count(Node)) continue;
-
-for (SDNode::use_iterator UI = Node.Val->use_begin(),
- E = Node.Val->use_end(); UI != E; ++UI) {
-  // Scan the values.  If this use has a value that is a token chain, add 
it
-  // to the worklist.
-  SDNode *User = *UI;
-  for (unsigned i = 0, e = User->getNumValues(); i != e; ++i)
-if (User->getValueType(i) == MVT::Other) {
-  Worklist.push_back(SDOperand(User, i));
-  break; 
-}
-}
-
-// Finally, legalize this node.
-Select(Node);
-  }
-
   // Select target instructions for the DAG.
   DAG.setRoot(Select(DAG.getRoot()));
   CodeGenMap.clear();
@@ -140,14 +105,21 @@
   
   switch (N->getOpcode()) {
   default: break;
+  case ISD::TAILCALL:
+  case ISD::CALL: return SelectCALL(Op);
+
   case ISD::DYNAMIC_STACKALLOC:
   case ISD::ADD_PARTS:
   case ISD::SUB_PARTS:
   case ISD::SETCC:
-  case ISD::CALL:
-  case ISD::TAILCALL:
 assert(0 && "You want these too?");
 
+  case ISD::BR: {
+CurDAG->SelectNodeTo(N, Alpha::BR_DAG, MVT::Other, N->getOperand(1),
+ Select(N->getOperand(0)));
+return SDOperand(N, 0);
+  }
+
   case ISD::TokenFactor: {
 SDOperand New;
 if (N->getNumOperands() == 2) {
@@ -208,20 +180,10 @@
 assert(0 && "Constants are overrated");
   }
   case ISD::GlobalAddress: {
-// GlobalValue *GV = cast(N)->getGlobal();
-// SDOperand Tmp;
-// SDOperand GA = CurDAG->getTargetGlobalAddress(GV, MVT::i32);
-// i

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

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/win32/TableGen:

TableGen.vcproj updated: 1.14 -> 1.15
---
Log message:

Add new files to Visual Studio.

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

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


Index: llvm/win32/TableGen/TableGen.vcproj
diff -u llvm/win32/TableGen/TableGen.vcproj:1.14 
llvm/win32/TableGen/TableGen.vcproj:1.15
--- llvm/win32/TableGen/TableGen.vcproj:1.14Fri Sep  9 21:00:02 2005
+++ llvm/win32/TableGen/TableGen.vcproj Sat Oct 22 20:22:33 2005
@@ -192,6 +192,9 @@

RelativePath="..\..\utils\TableGen\RegisterInfoEmitter.cpp">


+   
+   




+   
+   





___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Andrew Lenharth


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAG.cpp updated: 1.206 -> 1.207
---
Log message:

add TargetExternalSymbol

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

 SelectionDAG.cpp |   14 +-
 1 files changed, 13 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.206 
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.207
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.206Wed Oct 12 
22:11:28 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp  Sat Oct 22 22:38:30 2005
@@ -312,6 +312,9 @@
   case ISD::ExternalSymbol:
 Erased = ExternalSymbols.erase(cast(N)->getSymbol());
 break;
+  case ISD::TargetExternalSymbol:
+Erased = 
TargetExternalSymbols.erase(cast(N)->getSymbol());
+break;
   case ISD::VALUETYPE:
 Erased = ValueTypeNodes[cast(N)->getVT()] != 0;
 ValueTypeNodes[cast(N)->getVT()] = 0;
@@ -551,7 +554,15 @@
 SDOperand SelectionDAG::getExternalSymbol(const char *Sym, MVT::ValueType VT) {
   SDNode *&N = ExternalSymbols[Sym];
   if (N) return SDOperand(N, 0);
-  N = new ExternalSymbolSDNode(Sym, VT);
+  N = new ExternalSymbolSDNode(false, Sym, VT);
+  AllNodes.push_back(N);
+  return SDOperand(N, 0);
+}
+
+SDOperand SelectionDAG::getTargetExternalSymbol(const char *Sym, 
MVT::ValueType VT) {
+  SDNode *&N = TargetExternalSymbols[Sym];
+  if (N) return SDOperand(N, 0);
+  N = new ExternalSymbolSDNode(true, Sym, VT);
   AllNodes.push_back(N);
   return SDOperand(N, 0);
 }
@@ -1586,6 +1597,7 @@
   case ISD::BasicBlock:return "BasicBlock";
   case ISD::Register:  return "Register";
   case ISD::ExternalSymbol: return "ExternalSymbol";
+  case ISD::TargetExternalSymbol: return "TargetExternalSymbol";
   case ISD::ConstantPool:  return "ConstantPool";
   case ISD::TargetConstantPool:  return "TargetConstantPool";
   case ISD::CopyToReg: return "CopyToReg";



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h

2005-10-22 Thread Andrew Lenharth


Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.63 -> 1.64
SelectionDAGNodes.h updated: 1.69 -> 1.70
---
Log message:

add TargetExternalSymbol

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

 SelectionDAG.h  |2 ++
 SelectionDAGNodes.h |9 ++---
 2 files changed, 8 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.63 
llvm/include/llvm/CodeGen/SelectionDAG.h:1.64
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.63   Wed Oct 12 22:10:46 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.hSat Oct 22 22:40:17 2005
@@ -111,6 +111,7 @@
   SDOperand getTargetConstantPool(Constant *C, MVT::ValueType VT);
   SDOperand getBasicBlock(MachineBasicBlock *MBB);
   SDOperand getExternalSymbol(const char *Sym, MVT::ValueType VT);
+  SDOperand getTargetExternalSymbol(const char *Sym, MVT::ValueType VT);
   SDOperand getValueType(MVT::ValueType);
   SDOperand getRegister(unsigned Reg, MVT::ValueType VT);
 
@@ -382,6 +383,7 @@
   std::map BBNodes;
   std::vector ValueTypeNodes;
   std::map ExternalSymbols;
+  std::map TargetExternalSymbols;
   std::map > >,
SDNode*> OneResultNodes;


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.69 
llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.70
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.69  Wed Oct  5 01:34:34 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h   Sat Oct 22 22:40:17 2005
@@ -74,6 +74,7 @@
 TargetGlobalAddress,
 TargetFrameIndex,
 TargetConstantPool,
+TargetExternalSymbol,
 
 // CopyToReg - This node has three operands: a chain, a register number to
 // set to this value, and a value.  
@@ -932,8 +933,9 @@
   const char *Symbol;
 protected:
   friend class SelectionDAG;
-  ExternalSymbolSDNode(const char *Sym, MVT::ValueType VT)
-: SDNode(ISD::ExternalSymbol, VT), Symbol(Sym) {
+  ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT::ValueType VT)
+: SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol, VT),
+  Symbol(Sym) {
 }
 public:
 
@@ -941,7 +943,8 @@
 
   static bool classof(const ExternalSymbolSDNode *) { return true; }
   static bool classof(const SDNode *N) {
-return N->getOpcode() == ISD::ExternalSymbol;
+return N->getOpcode() == ISD::ExternalSymbol ||
+   N->getOpcode() == ISD::TargetExternalSymbol;
   }
 };
 



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp AlphaInstrInfo.td

2005-10-22 Thread Andrew Lenharth


Changes in directory llvm/lib/Target/Alpha:

AlphaISelDAGToDAG.cpp updated: 1.2 -> 1.3
AlphaInstrInfo.td updated: 1.67 -> 1.68
---
Log message:

Add several things.
loads
branches
setcc
working calls
Global address
External addresses

now I can manage malloc calls.



---
Diffs of the changes:  (+91 -23)

 AlphaISelDAGToDAG.cpp |  100 --
 AlphaInstrInfo.td |   14 +--
 2 files changed, 91 insertions(+), 23 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.2 
llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.3
--- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.2 Sat Oct 22 17:06:58 2005
+++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Sat Oct 22 22:43:48 2005
@@ -109,11 +109,74 @@
   case ISD::CALL: return SelectCALL(Op);
 
   case ISD::DYNAMIC_STACKALLOC:
-  case ISD::ADD_PARTS:
-  case ISD::SUB_PARTS:
-  case ISD::SETCC:
 assert(0 && "You want these too?");
 
+  case ISD::SETCC: {
+ISD::CondCode CC = cast(N->getOperand(2))->get();
+assert(MVT::isInteger(N->getOperand(0).getValueType()) && "FP numbers are 
unnecessary");
+SDOperand Op1 = Select(N->getOperand(0));
+SDOperand Op2 = Select(N->getOperand(1));
+unsigned Opc = Alpha::WTF;
+int dir;
+switch (CC) {
+default: N->dump(); assert(0 && "Unknown integer comparison!");
+case ISD::SETEQ:  Opc = Alpha::CMPEQ; dir=1; break;
+case ISD::SETLT:  Opc = Alpha::CMPLT; dir = 1; break;
+case ISD::SETLE:  Opc = Alpha::CMPLE; dir = 1; break;
+case ISD::SETGT:  Opc = Alpha::CMPLT; dir = 0; break;
+case ISD::SETGE:  Opc = Alpha::CMPLE; dir = 0; break;
+case ISD::SETULT: Opc = Alpha::CMPULT; dir = 1; break;
+case ISD::SETUGT: Opc = Alpha::CMPULT; dir = 0; break;
+case ISD::SETULE: Opc = Alpha::CMPULE; dir = 1; break;
+case ISD::SETUGE: Opc = Alpha::CMPULE; dir = 0; break;
+case ISD::SETNE: {//Handle this one special
+  SDOperand Tmp  = CurDAG->getTargetNode(Alpha::CMPEQ, MVT::i64, Op1, Op2);
+  CurDAG->SelectNodeTo(N, Alpha::CMPEQ, MVT::i64, 
CurDAG->getRegister(Alpha::R31, MVT::i64), Tmp);
+  return SDOperand(N, 0);
+}
+}
+CurDAG->SelectNodeTo(N, Opc, MVT::i64, dir ? Op1 : Op2, dir ? Op2 : Op1);
+return SDOperand(N, 0);
+  }
+
+  case ISD::BRCOND: {
+SDOperand Chain = Select(N->getOperand(0));
+SDOperand CC = Select(N->getOperand(1));
+CurDAG->SelectNodeTo(N, Alpha::BNE, MVT::Other,  CC, Chain);
+return SDOperand(N, 0);
+  }
+  case ISD::LOAD:
+  case ISD::EXTLOAD:
+  case ISD::ZEXTLOAD:
+  case ISD::SEXTLOAD: {
+SDOperand Chain = Select(N->getOperand(0));
+SDOperand Address = Select(N->getOperand(1));
+unsigned opcode = N->getOpcode();
+unsigned Opc = Alpha::WTF;
+if (opcode == ISD::LOAD)
+  switch (N->getValueType(0)) {
+  default: N->dump(); assert(0 && "Bad load!");
+  case MVT::i64: Opc = Alpha::LDQ; break;
+  case MVT::f64: Opc = Alpha::LDT; break;
+  case MVT::f32: Opc = Alpha::LDS; break;
+  }
+else
+  switch (cast(N->getOperand(3))->getVT()) {
+  default: N->dump(); assert(0 && "Bad sign extend!");
+  case MVT::i32: Opc = Alpha::LDL;
+assert(opcode != ISD::ZEXTLOAD && "Not sext"); break;
+  case MVT::i16: Opc = Alpha::LDWU;
+assert(opcode != ISD::SEXTLOAD && "Not zext"); break;
+  case MVT::i1: //FIXME: Treat i1 as i8 since there are problems otherwise
+  case MVT::i8: Opc = Alpha::LDBU;
+  assert(opcode != ISD::SEXTLOAD && "Not zext"); break;
+  }
+
+CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), MVT::Other,
+ getI64Imm(0), Address, Chain);
+return SDOperand(N, Op.ResNo);
+  }
+
   case ISD::BR: {
 CurDAG->SelectNodeTo(N, Alpha::BR_DAG, MVT::Other, N->getOperand(1),
  Select(N->getOperand(0)));
@@ -185,6 +248,11 @@
 CurDAG->SelectNodeTo(N, Alpha::LDQl, MVT::i64, GA, getGlobalBaseReg());
 return SDOperand(N, 0);
   }
+  case ISD::ExternalSymbol:
+CurDAG->SelectNodeTo(N, Alpha::LDQl, MVT::i64, 
+ 
CurDAG->getTargetExternalSymbol(cast(N)->getSymbol(), 
MVT::i64),
+ CurDAG->getRegister(AlphaLowering.getVRegGP(), 
MVT::i64));
+return SDOperand(N, 0);
 
   case ISD::CALLSEQ_START:
   case ISD::CALLSEQ_END: {
@@ -222,44 +290,37 @@
 SDOperand AlphaDAGToDAGISel::SelectCALL(SDOperand Op) {
   SDNode *N = Op.Val;
   SDOperand Chain = Select(N->getOperand(0));
-  SDOperand InFlag;  // Null incoming flag value.
   SDOperand Addr = Select(N->getOperand(1));
 
 //   unsigned CallOpcode;
std::vector CallOperands;
std::vector TypeOperands;
   
-   CallOperands.push_back(CurDAG->getCopyToReg(Chain, Alpha::R27, Addr));
-   CallOperands.push_back(getI64Imm(0));
-
//grab the arguments
for(int i = 2, e = N->getNumOperands(); i < e; ++i) {
- CallOperands.push_back(Select(N->getOperand(i)));
  Typ

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

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/lib/CodeGen:

IntrinsicLowering.cpp updated: 1.34 -> 1.35
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

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


Index: llvm/lib/CodeGen/IntrinsicLowering.cpp
diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.34 
llvm/lib/CodeGen/IntrinsicLowering.cpp:1.35
--- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.34 Wed Jul 27 01:12:33 2005
+++ llvm/lib/CodeGen/IntrinsicLowering.cpp  Sat Oct 22 23:37:20 2005
@@ -110,7 +110,8 @@
   case Intrinsic::memset:
 M.getOrInsertFunction("memset", PointerType::get(Type::SByteTy),
   PointerType::get(Type::SByteTy),
-  Type::IntTy, (--(--I->arg_end()))->getType(), 0);
+  Type::IntTy, (--(--I->arg_end()))->getType(),
+  (Type *)0);
 break;
   case Intrinsic::isunordered:
 EnsureFunctionExists(M, "isunordered", I->arg_begin(), I->arg_end(),



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/include/llvm:

Module.h updated: 1.62 -> 1.63
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

 Module.h |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Module.h
diff -u llvm/include/llvm/Module.h:1.62 llvm/include/llvm/Module.h:1.63
--- llvm/include/llvm/Module.h:1.62 Sun May 15 20:49:23 2005
+++ llvm/include/llvm/Module.h  Sat Oct 22 23:37:19 2005
@@ -22,6 +22,7 @@
 #include "llvm/Function.h"
 #include "llvm/GlobalVariable.h"
 #include "llvm/ADT/SetVector.h"
+#include "llvm/Support/DataTypes.h"
 
 namespace llvm {
 
@@ -111,7 +112,8 @@
   /// table.  If it does not exist, add a prototype for the function and return
   /// it.  This version of the method takes a null terminated list of function
   /// arguments, which makes it easier for clients to use.
-  Function *getOrInsertFunction(const std::string &Name, const Type 
*RetTy,...);
+  Function *getOrInsertFunction(const std::string &Name, const Type *RetTy,...)
+END_WITH_NULL;
 
   /// getFunction - Look up the specified function in the module symbol table.
   /// If it does not exist, return null.



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/lib/Bytecode/Reader:

Reader.cpp updated: 1.167 -> 1.168
ReaderWrappers.cpp updated: 1.51 -> 1.52
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

 Reader.cpp |6 --
 ReaderWrappers.cpp |6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)


Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.167 
llvm/lib/Bytecode/Reader/Reader.cpp:1.168
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.167   Mon Oct  3 16:26:53 2005
+++ llvm/lib/Bytecode/Reader/Reader.cpp Sat Oct 22 23:37:20 2005
@@ -680,7 +680,8 @@
 break;
   case 32: { //VANext_old
 const Type* ArgTy = getValue(iType, Oprnds[0])->getType();
-Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, 
ArgTy, 0);
+Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy,
+  (Type *)0);
 
 //b = vanext a, t ->
 //foo = alloca 1 of t
@@ -700,7 +701,8 @@
   }
   case 33: { //VAArg_old
 const Type* ArgTy = getValue(iType, Oprnds[0])->getType();
-Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, 
ArgTy, 0);
+Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy,
+  (Type *)0);
 
 //b = vaarg a, t ->
 //foo = alloca 1 of t


Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp
diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.51 
llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.52
--- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.51Wed Jul 27 01:12:33 2005
+++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Sat Oct 22 23:37:20 2005
@@ -181,7 +181,7 @@
 const Type* ArgTy = F->getFunctionType()->getReturnType();
 const Type* ArgTyPtr = PointerType::get(ArgTy);
 Function* NF = M->getOrInsertFunction("llvm.va_start",
-   RetTy, ArgTyPtr, 0);
+  RetTy, ArgTyPtr, (Type *)0);
 
 for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;)
   if (CallInst* CI = dyn_cast(*I++)) {
@@ -204,7 +204,7 @@
 const Type* ArgTy = F->getFunctionType()->getParamType(0);
 const Type* ArgTyPtr = PointerType::get(ArgTy);
 Function* NF = M->getOrInsertFunction("llvm.va_end",
- RetTy, ArgTyPtr, 0);
+  RetTy, ArgTyPtr, (Type *)0);
 
 for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;)
   if (CallInst* CI = dyn_cast(*I++)) {
@@ -230,7 +230,7 @@
 const Type* ArgTy = F->getFunctionType()->getReturnType();
 const Type* ArgTyPtr = PointerType::get(ArgTy);
 Function* NF = M->getOrInsertFunction("llvm.va_copy",
-  RetTy, ArgTyPtr, ArgTyPtr, 0);
+  RetTy, ArgTyPtr, ArgTyPtr, (Type 
*)0);
 
 for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;)
   if (CallInst* CI = dyn_cast(*I++)) {



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp InstLoops.cpp ProfilePaths.cpp

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths:

EdgeCode.cpp updated: 1.30 -> 1.31
InstLoops.cpp updated: 1.21 -> 1.22
ProfilePaths.cpp updated: 1.43 -> 1.44
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

 EdgeCode.cpp |2 +-
 InstLoops.cpp|3 ++-
 ProfilePaths.cpp |3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)


Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.30 
llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.31
--- llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.30  Sat Apr 
23 16:38:35 2005
+++ llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp   Sat Oct 
22 23:37:20 2005
@@ -40,7 +40,7 @@
   const Type *PIntTy = PointerType::get(Type::IntTy);
   Function *trigMeth = M->getOrInsertFunction("trigger", Type::VoidTy,
   Type::IntTy, Type::IntTy,
-  PIntTy, PIntTy, 0);
+  PIntTy, PIntTy, (Type *)0);
   assert(trigMeth && "trigger method could not be inserted!");
 
   vector trargs;


Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp:1.21 
llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp:1.22
--- llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp:1.21 Sat Apr 
23 16:38:35 2005
+++ llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp  Sat Oct 
22 23:37:20 2005
@@ -156,7 +156,8 @@
 }
 
 bool InstLoops::doInitialization (Module &M) {
-  inCountMth = M.getOrInsertFunction("llvm_first_trigger", Type::VoidTy, 0);
+  inCountMth = M.getOrInsertFunction("llvm_first_trigger", Type::VoidTy,
+ (Type *)0);
   return true;  // Module was modified.
 }
 


Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.43 
llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.44
--- llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.43  
Thu Apr 21 18:40:47 2005
+++ llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp   Sat Oct 
22 23:37:20 2005
@@ -189,7 +189,8 @@
 // IN THEIR INITIALIZE METHOD!!
 Function *initialize =
   F.getParent()->getOrInsertFunction("reoptimizerInitialize", Type::VoidTy,
- PointerType::get(Type::IntTy), 0);
+ PointerType::get(Type::IntTy),
+ (Type *)0);
 
 std::vector trargs;
 trargs.push_back(threshold);



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/lib/Transforms/Instrumentation:

ProfilingUtils.cpp updated: 1.6 -> 1.7
TraceBasicBlocks.cpp updated: 1.12 -> 1.13
TraceValues.cpp updated: 1.74 -> 1.75
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

 ProfilingUtils.cpp   |3 ++-
 TraceBasicBlocks.cpp |2 +-
 TraceValues.cpp  |   11 ++-
 3 files changed, 9 insertions(+), 7 deletions(-)


Index: llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.6 
llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.7
--- llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.6  Thu Apr 21 
18:40:46 2005
+++ llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp  Sat Oct 22 
23:37:20 2005
@@ -26,7 +26,8 @@
   const PointerType *UIntPtr = PointerType::get(Type::UIntTy);
   Module &M = *MainFn->getParent();
   Function *InitFn = M.getOrInsertFunction(FnName, Type::IntTy, Type::IntTy,
-   ArgVTy, UIntPtr, Type::UIntTy, 0);
+   ArgVTy, UIntPtr, Type::UIntTy,
+   (Type *)0);
 
   // This could force argc and argv into programs that wouldn't otherwise have
   // them, but instead we just pass null values in.


Index: llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
diff -u llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.12 
llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.13
--- llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.12   Sat Apr 
23 16:38:35 2005
+++ llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cppSat Oct 22 
23:37:20 2005
@@ -46,7 +46,7 @@
<< "\", \"" << FnName << "\", " << BBNumber << ")\n");
   Module &M = *BB->getParent ()->getParent ();
   Function *InstrFn = M.getOrInsertFunction (FnName, Type::VoidTy,
- Type::UIntTy, 0);
+ Type::UIntTy, (Type *)0);
   std::vector Args (1);
   Args[0] = ConstantUInt::get (Type::UIntTy, BBNumber);
 


Index: llvm/lib/Transforms/Instrumentation/TraceValues.cpp
diff -u llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.74 
llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.75
--- llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.74Sat Apr 23 
16:38:35 2005
+++ llvm/lib/Transforms/Instrumentation/TraceValues.cpp Sat Oct 22 23:37:20 2005
@@ -130,17 +130,18 @@
 
   // uint (sbyte*)
   HashPtrFunc = M.getOrInsertFunction("HashPointerToSeqNum", Type::UIntTy, SBP,
-  0);
+  (Type *)0);
 
   // void (sbyte*)
   ReleasePtrFunc = M.getOrInsertFunction("ReleasePointerSeqNum",
- Type::VoidTy, SBP, 0);
+ Type::VoidTy, SBP, (Type *)0);
   RecordPtrFunc  = M.getOrInsertFunction("RecordPointer",
- Type::VoidTy, SBP, 0);
+ Type::VoidTy, SBP, (Type *)0);
 
-  PushOnEntryFunc = M.getOrInsertFunction("PushPointerSet", Type::VoidTy, 0);
+  PushOnEntryFunc = M.getOrInsertFunction("PushPointerSet", Type::VoidTy,
+  (Type *)0);
   ReleaseOnReturnFunc = M.getOrInsertFunction("ReleasePointersPopSet",
-  Type::VoidTy, 0);
+  Type::VoidTy, (Type *)0);
 }
 
 



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/examples/Fibonacci/fibonacci.cpp

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/examples/Fibonacci:

fibonacci.cpp updated: 1.9 -> 1.10
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

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


Index: llvm/examples/Fibonacci/fibonacci.cpp
diff -u llvm/examples/Fibonacci/fibonacci.cpp:1.9 
llvm/examples/Fibonacci/fibonacci.cpp:1.10
--- llvm/examples/Fibonacci/fibonacci.cpp:1.9   Fri May  6 01:22:00 2005
+++ llvm/examples/Fibonacci/fibonacci.cpp   Sat Oct 22 23:37:19 2005
@@ -37,7 +37,8 @@
 static Function *CreateFibFunction(Module *M) {
   // Create the fib function and insert it into module M.  This function is 
said
   // to return an int and take an int parameter.
-  Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy, 0);
+  Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy,
+  (Type *)0);
 
   // Add a basic block to the function.
   BasicBlock *BB = new BasicBlock("EntryBlock", FibF);



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Debugger/UnixLocalInferiorProcess.cpp

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/lib/Debugger:

UnixLocalInferiorProcess.cpp updated: 1.8 -> 1.9
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

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


Index: llvm/lib/Debugger/UnixLocalInferiorProcess.cpp
diff -u llvm/lib/Debugger/UnixLocalInferiorProcess.cpp:1.8 
llvm/lib/Debugger/UnixLocalInferiorProcess.cpp:1.9
--- llvm/lib/Debugger/UnixLocalInferiorProcess.cpp:1.8  Thu Apr 21 17:36:21 2005
+++ llvm/lib/Debugger/UnixLocalInferiorProcess.cpp  Sat Oct 22 23:37:20 2005
@@ -924,7 +924,8 @@
 
   // If the program didn't explicitly call exit, call exit now, for the 
program.
   // This ensures that any atexit handlers get called correctly.
-  Function *Exit = M->getOrInsertFunction("exit", Type::VoidTy, Type::IntTy, 
0);
+  Function *Exit = M->getOrInsertFunction("exit", Type::VoidTy, Type::IntTy,
+  (Type *)0);
 
   std::vector Args;
   GenericValue ResultGV;



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/examples/HowToUseJIT/HowToUseJIT.cpp

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/examples/HowToUseJIT:

HowToUseJIT.cpp updated: 1.9 -> 1.10
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

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


Index: llvm/examples/HowToUseJIT/HowToUseJIT.cpp
diff -u llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.9 
llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.10
--- llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.9   Fri May  6 00:59:51 2005
+++ llvm/examples/HowToUseJIT/HowToUseJIT.cpp   Sat Oct 22 23:37:19 2005
@@ -51,7 +51,8 @@
   // Create the add1 function entry and insert this entry into module M.  The
   // function will have a return type of "int" and take an argument of "int".
   // The '0' terminates the list of argument types.
-  Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy, 
0);
+  Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy,
+   (Type *)0);
 
   // Add a basic block to the function. As before, it automatically inserts
   // because of the last argument.
@@ -76,7 +77,7 @@
 
   // Now we going to create function `foo', which returns an int and takes no
   // arguments.
-  Function *FooF = M->getOrInsertFunction("foo", Type::IntTy, 0);
+  Function *FooF = M->getOrInsertFunction("foo", Type::IntTy, (Type *)0);
 
   // Add a basic block to the FooF function.
   BB = new BasicBlock("EntryBlock", FooF);



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LowerAllocations.cpp LowerGC.cpp LowerInvoke.cpp

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/lib/Transforms/Scalar:

LowerAllocations.cpp updated: 1.54 -> 1.55
LowerGC.cpp updated: 1.8 -> 1.9
LowerInvoke.cpp updated: 1.33 -> 1.34
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

 LowerAllocations.cpp |2 +-
 LowerGC.cpp  |5 +++--
 LowerInvoke.cpp  |8 
 3 files changed, 8 insertions(+), 7 deletions(-)


Index: llvm/lib/Transforms/Scalar/LowerAllocations.cpp
diff -u llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.54 
llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.55
--- llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.54Fri May  6 
01:48:21 2005
+++ llvm/lib/Transforms/Scalar/LowerAllocations.cpp Sat Oct 22 23:37:20 2005
@@ -83,7 +83,7 @@
 MallocFunc = M.getOrInsertFunction("malloc", FT);
   }
   if (FreeFunc == 0)
-FreeFunc = M.getOrInsertFunction("free"  , Type::VoidTy, SBPTy, 0);
+FreeFunc = M.getOrInsertFunction("free"  , Type::VoidTy, SBPTy, (Type *)0);
 
   return true;
 }


Index: llvm/lib/Transforms/Scalar/LowerGC.cpp
diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.8 
llvm/lib/Transforms/Scalar/LowerGC.cpp:1.9
--- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.8  Thu Apr 21 18:45:12 2005
+++ llvm/lib/Transforms/Scalar/LowerGC.cpp  Sat Oct 22 23:37:20 2005
@@ -109,10 +109,11 @@
   // If the program is using read/write barriers, find the implementations of
   // them from the GC runtime library.
   if (GCReadInt)// Make:  sbyte* %llvm_gc_read(sbyte**)
-GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr, VoidPtr, 
VoidPtrPtr, 0);
+GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr, VoidPtr, 
VoidPtrPtr,
+   (Type *)0);
   if (GCWriteInt)   // Make:  void %llvm_gc_write(sbyte*, sbyte**)
 GCWrite = M.getOrInsertFunction("llvm_gc_write", Type::VoidTy,
-VoidPtr, VoidPtr, VoidPtrPtr, 0);
+VoidPtr, VoidPtr, VoidPtrPtr, (Type *)0);
 
   // If the program has GC roots, get or create the global root list.
   if (GCRootInt) {


Index: llvm/lib/Transforms/Scalar/LowerInvoke.cpp
diff -u llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.33 
llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.34
--- llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.33 Fri Sep 30 22:57:14 2005
+++ llvm/lib/Transforms/Scalar/LowerInvoke.cpp  Sat Oct 22 23:37:20 2005
@@ -124,14 +124,14 @@
   Constant::getNullValue(PtrJBList),
   "llvm.sjljeh.jblist", &M);
 SetJmpFn = M.getOrInsertFunction("llvm.setjmp", Type::IntTy,
- PointerType::get(JmpBufTy), NULL);
+ PointerType::get(JmpBufTy), (Type *)0);
 LongJmpFn = M.getOrInsertFunction("llvm.longjmp", Type::VoidTy,
   PointerType::get(JmpBufTy),
-  Type::IntTy, NULL);
+  Type::IntTy, (Type *)0);
   }
 
   // We need the 'write' and 'abort' functions for both models.
-  AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, NULL);
+  AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, (Type *)0);
 
   // Unfortunately, 'write' can end up being prototyped in several different
   // ways.  If the user defines a three (or more) operand function named 
'write'
@@ -148,7 +148,7 @@
   WriteFn = 0;
   } else {
 WriteFn = M.getOrInsertFunction("write", Type::VoidTy, Type::IntTy,
-VoidPtrTy, Type::IntTy, NULL);
+VoidPtrTy, Type::IntTy, (Type *)0);
   }
   return true;
 }



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/examples/ParallelJIT/ParallelJIT.cpp

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/examples/ParallelJIT:

ParallelJIT.cpp updated: 1.3 -> 1.4
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

 ParallelJIT.cpp |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm/examples/ParallelJIT/ParallelJIT.cpp
diff -u llvm/examples/ParallelJIT/ParallelJIT.cpp:1.3 
llvm/examples/ParallelJIT/ParallelJIT.cpp:1.4
--- llvm/examples/ParallelJIT/ParallelJIT.cpp:1.3   Wed Jul 27 01:12:33 2005
+++ llvm/examples/ParallelJIT/ParallelJIT.cpp   Sat Oct 22 23:37:19 2005
@@ -33,7 +33,8 @@
   // Create the add1 function entry and insert this entry into module M.  The
   // function will have a return type of "int" and take an argument of "int".
   // The '0' terminates the list of argument types.
-  Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy, 
0);
+  Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy,
+   (Type *)0);
 
   // Add a basic block to the function. As before, it automatically inserts
   // because of the last argument.
@@ -61,7 +62,8 @@
 {
   // Create the fib function and insert it into module M.  This function is 
said
   // to return an int and take an int parameter.
-  Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy, 0);
+  Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy,
+  (Type *)0);
 
   // Add a basic block to the function.
   BasicBlock *BB = new BasicBlock("EntryBlock", FibF);



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/tools/lli:

lli.cpp updated: 1.49 -> 1.50
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

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


Index: llvm/tools/lli/lli.cpp
diff -u llvm/tools/lli/lli.cpp:1.49 llvm/tools/lli/lli.cpp:1.50
--- llvm/tools/lli/lli.cpp:1.49 Thu Apr 21 18:59:31 2005
+++ llvm/tools/lli/lli.cpp  Sat Oct 22 23:37:20 2005
@@ -96,7 +96,8 @@
 // If the program didn't explicitly call exit, call exit now, for the 
program.
 // This ensures that any atexit handlers get called correctly.
 Function *Exit = MP->getModule()->getOrInsertFunction("exit", Type::VoidTy,
-  Type::IntTy, 0);
+  Type::IntTy,
+  (Type *)0);
 
 std::vector Args;
 GenericValue ResultGV;



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/lib/Transforms/IPO:

LowerSetJmp.cpp updated: 1.27 -> 1.28
SimplifyLibCalls.cpp updated: 1.54 -> 1.55
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

 LowerSetJmp.cpp  |   15 ---
 SimplifyLibCalls.cpp |5 +++--
 2 files changed, 11 insertions(+), 9 deletions(-)


Index: llvm/lib/Transforms/IPO/LowerSetJmp.cpp
diff -u llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.27 
llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.28
--- llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.27Wed Jun 15 17:49:30 2005
+++ llvm/lib/Transforms/IPO/LowerSetJmp.cpp Sat Oct 22 23:37:20 2005
@@ -204,32 +204,33 @@
 
   // void __llvm_sjljeh_init_setjmpmap(void**)
   InitSJMap = M.getOrInsertFunction("__llvm_sjljeh_init_setjmpmap",
-Type::VoidTy, SBPPTy, NULL);
+Type::VoidTy, SBPPTy, (Type *)0);
   // void __llvm_sjljeh_destroy_setjmpmap(void**)
   DestroySJMap = M.getOrInsertFunction("__llvm_sjljeh_destroy_setjmpmap",
-   Type::VoidTy, SBPPTy, NULL);
+   Type::VoidTy, SBPPTy, (Type *)0);
 
   // void __llvm_sjljeh_add_setjmp_to_map(void**, void*, unsigned)
   AddSJToMap = M.getOrInsertFunction("__llvm_sjljeh_add_setjmp_to_map",
  Type::VoidTy, SBPPTy, SBPTy,
- Type::UIntTy, NULL);
+ Type::UIntTy, (Type *)0);
 
   // void __llvm_sjljeh_throw_longjmp(int*, int)
   ThrowLongJmp = M.getOrInsertFunction("__llvm_sjljeh_throw_longjmp",
-   Type::VoidTy, SBPTy, Type::IntTy, NULL);
+   Type::VoidTy, SBPTy, Type::IntTy,
+   (Type *)0);
 
   // unsigned __llvm_sjljeh_try_catching_longjmp_exception(void **)
   TryCatchLJ =
 M.getOrInsertFunction("__llvm_sjljeh_try_catching_longjmp_exception",
-  Type::UIntTy, SBPPTy, NULL);
+  Type::UIntTy, SBPPTy, (Type *)0);
 
   // bool __llvm_sjljeh_is_longjmp_exception()
   IsLJException = M.getOrInsertFunction("__llvm_sjljeh_is_longjmp_exception",
-Type::BoolTy, NULL);
+Type::BoolTy, (Type *)0);
 
   // int __llvm_sjljeh_get_longjmp_value()
   GetLJValue = M.getOrInsertFunction("__llvm_sjljeh_get_longjmp_value",
- Type::IntTy, NULL);
+ Type::IntTy, (Type *)0);
   return true;
 }
 


Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.54 
llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.55
--- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.54   Thu Sep 29 01:17:27 2005
+++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cppSat Oct 22 23:37:20 2005
@@ -311,7 +311,8 @@
 if (!memcpy_func) {
   const Type *SBP = PointerType::get(Type::SByteTy);
   memcpy_func = M->getOrInsertFunction("llvm.memcpy", Type::VoidTy,SBP, 
SBP,
-   Type::UIntTy, Type::UIntTy, 0);
+   Type::UIntTy, Type::UIntTy,
+   (Type *)0);
 }
 return memcpy_func;
   }
@@ -319,7 +320,7 @@
   Function* get_floorf() {
 if (!floorf_func)
   floorf_func = M->getOrInsertFunction("floorf", Type::FloatTy,
-   Type::FloatTy, 0);
+   Type::FloatTy, (Type *)0);
 return floorf_func;
   }
   



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/include/llvm/Support:

CommandLine.h updated: 1.49 -> 1.50
DataTypes.h.in updated: 1.20 -> 1.21
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

 CommandLine.h  |3 ++-
 DataTypes.h.in |6 ++
 2 files changed, 8 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Support/CommandLine.h
diff -u llvm/include/llvm/Support/CommandLine.h:1.49 
llvm/include/llvm/Support/CommandLine.h:1.50
--- llvm/include/llvm/Support/CommandLine.h:1.49Thu Oct 13 19:33:05 2005
+++ llvm/include/llvm/Support/CommandLine.h Sat Oct 22 23:37:19 2005
@@ -21,6 +21,7 @@
 #define LLVM_SUPPORT_COMMANDLINE_H
 
 #include "llvm/Support/type_traits.h"
+#include "llvm/Support/DataTypes.h"
 #include 
 #include 
 #include 
@@ -335,7 +336,7 @@
 
 template
 ValuesClass values(const char *Arg, DataType Val, const char *Desc,
- ...) {
+ ...) END_WITH_NULL {
 va_list ValueArgs;
 va_start(ValueArgs, Desc);
 ValuesClass Vals(Arg, Val, Desc, ValueArgs);


Index: llvm/include/llvm/Support/DataTypes.h.in
diff -u llvm/include/llvm/Support/DataTypes.h.in:1.20 
llvm/include/llvm/Support/DataTypes.h.in:1.21
--- llvm/include/llvm/Support/DataTypes.h.in:1.20   Wed Jul 27 00:53:43 2005
+++ llvm/include/llvm/Support/DataTypes.h.inSat Oct 22 23:37:19 2005
@@ -98,4 +98,10 @@
 # define UINT64_MAX 0xULL
 #endif
 
+#if __GNUC__ > 3
+#define END_WITH_NULL __attribute__((sentinel))
+#else
+#define END_WITH_NULL
+#endif
+
 #endif  /* SUPPORT_DATATYPES_H */



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Jeff Cohen


Changes in directory llvm/tools/bugpoint:

Miscompilation.cpp updated: 1.71 -> 1.72
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

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


Index: llvm/tools/bugpoint/Miscompilation.cpp
diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.71 
llvm/tools/bugpoint/Miscompilation.cpp:1.72
--- llvm/tools/bugpoint/Miscompilation.cpp:1.71 Tue Aug  2 18:25:56 2005
+++ llvm/tools/bugpoint/Miscompilation.cpp  Sat Oct 22 23:37:20 2005
@@ -666,7 +666,7 @@
   Function *resolverFunc =
 Safe->getOrInsertFunction("getPointerToNamedFunction",
   PointerType::get(Type::SByteTy),
-  PointerType::get(Type::SByteTy), 0);
+  PointerType::get(Type::SByteTy), (Type *)0);
 
   // Use the function we just added to get addresses of functions we need.
   for (Module::iterator F = Safe->begin(), E = Safe->end(); F != E; ++F) {



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/Makefile.rules

2005-10-22 Thread Jeff Cohen


Changes in directory llvm:

Makefile.rules updated: 1.328 -> 1.329
---
Log message:

When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


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

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


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.328 llvm/Makefile.rules:1.329
--- llvm/Makefile.rules:1.328   Fri Oct 21 14:02:44 2005
+++ llvm/Makefile.rules Sat Oct 22 23:37:19 2005
@@ -221,7 +221,7 @@
   endif
 endif
 
-CXX.Flags += $(CXXFLAGS)
+CXX.Flags += $(CXXFLAGS) -Wformat
 C.Flags   += $(CFLAGS)
 CPP.Flags += $(CPPFLAGS)
 LD.Flags  += $(LDFLAGS)



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/Makefile.rules

2005-10-22 Thread Jeff Cohen


Changes in directory llvm:

Makefile.rules updated: 1.329 -> 1.330
---
Log message:

Remove redundant flag.

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

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


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.329 llvm/Makefile.rules:1.330
--- llvm/Makefile.rules:1.329   Sat Oct 22 23:37:19 2005
+++ llvm/Makefile.rules Sat Oct 22 23:51:22 2005
@@ -221,7 +221,7 @@
   endif
 endif
 
-CXX.Flags += $(CXXFLAGS) -Wformat
+CXX.Flags += $(CXXFLAGS)
 C.Flags   += $(CFLAGS)
 CPP.Flags += $(CPPFLAGS)
 LD.Flags  += $(LDFLAGS)



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Chris Lattner


Changes in directory llvm/include/llvm/Target:

SubtargetFeature.h updated: 1.3 -> 1.4
---
Log message:

Move static functions to .cpp file, reduce #includes, pass strings by 
const&.


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

 SubtargetFeature.h |   75 -
 1 files changed, 7 insertions(+), 68 deletions(-)


Index: llvm/include/llvm/Target/SubtargetFeature.h
diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.3 
llvm/include/llvm/Target/SubtargetFeature.h:1.4
--- llvm/include/llvm/Target/SubtargetFeature.h:1.3 Fri Sep  2 14:27:43 2005
+++ llvm/include/llvm/Target/SubtargetFeature.h Sun Oct 23 00:25:19 2005
@@ -18,11 +18,9 @@
 #ifndef LLVM_TARGET_SUBTARGETFEATURE_H
 #define LLVM_TARGET_SUBTARGETFEATURE_H
 
-
 #include 
 #include 
-#include 
-#include 
+#include 
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
@@ -57,80 +55,21 @@
 ///
 
 class SubtargetFeatures {
-private:
   std::vector Features;// Subtarget features as a vector
-
-  // Determine if a feature has a flag; '+' or '-'
-  static inline bool hasFlag(const std::string &Feature) {
-assert(!Feature.empty() && "Empty string");
-// Get first character
-char Ch = Feature[0];
-// Check if first character is '+' or '-' flag
-return Ch == '+' || Ch =='-';
-  }
-  
-  // Return true if enable flag; '+'.
-  static inline bool isEnabled(const std::string &Feature) {
-assert(!Feature.empty() && "Empty string");
-// Get first character
-char Ch = Feature[0];
-// Check if first character is '+' for enabled
-return Ch == '+';
-  }
-  
-  // Return a string with a prepended flag; '+' or '-'.
-  static inline std::string PrependFlag(const std::string &Feature,
-bool IsEnabled) {
-assert(!Feature.empty() && "Empty string");
-if (hasFlag(Feature)) return Feature;
-return std::string(IsEnabled ? "+" : "-") + Feature;
-  }
-  
-  // Return string stripped of flag.
-  static inline std::string StripFlag(const std::string &Feature) {
-return hasFlag(Feature) ? Feature.substr(1) : Feature;
-  }
-
-  /// Splits a string of comma separated items in to a vector of strings.
-  static void Split(std::vector &V, const std::string &S);
-  
-  /// Join a vector of strings into a string with a comma separating each
-  /// item.
-  static std::string Join(const std::vector &V);
-  
-  /// Convert a string to lowercase.
-  static std::string toLower(const std::string &S);
-  
-  /// Find item in array using binary search.
-  static const SubtargetFeatureKV *Find(const std::string &S,
-const SubtargetFeatureKV *A, size_t L);
-
 public:
-  /// Ctor.
-  SubtargetFeatures(const std::string Initial = std::string()) {
-// Break up string into separate features
-Split(Features, Initial);
-  }
+  SubtargetFeatures(const std::string &Initial = std::string());
 
   /// Features string accessors.
-  inline std::string getString() const { return Join(Features); }
-  void setString(const std::string &Initial) {
-// Throw out old features
-Features.clear();
-// Break up string into separate features
-Split(Features, toLower(Initial));
-  }
+  std::string getString() const;
+  void setString(const std::string &Initial);
 
   /// Setting CPU string.  Replaces previous setting.  Setting to "" clears 
CPU.
-  void setCPU(std::string String) { Features[0] = toLower(String); }
+  ///
+  void setCPU(const std::string &String);
   
   /// Adding Features.
   void AddFeature(const std::string &String, bool IsEnabled = true);
-
-  /// Display help for feature choices.
-  static void Help(const char *Heading,
-   const SubtargetFeatureKV *Table, size_t TableSize);
-
+   
   /// Parse feature string for quick usage.
   static uint32_t Parse(const std::string &String,
 const std::string &DefaultCPU,



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Chris Lattner


Changes in directory llvm/lib/Target:

SubtargetFeature.cpp updated: 1.4 -> 1.5
---
Log message:

Move static functions from .h file, reduce #includes, pass strings by const&,
use LowercaseString from StringExtras.h, remove extraneous space from help
output.


---
Diffs of the changes:  (+99 -45)

 SubtargetFeature.cpp |  144 +++
 1 files changed, 99 insertions(+), 45 deletions(-)


Index: llvm/lib/Target/SubtargetFeature.cpp
diff -u llvm/lib/Target/SubtargetFeature.cpp:1.4 
llvm/lib/Target/SubtargetFeature.cpp:1.5
--- llvm/lib/Target/SubtargetFeature.cpp:1.4Wed Sep  7 00:44:14 2005
+++ llvm/lib/Target/SubtargetFeature.cppSun Oct 23 00:26:26 2005
@@ -12,18 +12,55 @@
 
//===--===//
 
 #include "llvm/Target/SubtargetFeature.h"
-
-#include 
+#include "llvm/ADT/StringExtras.h"
 #include 
-#include 
 #include 
 #include 
-
+#include 
 using namespace llvm;
 
-/// Splits a string of comma separated items in to a vector of strings.
-void SubtargetFeatures::Split(std::vector &V,
-  const std::string &S) {
+//===--===//
+//  Static Helper Functions
+//===--===//
+
+/// hasFlag - Determine if a feature has a flag; '+' or '-'
+///
+static inline bool hasFlag(const std::string &Feature) {
+  assert(!Feature.empty() && "Empty string");
+  // Get first character
+  char Ch = Feature[0];
+  // Check if first character is '+' or '-' flag
+  return Ch == '+' || Ch =='-';
+}
+
+/// StripFlag - Return string stripped of flag.
+///
+static inline std::string StripFlag(const std::string &Feature) {
+  return hasFlag(Feature) ? Feature.substr(1) : Feature;
+}
+
+/// isEnabled - Return true if enable flag; '+'.
+///
+static inline bool isEnabled(const std::string &Feature) {
+  assert(!Feature.empty() && "Empty string");
+  // Get first character
+  char Ch = Feature[0];
+  // Check if first character is '+' for enabled
+  return Ch == '+';
+}
+
+/// PrependFlag - Return a string with a prepended flag; '+' or '-'.
+///
+static inline std::string PrependFlag(const std::string &Feature,
+  bool IsEnabled) {
+  assert(!Feature.empty() && "Empty string");
+  if (hasFlag(Feature)) return Feature;
+  return std::string(IsEnabled ? "+" : "-") + Feature;
+}
+
+/// Split - Splits a string of comma separated items in to a vector of strings.
+///
+static void Split(std::vector &V, const std::string &S) {
   // Start at beginning of string.
   size_t Pos = 0;
   while (true) {
@@ -43,7 +80,8 @@
 }
 
 /// Join a vector of strings to a string with a comma separating each element.
-std::string SubtargetFeatures::Join(const std::vector &V) {
+///
+static std::string Join(const std::vector &V) {
   // Start with empty string.
   std::string Result;
   // If the vector is not empty 
@@ -62,33 +100,19 @@
   return Result;
 }
 
-/// Convert a string to lowercase.
-std::string SubtargetFeatures::toLower(const std::string &S) {
-  // Copy the string
-  std::string Result = S;
-  // For each character in string
-  for (size_t i = 0; i < Result.size(); i++) {
-// Convert character to lowercase
-Result[i] = std::tolower(Result[i]);
-  }
-  // Return the lowercased string
-  return Result;
-}
-
 /// Adding features.
 void SubtargetFeatures::AddFeature(const std::string &String,
bool IsEnabled) {
   // Don't add empty features
   if (!String.empty()) {
 // Convert to lowercase, prepend flag and add to vector
-Features.push_back(PrependFlag(toLower(String), IsEnabled));
+Features.push_back(PrependFlag(LowercaseString(String), IsEnabled));
   }
 }
 
 /// Find item in array using binary search.
-const SubtargetFeatureKV *
-SubtargetFeatures::Find(const std::string &S,
-const SubtargetFeatureKV *A, size_t L) {
+static const SubtargetFeatureKV *Find(const std::string &S,
+  const SubtargetFeatureKV *A, size_t L) {
   // Determine the end of the array
   const SubtargetFeatureKV *Hi = A + L;
   // Binary search the array
@@ -100,29 +124,59 @@
 }
 
 /// Display help for feature choices.
-void SubtargetFeatures::Help(const char *Heading,
-  const SubtargetFeatureKV *Table, size_t TableSize) {
-// Determine the length of the longest key
-size_t MaxLen = 0;
-for (size_t i = 0; i < TableSize; i++)
-  MaxLen = std::max(MaxLen, std::strlen(Table[i].Key));
-// Print heading
-std::cerr << "Help for " << Heading << " choices\n\n";
-// For each feature
-for (size_t i = 0; i < TableSize; i++) {
-  // Compute required padding
-  size_t Pad = MaxLen - std::strlen(Table[i].Key) + 1;
-  // Print details
-  std::cerr << Table[i].Key << std::string(Pad, ' ') << "

[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.td

2005-10-22 Thread Chris Lattner


Changes in directory llvm/lib/Target/PowerPC:

PPC.td updated: 1.6 -> 1.7
---
Log message:

improve -help output


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

 PPC.td |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/PowerPC/PPC.td
diff -u llvm/lib/Target/PowerPC/PPC.td:1.6 llvm/lib/Target/PowerPC/PPC.td:1.7
--- llvm/lib/Target/PowerPC/PPC.td:1.6  Sat Oct 22 03:04:24 2005
+++ llvm/lib/Target/PowerPC/PPC.td  Sun Oct 23 00:28:51 2005
@@ -30,15 +30,15 @@
 //
  
 def Feature64Bit : SubtargetFeature<"64bit",
-"Should 64 bit instructions be used">;
+"Enable 64-bit instructions">;
 def Feature64BitRegs : SubtargetFeature<"64bitregs",
-"Should 64 bit registers be used">;
+"Enable 64-bit registers">;
 def FeatureAltivec   : SubtargetFeature<"altivec",
-"Should Altivec instructions be used">;
+"Enable Altivec instructions">;
 def FeatureGPUL  : SubtargetFeature<"gpul",
-"Should GPUL instructions be used">;
+"Enable GPUL instructions">;
 def FeatureFSqrt : SubtargetFeature<"fsqrt",
-"Should the fsqrt instruction be used">; 
+"Enable the fsqrt instruction">; 
 
 
//===--===//
 // PowerPC chips sets supported.



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-10-22 Thread Chris Lattner


Changes in directory llvm/lib/Target:

SubtargetFeature.cpp updated: 1.5 -> 1.6
---
Log message:

Improve help output.


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

 SubtargetFeature.cpp |   28 
 1 files changed, 16 insertions(+), 12 deletions(-)


Index: llvm/lib/Target/SubtargetFeature.cpp
diff -u llvm/lib/Target/SubtargetFeature.cpp:1.5 
llvm/lib/Target/SubtargetFeature.cpp:1.6
--- llvm/lib/Target/SubtargetFeature.cpp:1.5Sun Oct 23 00:26:26 2005
+++ llvm/lib/Target/SubtargetFeature.cppSun Oct 23 00:33:39 2005
@@ -125,25 +125,29 @@
 
 /// Display help for feature choices.
 ///
-static void Help(const char *Heading, const SubtargetFeatureKV *Table,
+static void Help(bool isFeature, const SubtargetFeatureKV *Table,
  size_t TableSize) {
-  // Determine the length of the longest key
+  // Determine the length of the longest key.
   size_t MaxLen = 0;
   for (size_t i = 0; i < TableSize; i++)
 MaxLen = std::max(MaxLen, std::strlen(Table[i].Key));
-  // Print heading
-  std::cerr << "Help for " << Heading << " choices:\n\n";
-  // For each feature
+  
+  std::cerr << "Available " << (isFeature ? "features" : "CPUs")
+<< " for this target:\n\n";
+
   for (size_t i = 0; i < TableSize; i++) {
 // Compute required padding
 size_t Pad = MaxLen - std::strlen(Table[i].Key);
-// Print details
 std::cerr << Table[i].Key << std::string(Pad, ' ') << " - "
-  << Table[i].Desc << "\n";
+  << Table[i].Desc << ".\n";
+  }
+
+  std::cerr << "\n";
+  if (isFeature) {
+std::cerr
+  << "Use +feature to enable a feature, or -feature to disable it.\n"
+  << "For example, llc -mcpu=mycpu -mattr=+feature1,-feature2\n";
   }
-  // Wrap it up
-  std::cerr << "\n\n";
-  // Leave tool
   exit(1);
 }
 
@@ -202,7 +206,7 @@
   // Check if default is needed
   if (Features[0].empty()) Features[0] = DefaultCPU;
   // Check for help
-  if (Features[0] == "help") Help("CPU", CPUTable, CPUTableSize);
+  if (Features[0] == "help") Help(false, CPUTable, CPUTableSize);
   // Find CPU entry
   const SubtargetFeatureKV *CPUEntry =
 Find(Features[0], CPUTable, CPUTableSize);
@@ -221,7 +225,7 @@
 // Get next feature
 const std::string &Feature = Features[i];
 // Check for help
-if (Feature == "+help") Help("feature", FeatureTable, FeatureTableSize);
+if (Feature == "+help") Help(true, FeatureTable, FeatureTableSize);
 // Find feature in table.
 const SubtargetFeatureKV *FeatureEntry =
Find(StripFlag(Feature), FeatureTable, 
FeatureTableSize);



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/utils/TableGen/TableGen.cpp InstrSelectorEmitter.cpp InstrSelectorEmitter.h

2005-10-22 Thread Chris Lattner


Changes in directory llvm/utils/TableGen:

TableGen.cpp updated: 1.40 -> 1.41
InstrSelectorEmitter.cpp (r1.45) removed
InstrSelectorEmitter.h (r1.27) removed
---
Log message:

Remove the obsolete instr selector emitter



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

 TableGen.cpp |8 +---
 1 files changed, 1 insertion(+), 7 deletions(-)


Index: llvm/utils/TableGen/TableGen.cpp
diff -u llvm/utils/TableGen/TableGen.cpp:1.40 
llvm/utils/TableGen/TableGen.cpp:1.41
--- llvm/utils/TableGen/TableGen.cpp:1.40   Fri Oct 21 14:02:44 2005
+++ llvm/utils/TableGen/TableGen.cppSun Oct 23 00:47:52 2005
@@ -23,7 +23,6 @@
 #include "RegisterInfoEmitter.h"
 #include "InstrInfoEmitter.h"
 #include "AsmWriterEmitter.h"
-#include "InstrSelectorEmitter.h"
 #include "DAGISelEmitter.h"
 #include "SubtargetEmitter.h"
 #include 
@@ -35,7 +34,7 @@
   PrintRecords,
   GenEmitter,
   GenRegisterEnums, GenRegister, GenRegisterHeader,
-  GenInstrEnums, GenInstrs, GenAsmWriter, GenInstrSelector,
+  GenInstrEnums, GenInstrs, GenAsmWriter, 
   GenDAGISel,
   GenSubtarget,
   PrintEnums,
@@ -61,8 +60,6 @@
"Generate instruction descriptions"),
 clEnumValN(GenAsmWriter, "gen-asm-writer",
"Generate assembly writer"),
-clEnumValN(GenInstrSelector, "gen-instr-selector",
-   "Generate an instruction selector"),
 clEnumValN(GenDAGISel, "gen-dag-isel",
"Generate a DAG instruction selector"),
 clEnumValN(GenSubtarget, "gen-subtarget",
@@ -470,9 +467,6 @@
   AsmWriterEmitter(Records).run(*Out);
   break;
 
-case GenInstrSelector:
-  InstrSelectorEmitter(Records).run(*Out);
-  break;
 case GenDAGISel:
   DAGISelEmitter(Records).run(*Out);
   break;



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits