summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2013-11-15 22:34:48 +0000
committerJuergen Ributzka <juergen@apple.com>2013-11-15 22:34:48 +0000
commit5a364c5561ec04e33a6f5d52c14f1bac6f247ea0 (patch)
tree2fcdad4351006993fd039cba47193d98cdfc5ae3 /examples
parent17d4ac8c461fb3c32483cf7a37bc52937caeb650 (diff)
downloadexternal_llvm-5a364c5561ec04e33a6f5d52c14f1bac6f247ea0.zip
external_llvm-5a364c5561ec04e33a6f5d52c14f1bac6f247ea0.tar.gz
external_llvm-5a364c5561ec04e33a6f5d52c14f1bac6f247ea0.tar.bz2
[weak vtables] Remove a bunch of weak vtables
This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r--examples/ExceptionDemo/ExceptionDemo.cpp4
-rw-r--r--examples/Kaleidoscope/Chapter2/toy.cpp16
-rw-r--r--examples/Kaleidoscope/Chapter3/toy.cpp4
-rw-r--r--examples/Kaleidoscope/Chapter4/toy.cpp4
-rw-r--r--examples/Kaleidoscope/Chapter5/toy.cpp4
-rw-r--r--examples/Kaleidoscope/Chapter6/toy.cpp4
-rw-r--r--examples/Kaleidoscope/Chapter7/toy.cpp4
7 files changed, 33 insertions, 7 deletions
diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp
index 61b1750..c935206 100644
--- a/examples/ExceptionDemo/ExceptionDemo.cpp
+++ b/examples/ExceptionDemo/ExceptionDemo.cpp
@@ -1577,9 +1577,11 @@ public:
std::runtime_error::operator=(toCopy)));
}
- ~OurCppRunException (void) throw () {}
+ ~OurCppRunException (void) throw ();
};
+OurCppRunException::~OurCppRunException() throw () {}
+
/// Throws foreign C++ exception.
/// @param ignoreIt unused parameter that allows function to match implied
diff --git a/examples/Kaleidoscope/Chapter2/toy.cpp b/examples/Kaleidoscope/Chapter2/toy.cpp
index 2dc6711..43eeb1c 100644
--- a/examples/Kaleidoscope/Chapter2/toy.cpp
+++ b/examples/Kaleidoscope/Chapter2/toy.cpp
@@ -79,28 +79,39 @@ static int gettok() {
/// ExprAST - Base class for all expression nodes.
class ExprAST {
public:
- virtual ~ExprAST() {}
+ virtual ~ExprAST();
};
+ExprAST::~ExprAST() {}
+
/// NumberExprAST - Expression class for numeric literals like "1.0".
class NumberExprAST : public ExprAST {
public:
NumberExprAST(double val) {}
+ virtual ~NumberExprAST();
};
+NumberExprAST::~NumberExprAST() {}
+
/// VariableExprAST - Expression class for referencing a variable, like "a".
class VariableExprAST : public ExprAST {
std::string Name;
public:
VariableExprAST(const std::string &name) : Name(name) {}
+ virtual ~VariableExprAST();
};
+VariableExprAST::~VariableExprAST() {}
+
/// BinaryExprAST - Expression class for a binary operator.
class BinaryExprAST : public ExprAST {
public:
BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs) {}
+ virtual ~BinaryExprAST();
};
+BinaryExprAST::~BinaryExprAST() {}
+
/// CallExprAST - Expression class for function calls.
class CallExprAST : public ExprAST {
std::string Callee;
@@ -108,8 +119,11 @@ class CallExprAST : public ExprAST {
public:
CallExprAST(const std::string &callee, std::vector<ExprAST*> &args)
: Callee(callee), Args(args) {}
+ virtual ~CallExprAST();
};
+CallExprAST::~CallExprAST() {}
+
/// PrototypeAST - This class represents the "prototype" for a function,
/// which captures its name, and its argument names (thus implicitly the number
/// of arguments the function takes).
diff --git a/examples/Kaleidoscope/Chapter3/toy.cpp b/examples/Kaleidoscope/Chapter3/toy.cpp
index 0fb64e3..d25aa5d 100644
--- a/examples/Kaleidoscope/Chapter3/toy.cpp
+++ b/examples/Kaleidoscope/Chapter3/toy.cpp
@@ -84,10 +84,12 @@ static int gettok() {
/// ExprAST - Base class for all expression nodes.
class ExprAST {
public:
- virtual ~ExprAST() {}
+ virtual ~ExprAST();
virtual Value *Codegen() = 0;
};
+ExprAST::~ExprAST() {}
+
/// NumberExprAST - Expression class for numeric literals like "1.0".
class NumberExprAST : public ExprAST {
double Val;
diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp
index 0e41cc1..a52b555 100644
--- a/examples/Kaleidoscope/Chapter4/toy.cpp
+++ b/examples/Kaleidoscope/Chapter4/toy.cpp
@@ -91,10 +91,12 @@ static int gettok() {
/// ExprAST - Base class for all expression nodes.
class ExprAST {
public:
- virtual ~ExprAST() {}
+ virtual ~ExprAST();
virtual Value *Codegen() = 0;
};
+ExprAST::~ExprAST() {}
+
/// NumberExprAST - Expression class for numeric literals like "1.0".
class NumberExprAST : public ExprAST {
double Val;
diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp
index d5a88a5..2770a38 100644
--- a/examples/Kaleidoscope/Chapter5/toy.cpp
+++ b/examples/Kaleidoscope/Chapter5/toy.cpp
@@ -100,10 +100,12 @@ static int gettok() {
/// ExprAST - Base class for all expression nodes.
class ExprAST {
public:
- virtual ~ExprAST() {}
+ virtual ~ExprAST();
virtual Value *Codegen() = 0;
};
+ExprAST::~ExprAST() {}
+
/// NumberExprAST - Expression class for numeric literals like "1.0".
class NumberExprAST : public ExprAST {
double Val;
diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp
index 4d6a128..2a0f212 100644
--- a/examples/Kaleidoscope/Chapter6/toy.cpp
+++ b/examples/Kaleidoscope/Chapter6/toy.cpp
@@ -105,10 +105,12 @@ static int gettok() {
/// ExprAST - Base class for all expression nodes.
class ExprAST {
public:
- virtual ~ExprAST() {}
+ virtual ~ExprAST();
virtual Value *Codegen() = 0;
};
+ExprAST::~ExprAST() {}
+
/// NumberExprAST - Expression class for numeric literals like "1.0".
class NumberExprAST : public ExprAST {
double Val;
diff --git a/examples/Kaleidoscope/Chapter7/toy.cpp b/examples/Kaleidoscope/Chapter7/toy.cpp
index beb0c00..0062801 100644
--- a/examples/Kaleidoscope/Chapter7/toy.cpp
+++ b/examples/Kaleidoscope/Chapter7/toy.cpp
@@ -109,10 +109,12 @@ static int gettok() {
/// ExprAST - Base class for all expression nodes.
class ExprAST {
public:
- virtual ~ExprAST() {}
+ virtual ~ExprAST();
virtual Value *Codegen() = 0;
};
+ExprAST::~ExprAST() {}
+
/// NumberExprAST - Expression class for numeric literals like "1.0".
class NumberExprAST : public ExprAST {
double Val;