projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[weak vtables] Remove a bunch of weak vtables
[oota-llvm.git]
/
examples
/
Kaleidoscope
/
Chapter6
/
toy.cpp
diff --git
a/examples/Kaleidoscope/Chapter6/toy.cpp
b/examples/Kaleidoscope/Chapter6/toy.cpp
index c16d6bdb5b562832324d39f3d88555f8b4fcc42c..2a0f212ef414ebee1f1ac8f34d4172b6fb3bc23d 100644
(file)
--- a/
examples/Kaleidoscope/Chapter6/toy.cpp
+++ b/
examples/Kaleidoscope/Chapter6/toy.cpp
@@
-1,18
+1,19
@@
-#include "llvm/DerivedTypes.h"
+#include "llvm/Analysis/Passes.h"
+#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
+#include "llvm/IR/DataLayout.h"
+#include "llvm/IR/DerivedTypes.h"
+#include "llvm/IR/IRBuilder.h"
+#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
#include "llvm/PassManager.h"
#include "llvm/PassManager.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Support/IRBuilder.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/TargetSelect.h"
+#include "llvm/Transforms/Scalar.h"
+#include <cctype>
#include <cstdio>
#include <cstdio>
-#include <string>
#include <map>
#include <map>
+#include <string>
#include <vector>
using namespace llvm;
#include <vector>
using namespace llvm;
@@
-104,10
+105,12
@@
static int gettok() {
/// ExprAST - Base class for all expression nodes.
class ExprAST {
public:
/// ExprAST - Base class for all expression nodes.
class ExprAST {
public:
- virtual ~ExprAST()
{}
+ virtual ~ExprAST()
;
virtual Value *Codegen() = 0;
};
virtual Value *Codegen() = 0;
};
+ExprAST::~ExprAST() {}
+
/// NumberExprAST - Expression class for numeric literals like "1.0".
class NumberExprAST : public ExprAST {
double Val;
/// NumberExprAST - Expression class for numeric literals like "1.0".
class NumberExprAST : public ExprAST {
double Val;
@@
-947,7
+950,7
@@
int main() {
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
- OurFPM.add(new
TargetData(*TheExecutionEngine->getTargetData
()));
+ OurFPM.add(new
DataLayout(*TheExecutionEngine->getDataLayout
()));
// Provide basic AliasAnalysis support for GVN.
OurFPM.add(createBasicAliasAnalysisPass());
// Do simple "peephole" optimizations and bit-twiddling optzns.
// Provide basic AliasAnalysis support for GVN.
OurFPM.add(createBasicAliasAnalysisPass());
// Do simple "peephole" optimizations and bit-twiddling optzns.