diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-01-27 11:49:27 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-01-27 11:49:27 +0000 |
commit | e2a5fb0e089165f80080c294c1096be4f5739662 (patch) | |
tree | c60660fc6f3af672b7f0fafc1816a625beef8fc0 /include/llvm/Assembly | |
parent | 2f81fb78dc15984af7dbbfc0bb91a63842616c32 (diff) | |
download | external_llvm-e2a5fb0e089165f80080c294c1096be4f5739662.zip external_llvm-e2a5fb0e089165f80080c294c1096be4f5739662.tar.gz external_llvm-e2a5fb0e089165f80080c294c1096be4f5739662.tar.bz2 |
Fix auto-upgrade of intrinsics to work properly with both assembly and
bytecode reading. This code is crufty, the result of much hacking to get things
working correctly. Cleanup patches will follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25682 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Assembly')
-rw-r--r-- | include/llvm/Assembly/AutoUpgrade.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/llvm/Assembly/AutoUpgrade.h b/include/llvm/Assembly/AutoUpgrade.h index 548068f..b8f9e22 100644 --- a/include/llvm/Assembly/AutoUpgrade.h +++ b/include/llvm/Assembly/AutoUpgrade.h @@ -15,11 +15,14 @@ #define LLVM_ASSEMBLY_AUTOUPGRADE_H #include <string> +#include <vector> namespace llvm { class Function; class CallInst; class Instruction; + class Value; + class BasicBlock; /// This function determines if the \p Name provides is a name for which the /// auto-upgrade to a non-overloaded name applies. @@ -39,6 +42,14 @@ namespace llvm { /// @brief Remove overloaded intrinsic function names. Function* UpgradeIntrinsicFunction(Function* F); + Instruction* MakeUpgradedCall( + Function* F, ///< The function to call + const std::vector<Value*>& Params, ///< Operands of the call + BasicBlock* BB, ///< Basic block the caller will insert result to + bool isTailCall = false, ///< True if this is a tail call. + unsigned CallingConv = 0 ///< Calling convention to use + ); + /// In LLVM 1.7, the overloading of intrinsic functions was replaced with /// separate functions for each of the various argument sizes. This function /// implements the auto-upgrade feature from old overloaded names to the new @@ -52,7 +63,7 @@ namespace llvm { /// @param CI The CallInst to potentially auto-upgrade. /// @returns An instrution to replace \p CI with. /// @brief Get replacement instruction for overloaded intrinsic function call. - Instruction* UpgradeIntrinsicCall(CallInst* CI); + Instruction* UpgradeIntrinsicCall(CallInst* CI, Function* newF = 0); /// Upgrade both the function and all the calls made to it, if that function /// needs to be upgraded. This is like a combination of the above two |