diff options
| author | 2019-01-27 16:42:12 +0000 | |
|---|---|---|
| committer | 2019-01-27 16:42:12 +0000 | |
| commit | b773203fb58f3ef282fb69c832d8710cab5bc82d (patch) | |
| tree | e75913f147570fbd75169647b144df85b88a038c /gnu/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp | |
| parent | tweak errno in previous (diff) | |
| download | wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip | |
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp')
| -rw-r--r-- | gnu/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gnu/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp b/gnu/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp index dc501b564ee..b53a70d8758 100644 --- a/gnu/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp +++ b/gnu/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp @@ -82,7 +82,7 @@ bool edit::rewriteObjCRedundantCallWithLiteral(const ObjCMessageExpr *Msg, (NS.getNSDictionarySelector( NSAPI::NSDict_dictionaryWithDictionary) == Sel || NS.getNSDictionarySelector(NSAPI::NSDict_initWithDictionary) == Sel))) { - + commit.replaceWithInner(Msg->getSourceRange(), Msg->getArg(0)->getSourceRange()); return true; @@ -95,7 +95,7 @@ bool edit::rewriteObjCRedundantCallWithLiteral(const ObjCMessageExpr *Msg, // rewriteToObjCSubscriptSyntax. //===----------------------------------------------------------------------===// -/// \brief Check for classes that accept 'objectForKey:' (or the other selectors +/// Check for classes that accept 'objectForKey:' (or the other selectors /// that the migrator handles) but return their instances as 'id', resulting /// in the compiler resolving 'objectForKey:' as the method from NSDictionary. /// @@ -355,7 +355,7 @@ bool edit::rewriteToObjCLiteralSyntax(const ObjCMessageExpr *Msg, return false; } -/// \brief Returns true if the immediate message arguments of \c Msg should not +/// Returns true if the immediate message arguments of \c Msg should not /// be rewritten because it will interfere with the rewrite of the parent /// message expression. e.g. /// \code @@ -372,7 +372,7 @@ static bool shouldNotRewriteImmediateMessageArgs(const ObjCMessageExpr *Msg, // rewriteToArrayLiteral. //===----------------------------------------------------------------------===// -/// \brief Adds an explicit cast to 'id' if the type is not objc object. +/// Adds an explicit cast to 'id' if the type is not objc object. static void objectifyExpr(const Expr *E, Commit &commit); static bool rewriteToArrayLiteral(const ObjCMessageExpr *Msg, @@ -434,7 +434,7 @@ static bool rewriteToArrayLiteral(const ObjCMessageExpr *Msg, // rewriteToDictionaryLiteral. //===----------------------------------------------------------------------===// -/// \brief If \c Msg is an NSArray creation message or literal, this gets the +/// If \c Msg is an NSArray creation message or literal, this gets the /// objects that were used to create it. /// \returns true if it is an NSArray and we got objects, or false otherwise. static bool getNSArrayObjects(const Expr *E, const NSAPI &NS, @@ -726,7 +726,7 @@ static bool getLiteralInfo(SourceRange literalRange, } else break; } - + if (!UpperU.hasValue() && !UpperL.hasValue()) UpperU = UpperL = true; else if (UpperU.hasValue() && !UpperL.hasValue()) @@ -738,7 +738,7 @@ static bool getLiteralInfo(SourceRange literalRange, Info.L = *UpperL ? "L" : "l"; Info.LL = *UpperL ? "LL" : "ll"; Info.F = UpperF ? "F" : "f"; - + Info.Hex = Info.Octal = false; if (text.startswith("0x")) Info.Hex = true; @@ -851,7 +851,7 @@ static bool rewriteToNumberLiteral(const ObjCMessageExpr *Msg, // Try to modify the literal make it the same type as the method call. // -Modify the suffix, and/or // -Change integer to float - + LiteralInfo LitInfo; bool isIntZero = false; if (const IntegerLiteral *IntE = dyn_cast<IntegerLiteral>(literalE)) @@ -862,7 +862,7 @@ static bool rewriteToNumberLiteral(const ObjCMessageExpr *Msg, // Not easy to do int -> float with hex/octal and uncommon anyway. if (!LitIsFloat && CallIsFloating && (LitInfo.Hex || LitInfo.Octal)) return rewriteToNumericBoxedExpression(Msg, NS, commit); - + SourceLocation LitB = LitInfo.WithoutSuffRange.getBegin(); SourceLocation LitE = LitInfo.WithoutSuffRange.getEnd(); @@ -879,7 +879,7 @@ static bool rewriteToNumberLiteral(const ObjCMessageExpr *Msg, } else { if (CallIsUnsigned) commit.insert(LitE, LitInfo.U); - + if (CallIsLong) commit.insert(LitE, LitInfo.L); else if (CallIsLongLong) @@ -997,7 +997,7 @@ static bool rewriteToNumericBoxedExpression(const ObjCMessageExpr *Msg, uint64_t FinalTySize = Ctx.getTypeSize(FinalTy); uint64_t OrigTySize = Ctx.getTypeSize(OrigTy); - bool isTruncated = FinalTySize < OrigTySize; + bool isTruncated = FinalTySize < OrigTySize; bool needsCast = false; if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Arg)) { @@ -1090,7 +1090,7 @@ static bool rewriteToNumericBoxedExpression(const ObjCMessageExpr *Msg, } if (needsCast) { - DiagnosticsEngine &Diags = Ctx.getDiagnostics(); + DiagnosticsEngine &Diags = Ctx.getDiagnostics(); // FIXME: Use a custom category name to distinguish migration diagnostics. unsigned diagID = Diags.getCustomDiagID(DiagnosticsEngine::Warning, "converting to boxing syntax requires casting %0 to %1"); @@ -1145,7 +1145,7 @@ static bool doRewriteToUTF8StringBoxedExpressionHelper( commit.insertBefore(ArgRange.getBegin(), "@"); else commit.insertWrap("@(", ArgRange, ")"); - + return true; } } |
