LLVM API Documentation
00001 //===-- llvm/AutoUpgrade.h - AutoUpgrade Helpers ----------------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // These functions are implemented by lib/VMCore/AutoUpgrade.cpp. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_AUTOUPGRADE_H 00015 #define LLVM_AUTOUPGRADE_H 00016 00017 namespace llvm { 00018 class Module; 00019 class GlobalVariable; 00020 class Function; 00021 class CallInst; 00022 00023 /// This is a more granular function that simply checks an intrinsic function 00024 /// for upgrading, and returns true if it requires upgrading. It may return 00025 /// null in NewFn if the all calls to the original intrinsic function 00026 /// should be transformed to non-function-call instructions. 00027 bool UpgradeIntrinsicFunction(Function *F, Function *&NewFn); 00028 00029 /// This is the complement to the above, replacing a specific call to an 00030 /// intrinsic function with a call to the specified new function. 00031 void UpgradeIntrinsicCall(CallInst *CI, Function *NewFn); 00032 00033 /// This is an auto-upgrade hook for any old intrinsic function syntaxes 00034 /// which need to have both the function updated as well as all calls updated 00035 /// to the new function. This should only be run in a post-processing fashion 00036 /// so that it can update all calls to the old function. 00037 void UpgradeCallsToIntrinsic(Function* F); 00038 00039 /// This checks for global variables which should be upgraded. It returns true 00040 /// if it requires upgrading. 00041 bool UpgradeGlobalVariable(GlobalVariable *GV); 00042 } // End llvm namespace 00043 00044 #endif