aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Assembly
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-01-19 01:18:29 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-01-19 01:18:29 +0000
commit4283ac78577a2a6b3b8b8f07126891eabd08aeab (patch)
treed8e3a18ce07e520e5191c72a9d65955b269aa25c /include/llvm/Assembly
parentfd57ad787ff49e65ae2dbb1ecc0a88e1e3f6b736 (diff)
downloadexternal_llvm-4283ac78577a2a6b3b8b8f07126891eabd08aeab.zip
external_llvm-4283ac78577a2a6b3b8b8f07126891eabd08aeab.tar.gz
external_llvm-4283ac78577a2a6b3b8b8f07126891eabd08aeab.tar.bz2
Add a new interface function to AutoUpgrade for simultaneously upgrading
the Function and the CallInst: UpgradeCallsToIntrinsic(Function*). Also, re-factor the AutoUpgrade implementation to eliminate some duplication of code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Assembly')
-rw-r--r--include/llvm/Assembly/AutoUpgrade.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/llvm/Assembly/AutoUpgrade.h b/include/llvm/Assembly/AutoUpgrade.h
index fbbc7b5..39106dc 100644
--- a/include/llvm/Assembly/AutoUpgrade.h
+++ b/include/llvm/Assembly/AutoUpgrade.h
@@ -14,8 +14,17 @@
#ifndef LLVM_ASSEMBLY_AUTOUPGRADE_H
#define LLVM_ASSEMBLY_AUTOUPGRADE_H
+#include <string>
+
namespace llvm {
class Function;
+ class CallInst;
+
+ /// This function determines if the \p Name provides is a name for which the
+ /// auto-upgrade to a non-overloaded name applies.
+ /// @returns True if the function name is upgradeable, false otherwise.
+ /// @brief Determine if a name is an upgradeable intrinsic name.
+ bool IsUpgradeableIntrinsicName(const std::string& Name);
/// This function inspects the Function \p F to see if it is an old overloaded
/// intrinsic. If it is, the Function's name is changed to add a suffix that
@@ -25,8 +34,23 @@ namespace llvm {
/// the auto-upgrade feature from the old overloaded names to the new
/// non-overloaded names.
/// @param F The Function to potentially auto-upgrade.
+ /// @returns A corrected version of F, or 0 if no change necessary
/// @brief Remove overloaded intrinsic function names.
- bool UpgradeIntrinsicFunction(Function* F);
+ 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.
+ /// @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);
+
+ bool UpgradeCallsToIntrinsic(Function* F);
} // End llvm namespace