diff options
| author | Gerolf Hoflehner <ghoflehner@apple.com> | 2018-04-17 04:02:24 +0000 |
|---|---|---|
| committer | Gerolf Hoflehner <ghoflehner@apple.com> | 2018-04-17 04:02:24 +0000 |
| commit | 1c3a07834e9bdbde110a3ec0faaee9a40e765760 (patch) | |
| tree | ac081b01ae44574ad17eb0e52dc9a67d53165bde /llvm/lib/IR/AutoUpgrade.cpp | |
| parent | 2f6d00612d62c0da948145574c396c53543e21f4 (diff) | |
| download | bcm5719-llvm-1c3a07834e9bdbde110a3ec0faaee9a40e765760.tar.gz bcm5719-llvm-1c3a07834e9bdbde110a3ec0faaee9a40e765760.zip | |
[IR] Upgrade comment token in objc retain release marker for asm call
Older compiler issued '#' instead of ';'
llvm-svn: 330173
Diffstat (limited to 'llvm/lib/IR/AutoUpgrade.cpp')
| -rw-r--r-- | llvm/lib/IR/AutoUpgrade.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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) { |

