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

Chris Lattner lattner at cs.uiuc.edu
Mon Oct 4 17:33:25 PDT 2004



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

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

Make this compile and work


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

Index: llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/Makefile
diff -c /dev/null llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/Makefile:1.1
*** /dev/null	Mon Oct  4 19:33:24 2004
--- llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/Makefile	Mon Oct  4 19:33:14 2004
***************
*** 0 ****
--- 1,6 ----
+ LEVEL = ../../../..
+ 
+ PROG     = deriv1
+ LDFLAGS  = -lstdc++
+ include $(LEVEL)/MultiSource/Makefile.multisrc
+ 


Index: llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/student2.cpp
diff -u llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/student2.cpp:1.1 llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/student2.cpp:1.2
--- llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/student2.cpp:1.1	Mon Oct  4 15:01:13 2004
+++ llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/student2.cpp	Mon Oct  4 19:33:14 2004
@@ -1,7 +1,8 @@
 // Written for undergraduate C++ course project at Dept of
 // Computer Science, Rutgers University.
 
-#include <stream.h>
+#include <iostream>
+using namespace std;
 #include <string.h>
 #include "student2.h"
 void bin_op_expr::print_me()


Index: llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/student2.h
diff -u llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/student2.h:1.1 llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/student2.h:1.2
--- llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/student2.h:1.1	Mon Oct  4 15:01:13 2004
+++ llvm-test/MultiSource/Benchmarks/Prolangs-C++/deriv1/student2.h	Mon Oct  4 19:33:14 2004
@@ -49,7 +49,7 @@
 private:
   char *name;
  public:
-  var_expr(strng str) {strcpy(name,str);}
+  var_expr(strng str) {name = strdup(str);}
 			/* Copy the initialization string
                        into the name buffer. To read the documentation for
                        strcpy() and other C string manipulation functions,






More information about the llvm-commits mailing list