[llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/Makefile tree.cpp tree.h

Chris Lattner lattner at cs.uiuc.edu
Mon Oct 4 20:50:58 PDT 2004



Changes in directory llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees:

Makefile added (r1.1)
tree.cpp updated: 1.1 -> 1.2
tree.h updated: 1.1 -> 1.2
---
Log message:

Make this compile and work


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

Index: llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/Makefile
diff -c /dev/null llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/Makefile:1.1
*** /dev/null	Mon Oct  4 22:50:57 2004
--- llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/Makefile	Mon Oct  4 22:50:47 2004
***************
*** 0 ****
--- 1,7 ----
+ LEVEL = ../../../..
+ 
+ PROG     = trees
+ LIBS  = -lstdc++
+ LDFLAGS = -lstdc++
+ include $(LEVEL)/MultiSource/Makefile.multisrc
+ 


Index: llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/tree.cpp
diff -u llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/tree.cpp:1.1 llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/tree.cpp:1.2
--- llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/tree.cpp:1.1	Mon Oct  4 15:01:15 2004
+++ llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/tree.cpp	Mon Oct  4 22:50:47 2004
@@ -86,7 +86,7 @@
 
 // RealNode.cc
 
-RealNode::RealNode(float k, char* ch) {
+RealNode::RealNode(float k, char* ch) : symbol(0) {
   n = k;
   if (ch) {
     strlen(ch), symbol = new char;
@@ -107,7 +107,7 @@
 
 // main.cc
 
-main () {
+int main () {
   Tree t1(1), t2("u"), t3(5);
   Tree t4(t1,"*",t2);
   Tree t5("-",t3);


Index: llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/tree.h
diff -u llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/tree.h:1.1 llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/tree.h:1.2
--- llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/tree.h:1.1	Mon Oct  4 15:01:15 2004
+++ llvm-test/MultiSource/Benchmarks/Prolangs-C++/trees/tree.h	Mon Oct  4 22:50:47 2004
@@ -50,7 +50,7 @@
 
   RealNode(float k, char* ch=0);
 
-  ~RealNode(void) {delete symbol; this->Node::~Node();}
+  ~RealNode(void) {delete symbol; }
 
   float nodeValue();
 };
@@ -66,7 +66,7 @@
 
   UnaryNode(char* a, Tree b);
 
-  ~UnaryNode(void) {delete op; delete opnd; this->Node::~Node();}
+  ~UnaryNode(void) {delete op; delete opnd; }
 
   float nodeValue();
 };
@@ -84,7 +84,7 @@
 
   BinaryNode(char* a, Tree b, Tree c);
 
-  ~BinaryNode(void) {delete op; delete left; delete right; this->Node::~Node();}
+  ~BinaryNode(void) {delete op; delete left; delete right; }
 
   float nodeValue();
 };






More information about the llvm-commits mailing list