summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/clang/lib/Edit
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Edit')
-rw-r--r--contrib/llvm/tools/clang/lib/Edit/Commit.cpp12
-rw-r--r--contrib/llvm/tools/clang/lib/Edit/EditedSource.cpp8
-rw-r--r--contrib/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp9
3 files changed, 13 insertions, 16 deletions
diff --git a/contrib/llvm/tools/clang/lib/Edit/Commit.cpp b/contrib/llvm/tools/clang/lib/Edit/Commit.cpp
index 706c732..9c08cc2 100644
--- a/contrib/llvm/tools/clang/lib/Edit/Commit.cpp
+++ b/contrib/llvm/tools/clang/lib/Edit/Commit.cpp
@@ -38,9 +38,7 @@ CharSourceRange Commit::Edit::getInsertFromRange(SourceManager &SM) const {
Commit::Commit(EditedSource &Editor)
: SourceMgr(Editor.getSourceManager()), LangOpts(Editor.getLangOpts()),
PPRec(Editor.getPPCondDirectiveRecord()),
- Editor(&Editor),
- ForceCommitInSystemHeader(Editor.getForceCommitInSystemHeader()),
- IsCommitable(true) { }
+ Editor(&Editor), IsCommitable(true) { }
bool Commit::insert(SourceLocation loc, StringRef text,
bool afterToken, bool beforePreviousInsertions) {
@@ -234,7 +232,7 @@ bool Commit::canInsert(SourceLocation loc, FileOffset &offs) {
if (!isAtStartOfMacroExpansion(loc, &loc))
return false;
- if (SM.isInSystemHeader(loc) && ForceCommitInSystemHeader)
+ if (SM.isInSystemHeader(loc))
return false;
std::pair<FileID, unsigned> locInfo = SM.getDecomposedLoc(loc);
@@ -265,7 +263,7 @@ bool Commit::canInsertAfterToken(SourceLocation loc, FileOffset &offs,
if (!isAtEndOfMacroExpansion(loc, &loc))
return false;
- if (SM.isInSystemHeader(loc) && ForceCommitInSystemHeader)
+ if (SM.isInSystemHeader(loc))
return false;
loc = Lexer::getLocForEndOfToken(loc, 0, SourceMgr, LangOpts);
@@ -303,8 +301,8 @@ bool Commit::canRemoveRange(CharSourceRange range,
if (range.getBegin().isMacroID() || range.getEnd().isMacroID())
return false;
- if ((SM.isInSystemHeader(range.getBegin()) ||
- SM.isInSystemHeader(range.getEnd())) && ForceCommitInSystemHeader)
+ if (SM.isInSystemHeader(range.getBegin()) ||
+ SM.isInSystemHeader(range.getEnd()))
return false;
if (PPRec && PPRec->rangeIntersectsConditionalDirective(range.getAsRange()))
diff --git a/contrib/llvm/tools/clang/lib/Edit/EditedSource.cpp b/contrib/llvm/tools/clang/lib/Edit/EditedSource.cpp
index 34b5e62..6cf6335 100644
--- a/contrib/llvm/tools/clang/lib/Edit/EditedSource.cpp
+++ b/contrib/llvm/tools/clang/lib/Edit/EditedSource.cpp
@@ -72,13 +72,11 @@ bool EditedSource::commitInsert(SourceLocation OrigLoc,
return true;
}
- Twine concat;
if (beforePreviousInsertions)
- concat = Twine(text) + FA.Text;
+ FA.Text = copyString(Twine(text) + FA.Text);
else
- concat = Twine(FA.Text) + text;
+ FA.Text = copyString(Twine(FA.Text) + text);
- FA.Text = copyString(concat);
return true;
}
@@ -160,7 +158,7 @@ void EditedSource::commitRemove(SourceLocation OrigLoc,
}
FileOffset TopBegin, TopEnd;
- FileEdit *TopFA = 0;
+ FileEdit *TopFA = nullptr;
if (I == FileEdits.end()) {
FileEditsTy::iterator
diff --git a/contrib/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp b/contrib/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
index f4206fb..666844c 100644
--- a/contrib/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
+++ b/contrib/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
@@ -58,7 +58,7 @@ static bool checkForLiteralCreation(const ObjCMessageExpr *Msg,
bool edit::rewriteObjCRedundantCallWithLiteral(const ObjCMessageExpr *Msg,
const NSAPI &NS, Commit &commit) {
- IdentifierInfo *II = 0;
+ IdentifierInfo *II = nullptr;
if (!checkForLiteralCreation(Msg, II, NS.getASTContext().getLangOpts()))
return false;
if (Msg->getNumArgs() != 1)
@@ -339,7 +339,7 @@ static bool rewriteToStringBoxedExpression(const ObjCMessageExpr *Msg,
bool edit::rewriteToObjCLiteralSyntax(const ObjCMessageExpr *Msg,
const NSAPI &NS, Commit &commit,
const ParentMap *PMap) {
- IdentifierInfo *II = 0;
+ IdentifierInfo *II = nullptr;
if (!checkForLiteralCreation(Msg, II, NS.getASTContext().getLangOpts()))
return false;
@@ -447,7 +447,7 @@ static bool getNSArrayObjects(const Expr *E, const NSAPI &NS,
return false;
if (const ObjCMessageExpr *Msg = dyn_cast<ObjCMessageExpr>(E)) {
- IdentifierInfo *Cls = 0;
+ IdentifierInfo *Cls = nullptr;
if (!checkForLiteralCreation(Msg, Cls, NS.getASTContext().getLangOpts()))
return false;
@@ -606,7 +606,7 @@ static bool shouldNotRewriteImmediateMessageArgs(const ObjCMessageExpr *Msg,
if (!Msg)
return false;
- IdentifierInfo *II = 0;
+ IdentifierInfo *II = nullptr;
if (!checkForLiteralCreation(Msg, II, NS.getASTContext().getLangOpts()))
return false;
@@ -1033,6 +1033,7 @@ static bool rewriteToNumericBoxedExpression(const ObjCMessageExpr *Msg,
case CK_IntegralComplexToReal:
case CK_IntegralComplexToBoolean:
case CK_AtomicToNonAtomic:
+ case CK_AddressSpaceConversion:
needsCast = true;
break;
OpenPOWER on IntegriCloud