From 1c3a07834e9bdbde110a3ec0faaee9a40e765760 Mon Sep 17 00:00:00 2001 From: Gerolf Hoflehner Date: Tue, 17 Apr 2018 04:02:24 +0000 Subject: [IR] Upgrade comment token in objc retain release marker for asm call Older compiler issued '#' instead of ';' llvm-svn: 330173 --- llvm/lib/IR/AutoUpgrade.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'llvm/lib/IR/AutoUpgrade.cpp') diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp index 78385ac82d3..f3193f5893c 100644 --- a/llvm/lib/IR/AutoUpgrade.cpp +++ b/llvm/lib/IR/AutoUpgrade.cpp @@ -1169,6 +1169,19 @@ static bool upgradeAVX512MaskToSelect(StringRef Name, IRBuilder<> &Builder, return true; } +/// Upgrade comment in call to inline asm that represents an objc retain release +/// marker. +void llvm::UpgradeInlineAsmString(std::string *AsmStr) { + + unsigned long Pos; + if (AsmStr->find("mov\tfp") == 0 && + AsmStr->find("objc_retainAutoreleaseReturnValue") != std::string::npos && + (Pos = AsmStr->find("# marker")) != std::string::npos) { + AsmStr->replace(Pos, 1, ";"); + } + return; +} + /// Upgrade a call to an old intrinsic. All argument and return casting must be /// provided to seamlessly integrate with existing context. void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { -- cgit v1.2.3