aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-05-13 01:02:19 +0000
committerChris Lattner <sabre@nondot.org>2010-05-13 01:02:19 +0000
commitbef0efd11bc4430a3ee437a3213cec5c18af855a (patch)
tree7e166484d6f920b54d2fb1f072d3252aae31fa3d
parent0f91f6a2eacf29fb69b1b0c3131eb0385aad5777 (diff)
add a couple of key functions for classes without them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103688 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/Expr.h1
-rw-r--r--include/clang/AST/Type.h2
-rw-r--r--lib/AST/Expr.cpp2
-rw-r--r--lib/AST/Type.cpp4
4 files changed, 8 insertions, 1 deletions
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index f3470a4b1d..aff6376aee 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -51,6 +51,7 @@ typedef UsuallyTinyPtrVector<const CXXBaseSpecifier> CXXBaseSpecifierArray;
class Expr : public Stmt {
QualType TR;
+ virtual void ANCHOR(); // key function.
protected:
/// TypeDependent - Whether this expression is type-dependent
/// (C++ [temp.dep.expr]).
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index dbf64371ab..49022a8a61 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -1733,6 +1733,8 @@ public:
/// class of FunctionNoProtoType and FunctionProtoType.
///
class FunctionType : public Type {
+ virtual void ANCHOR(); // Key function for FunctionType.
+
/// SubClassData - This field is owned by the subclass, put here to pack
/// tightly with the ivars in Type.
bool SubClassData : 1;
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 4a616719cc..39643eebcb 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -27,6 +27,8 @@
#include <algorithm>
using namespace clang;
+void Expr::ANCHOR() {} // key function for Expr class.
+
/// isKnownToHaveBooleanValue - Return true if this is an integer expression
/// that is known to return 0 or 1. This happens for _Bool/bool expressions
/// but also int expressions which are produced by things like comparisons in
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 843785e634..a5c3a209c8 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -906,10 +906,12 @@ const char *BuiltinType::getName(const LangOptions &LO) const {
case UndeducedAuto: return "auto";
case ObjCId: return "id";
case ObjCClass: return "Class";
- case ObjCSel: return "SEL";
+ case ObjCSel: return "SEL";
}
}
+void FunctionType::ANCHOR() {} // Key function for FunctionType.
+
llvm::StringRef FunctionType::getNameForCallConv(CallingConv CC) {
switch (CC) {
case CC_Default: llvm_unreachable("no name for default cc");