From 0f662a7acf0b4583870dec2b7120d21fe8749a1f Mon Sep 17 00:00:00 2001 From: Victor Hernandez Date: Tue, 27 Oct 2009 20:05:49 +0000 Subject: [PATCH] Rename MallocFreeHelper as MemoryBuiltins llvm-svn: 85286 --- .../Analysis/{MallocFreeHelper.h => MemoryBuiltins.h} | 11 +++++------ lib/Analysis/AliasSetTracker.cpp | 2 +- lib/Analysis/BasicAliasAnalysis.cpp | 2 +- lib/Analysis/CMakeLists.txt | 2 +- lib/Analysis/CaptureTracking.cpp | 2 +- lib/Analysis/IPA/Andersens.cpp | 2 +- lib/Analysis/IPA/GlobalsModRef.cpp | 2 +- .../{MallocFreeHelper.cpp => MemoryBuiltins.cpp} | 9 ++++----- lib/Analysis/MemoryDependenceAnalysis.cpp | 2 +- lib/Analysis/PointerTracking.cpp | 2 +- lib/Transforms/IPO/FunctionAttrs.cpp | 2 +- lib/Transforms/IPO/GlobalOpt.cpp | 2 +- lib/Transforms/Scalar/DeadStoreElimination.cpp | 2 +- lib/Transforms/Scalar/GVN.cpp | 2 +- lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- lib/Transforms/Scalar/SCCP.cpp | 2 +- lib/Transforms/Utils/Local.cpp | 2 +- lib/VMCore/Instruction.cpp | 4 ++-- 18 files changed, 26 insertions(+), 28 deletions(-) rename include/llvm/Analysis/{MallocFreeHelper.h => MemoryBuiltins.h} (91%) rename lib/Analysis/{MallocFreeHelper.cpp => MemoryBuiltins.cpp} (97%) diff --git a/include/llvm/Analysis/MallocFreeHelper.h b/include/llvm/Analysis/MemoryBuiltins.h similarity index 91% rename from include/llvm/Analysis/MallocFreeHelper.h rename to include/llvm/Analysis/MemoryBuiltins.h index 22cf1b58bb2..6395d29c680 100644 --- a/include/llvm/Analysis/MallocFreeHelper.h +++ b/include/llvm/Analysis/MemoryBuiltins.h @@ -1,4 +1,4 @@ -//===- llvm/Analysis/MallocFreeHelper.h - Identify malloc/free --*- C++ -*-===// +//===- llvm/Analysis/MemoryBuiltins.h- Calls to memory builtins -*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,14 +7,13 @@ // //===----------------------------------------------------------------------===// // -// This family of functions identifies calls to malloc, bitcasts of malloc -// calls, and the types and array sizes associated with them. It also -// identifies calls to the free builtin. +// This family of functions identifies calls to builtin functions that allocate +// or free memory. // //===----------------------------------------------------------------------===// -#ifndef LLVM_ANALYSIS_MALLOCHELPER_H -#define LLVM_ANALYSIS_MALLOCHELPER_H +#ifndef LLVM_ANALYSIS_MEMORYBUILTINS_H +#define LLVM_ANALYSIS_MEMORYBUILTINS_H namespace llvm { class CallInst; diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp index ba2d95b9b07..652ec3b5dd3 100644 --- a/lib/Analysis/AliasSetTracker.cpp +++ b/lib/Analysis/AliasSetTracker.cpp @@ -13,7 +13,7 @@ #include "llvm/Analysis/AliasSetTracker.h" #include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" #include "llvm/Pass.h" diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 956aa821389..c81190b4184 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -15,7 +15,7 @@ #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/CaptureTracking.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/Passes.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" diff --git a/lib/Analysis/CMakeLists.txt b/lib/Analysis/CMakeLists.txt index d90e6887c0b..f21fd54596d 100644 --- a/lib/Analysis/CMakeLists.txt +++ b/lib/Analysis/CMakeLists.txt @@ -23,7 +23,7 @@ add_llvm_library(LLVMAnalysis LoopDependenceAnalysis.cpp LoopInfo.cpp LoopPass.cpp - MallocFreeHelper.cpp + MemoryBuiltins.cpp MemoryDependenceAnalysis.cpp PointerTracking.cpp PostDominators.cpp diff --git a/lib/Analysis/CaptureTracking.cpp b/lib/Analysis/CaptureTracking.cpp index 2f7e17c3706..d0baaca9600 100644 --- a/lib/Analysis/CaptureTracking.cpp +++ b/lib/Analysis/CaptureTracking.cpp @@ -17,7 +17,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/CaptureTracking.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Instructions.h" #include "llvm/Value.h" #include "llvm/ADT/SmallSet.h" diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp index 92d6e8e541d..17f304c0211 100644 --- a/lib/Analysis/IPA/Andersens.cpp +++ b/lib/Analysis/IPA/Andersens.cpp @@ -63,7 +63,7 @@ #include "llvm/Support/InstIterator.h" #include "llvm/Support/InstVisitor.h" #include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/Passes.h" #include "llvm/Support/Debug.h" #include "llvm/System/Atomic.h" diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index 1bace9f7ad8..ddd6ff9bd82 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -23,7 +23,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/CallGraph.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/InstIterator.h" #include "llvm/ADT/Statistic.h" diff --git a/lib/Analysis/MallocFreeHelper.cpp b/lib/Analysis/MemoryBuiltins.cpp similarity index 97% rename from lib/Analysis/MallocFreeHelper.cpp rename to lib/Analysis/MemoryBuiltins.cpp index 8633c5a8228..cf2ad62b617 100644 --- a/lib/Analysis/MallocFreeHelper.cpp +++ b/lib/Analysis/MemoryBuiltins.cpp @@ -1,4 +1,4 @@ -//===-- MallocFreeHelper.cpp - Identify calls to malloc and free builtins -===// +//===------ MemoryBuiltins.cpp - Identify calls to memory builtins --------===// // // The LLVM Compiler Infrastructure // @@ -7,13 +7,12 @@ // //===----------------------------------------------------------------------===// // -// This family of functions identifies calls to malloc, bitcasts of malloc -// calls, and the types and array sizes associated with them. It also -// identifies calls to the free builtin. +// This family of functions identifies calls to builtin functions that allocate +// or free memory. // //===----------------------------------------------------------------------===// -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/Module.h" diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index 2b7eec003ca..a071205a125 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -20,7 +20,7 @@ #include "llvm/IntrinsicInst.h" #include "llvm/Function.h" #include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/PredIteratorCache.h" diff --git a/lib/Analysis/PointerTracking.cpp b/lib/Analysis/PointerTracking.cpp index 033ac908392..2251b62b180 100644 --- a/lib/Analysis/PointerTracking.cpp +++ b/lib/Analysis/PointerTracking.cpp @@ -13,7 +13,7 @@ #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopInfo.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/PointerTracking.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index 0f19f279452..b3a832f12d0 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -26,7 +26,7 @@ #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/CallGraph.h" #include "llvm/Analysis/CaptureTracking.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/UniqueVector.h" diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 34b3d7c9e9d..3963fdea39b 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -24,7 +24,7 @@ #include "llvm/Module.h" #include "llvm/Pass.h" #include "llvm/Analysis/ConstantFolding.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Debug.h" diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index 39689a05b5a..e3f43372ec1 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -26,7 +26,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/Dominators.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/MemoryDependenceAnalysis.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/Local.h" diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 3641fecb756..32d027aa36d 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -33,7 +33,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/MemoryDependenceAnalysis.h" #include "llvm/Support/CFG.h" #include "llvm/Support/CommandLine.h" diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 4af6c1c41f6..0ca3114c44d 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -42,7 +42,7 @@ #include "llvm/GlobalVariable.h" #include "llvm/Operator.h" #include "llvm/Analysis/ConstantFolding.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index def679894dc..4701d2f7405 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -30,7 +30,7 @@ #include "llvm/LLVMContext.h" #include "llvm/Pass.h" #include "llvm/Analysis/ConstantFolding.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/CallSite.h" diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 4ff1e9ad24a..0ef1b438db9 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -24,7 +24,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/DebugInfo.h" -#include "llvm/Analysis/MallocFreeHelper.h" +#include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/ProfileInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/GetElementPtrTypeIterator.h" diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp index 4e8922230d6..4dbb4020ded 100644 --- a/lib/VMCore/Instruction.cpp +++ b/lib/VMCore/Instruction.cpp @@ -303,7 +303,7 @@ bool Instruction::isUsedOutsideOfBlock(const BasicBlock *BB) const { return false; } -// Code here matches isFreeCall from MallocFreeHelper, which is not in VMCore. +// Code here matches isFreeCall from MemoryBuiltins, which is not in VMCore. static bool isFreeCall(const Value* I) { const CallInst *CI = dyn_cast(I); if (!CI) @@ -408,7 +408,7 @@ bool Instruction::isCommutative(unsigned op) { } } -// Code here matches isMalloc from MallocFreeHelper, which is not in VMCore. +// Code here matches isMalloc from MemoryBuiltins, which is not in VMCore. static bool isMalloc(const Value* I) { const CallInst *CI = dyn_cast(I); if (!CI) {