summaryrefslogtreecommitdiff
path: root/include/llvm/Assembly
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-01-19 06:59:26 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-01-19 06:59:26 +0000
commit0fc0ab7148daaf64c8b86b8b44d6d12eb4faee5c (patch)
treefd77cb9ea5ad0c57e21836154c9c3d5397fcf48a /include/llvm/Assembly
parent3e59546352b1d489078683c995ad64a5176cbe62 (diff)
downloadllvm-0fc0ab7148daaf64c8b86b8b44d6d12eb4faee5c.tar.gz
llvm-0fc0ab7148daaf64c8b86b8b44d6d12eb4faee5c.tar.bz2
llvm-0fc0ab7148daaf64c8b86b8b44d6d12eb4faee5c.tar.xz
1. Documentation upgrade.
2. Have UpgradeInstrinicCall return an Instruction* instead of a CallInst* and return the needed CastInst* if the result of the upgraded call needs to be casted back to a signed type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Assembly')
-rw-r--r--include/llvm/Assembly/AutoUpgrade.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/include/llvm/Assembly/AutoUpgrade.h b/include/llvm/Assembly/AutoUpgrade.h
index 39106dc8c3..548068fb22 100644
--- a/include/llvm/Assembly/AutoUpgrade.h
+++ b/include/llvm/Assembly/AutoUpgrade.h
@@ -19,6 +19,7 @@
namespace llvm {
class Function;
class CallInst;
+ class Instruction;
/// This function determines if the \p Name provides is a name for which the
/// auto-upgrade to a non-overloaded name applies.
@@ -38,18 +39,26 @@ namespace llvm {
/// @brief Remove overloaded intrinsic function names.
Function* UpgradeIntrinsicFunction(Function* F);
- /// This function inspects the CallInst \p CI to see if it is a call to an
- /// old overloaded intrinsic. If it is, the CallInst's name is changed to add
- /// a suffix that indicates the kind of arguments or result that it accepts.
/// 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
- /// non-overloaded names.
+ /// non-overloaded names. This function inspects the CallInst \p CI to see
+ /// if it is a call to an old overloaded intrinsic. If it is, a new CallInst
+ /// is created that uses the correct Function and possibly casts the
+ /// argument and result to an unsigned type. The caller can use the
+ /// returned Instruction to replace the existing one. Note that the
+ /// Instruction* returned could be a CallInst or a CastInst depending on
+ /// whether casting was necessary.
/// @param CI The CallInst to potentially auto-upgrade.
- /// @returns True if the call was upgraded, false otherwise.
- /// @brief Replace overloaded intrinsic function calls.
- CallInst* UpgradeIntrinsicCall(CallInst* CI);
+ /// @returns An instrution to replace \p CI with.
+ /// @brief Get replacement instruction for overloaded intrinsic function call.
+ Instruction* UpgradeIntrinsicCall(CallInst* CI);
+ /// 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
+ /// functions, UpgradeIntrinsicFunction and UpgradeIntrinsicCall. Note that
+ /// the calls are replaced so this should only be used in a post-processing
+ /// manner (i.e. after all assembly/bytecode has been read).
bool UpgradeCallsToIntrinsic(Function* F);
} // End llvm namespace