summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaPseudoObject.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-05-26 06:22:03 +0000
committerCraig Topper <craig.topper@gmail.com>2014-05-26 06:22:03 +0000
commit6b8c5857eb9d309f9adb9149d9f383a29a9b68e7 (patch)
tree56e8b6db6892b13eea6e33509cb7751501b94409 /lib/Sema/SemaPseudoObject.cpp
parentb0449def46f3e7efc8dd134ac68ce71399ba6573 (diff)
[C++11] Use 'nullptr'. Sema edition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaPseudoObject.cpp')
-rw-r--r--lib/Sema/SemaPseudoObject.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/lib/Sema/SemaPseudoObject.cpp b/lib/Sema/SemaPseudoObject.cpp
index a28ad5eb07..94b19431a3 100644
--- a/lib/Sema/SemaPseudoObject.cpp
+++ b/lib/Sema/SemaPseudoObject.cpp
@@ -268,7 +268,8 @@ namespace {
public:
ObjCPropertyOpBuilder(Sema &S, ObjCPropertyRefExpr *refExpr) :
PseudoOpBuilder(S, refExpr->getLocation()), RefExpr(refExpr),
- SyntacticRefExpr(0), InstanceReceiver(0), Getter(0), Setter(0) {
+ SyntacticRefExpr(nullptr), InstanceReceiver(nullptr), Getter(nullptr),
+ Setter(nullptr) {
}
ExprResult buildRValueOperation(Expr *op);
@@ -307,9 +308,9 @@ namespace {
ObjCSubscriptOpBuilder(Sema &S, ObjCSubscriptRefExpr *refExpr) :
PseudoOpBuilder(S, refExpr->getSourceRange().getBegin()),
RefExpr(refExpr),
- InstanceBase(0), InstanceKey(0),
- AtIndexGetter(0), AtIndexSetter(0) { }
-
+ InstanceBase(nullptr), InstanceKey(nullptr),
+ AtIndexGetter(nullptr), AtIndexSetter(nullptr) {}
+
ExprResult buildRValueOperation(Expr *op);
ExprResult buildAssignmentOperation(Scope *Sc,
SourceLocation opLoc,
@@ -579,7 +580,7 @@ bool ObjCPropertyOpBuilder::findGetter() {
ObjCPropertyDecl *prop = RefExpr->getExplicitProperty();
Getter = LookupMethodInReceiverType(S, prop->getGetterName(), RefExpr);
- return (Getter != 0);
+ return (Getter != nullptr);
}
/// Try to find the most accurate setter declaration for the property
@@ -644,7 +645,7 @@ bool ObjCPropertyOpBuilder::findSetter(bool warn) {
/// Capture the base object of an Objective-C property expression.
Expr *ObjCPropertyOpBuilder::rebuildAndCaptureObject(Expr *syntacticBase) {
- assert(InstanceReceiver == 0);
+ assert(InstanceReceiver == nullptr);
// If we have a base, capture it in an OVE and rebuild the syntactic
// form to use the OVE as its base.
@@ -967,8 +968,8 @@ ObjCSubscriptOpBuilder::buildAssignmentOperation(Scope *Sc,
/// Capture the base object of an Objective-C Index'ed expression.
Expr *ObjCSubscriptOpBuilder::rebuildAndCaptureObject(Expr *syntacticBase) {
- assert(InstanceBase == 0);
-
+ assert(InstanceBase == nullptr);
+
// Capture base expression in an OVE and rebuild the syntactic
// form to use the OVE as its base expression.
InstanceBase = capture(RefExpr->getBaseExpr());
@@ -1134,7 +1135,7 @@ bool ObjCSubscriptOpBuilder::findAtIndexGetter() {
AtIndexGetter = ObjCMethodDecl::Create(S.Context, SourceLocation(),
SourceLocation(), AtIndexGetterSelector,
S.Context.getObjCIdType() /*ReturnType*/,
- 0 /*TypeSourceInfo */,
+ nullptr /*TypeSourceInfo */,
S.Context.getTranslationUnitDecl(),
true /*Instance*/, false/*isVariadic*/,
/*isPropertyAccessor=*/false,
@@ -1147,9 +1148,9 @@ bool ObjCSubscriptOpBuilder::findAtIndexGetter() {
: &S.Context.Idents.get("key"),
arrayRef ? S.Context.UnsignedLongTy
: S.Context.getObjCIdType(),
- /*TInfo=*/0,
+ /*TInfo=*/nullptr,
SC_None,
- 0);
+ nullptr);
AtIndexGetter->setMethodParams(S.Context, Argument, None);
}
@@ -1243,7 +1244,7 @@ bool ObjCSubscriptOpBuilder::findAtIndexSetter() {
BaseT->isObjCQualifiedIdType());
if (!AtIndexSetter && S.getLangOpts().DebuggerObjCLiteral) {
- TypeSourceInfo *ReturnTInfo = 0;
+ TypeSourceInfo *ReturnTInfo = nullptr;
QualType ReturnType = S.Context.VoidTy;
AtIndexSetter = ObjCMethodDecl::Create(
S.Context, SourceLocation(), SourceLocation(), AtIndexSetterSelector,
@@ -1257,9 +1258,9 @@ bool ObjCSubscriptOpBuilder::findAtIndexSetter() {
SourceLocation(), SourceLocation(),
&S.Context.Idents.get("object"),
S.Context.getObjCIdType(),
- /*TInfo=*/0,
+ /*TInfo=*/nullptr,
SC_None,
- 0);
+ nullptr);
Params.push_back(object);
ParmVarDecl *key = ParmVarDecl::Create(S.Context, AtIndexSetter,
SourceLocation(), SourceLocation(),
@@ -1267,9 +1268,9 @@ bool ObjCSubscriptOpBuilder::findAtIndexSetter() {
: &S.Context.Idents.get("key"),
arrayRef ? S.Context.UnsignedLongTy
: S.Context.getObjCIdType(),
- /*TInfo=*/0,
+ /*TInfo=*/nullptr,
SC_None,
- 0);
+ nullptr);
Params.push_back(key);
AtIndexSetter->setMethodParams(S.Context, Params, None);
}
@@ -1409,7 +1410,7 @@ ExprResult MSPropertyOpBuilder::buildGet() {
ExprResult GetterExpr = S.ActOnMemberAccessExpr(
S.getCurScope(), RefExpr->getBaseExpr(), SourceLocation(),
RefExpr->isArrow() ? tok::arrow : tok::period, SS, SourceLocation(),
- GetterName, 0, true);
+ GetterName, nullptr, true);
if (GetterExpr.isInvalid()) {
S.Diag(RefExpr->getMemberLoc(),
diag::error_cannot_find_suitable_accessor) << 0 /* getter */
@@ -1439,7 +1440,7 @@ ExprResult MSPropertyOpBuilder::buildSet(Expr *op, SourceLocation sl,
ExprResult SetterExpr = S.ActOnMemberAccessExpr(
S.getCurScope(), RefExpr->getBaseExpr(), SourceLocation(),
RefExpr->isArrow() ? tok::arrow : tok::period, SS, SourceLocation(),
- SetterName, 0, true);
+ SetterName, nullptr, true);
if (SetterExpr.isInvalid()) {
S.Diag(RefExpr->getMemberLoc(),
diag::error_cannot_find_suitable_accessor) << 1 /* setter */