aboutsummaryrefslogtreecommitdiff
path: root/lib/ARCMigrate/ARCMT.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ARCMigrate/ARCMT.cpp')
-rw-r--r--lib/ARCMigrate/ARCMT.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ARCMigrate/ARCMT.cpp b/lib/ARCMigrate/ARCMT.cpp
index e32884218597..8c04c8371cef 100644
--- a/lib/ARCMigrate/ARCMT.cpp
+++ b/lib/ARCMigrate/ARCMT.cpp
@@ -153,6 +153,9 @@ static bool HasARCRuntime(CompilerInvocation &origCI) {
if (triple.isiOS())
return triple.getOSMajorVersion() >= 5;
+ if (triple.isWatchOS())
+ return true;
+
if (triple.getOS() == llvm::Triple::Darwin)
return triple.getOSMajorVersion() >= 11;
@@ -206,7 +209,8 @@ createInvocationForMigration(CompilerInvocation &origCI,
WarnOpts.push_back("error=arc-unsafe-retained-assign");
CInvok->getDiagnosticOpts().Warnings = std::move(WarnOpts);
- CInvok->getLangOpts()->ObjCARCWeak = HasARCRuntime(origCI);
+ CInvok->getLangOpts()->ObjCWeakRuntime = HasARCRuntime(origCI);
+ CInvok->getLangOpts()->ObjCWeak = CInvok->getLangOpts()->ObjCWeakRuntime;
return CInvok.release();
}
@@ -600,7 +604,6 @@ bool MigrationProcess::applyTransform(TransformFn trans,
SmallString<512> newText;
llvm::raw_svector_ostream vecOS(newText);
buf.write(vecOS);
- vecOS.flush();
std::unique_ptr<llvm::MemoryBuffer> memBuf(
llvm::MemoryBuffer::getMemBufferCopy(
StringRef(newText.data(), newText.size()), newFname));