diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-20 06:14:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-20 06:14:25 +0000 |
commit | 1e0e0d15d2749d27af05086f860cc2204f1f828e (patch) | |
tree | 831284f8410262eda3bfac6d33dfd150ad771249 /include | |
parent | f83cbf4ae12625b98ef5e9cf6d889fe980936374 (diff) | |
download | external_llvm-1e0e0d15d2749d27af05086f860cc2204f1f828e.zip external_llvm-1e0e0d15d2749d27af05086f860cc2204f1f828e.tar.gz external_llvm-1e0e0d15d2749d27af05086f860cc2204f1f828e.tar.bz2 |
implement a new magic global "llvm.compiler.used" which is like llvm.used, but
doesn't cause ".no_dead_strip" to be emitted on darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76399 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineModuleInfo.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 1872bd2..3618898 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -112,8 +112,9 @@ private: // common EH frames. std::vector<Function *> Personalities; - // UsedFunctions - the functions in the llvm.used list in a more easily - // searchable format. + /// UsedFunctions - The functions in the @llvm.used list in a more easily + /// searchable format. This does not include the functions in + /// llvm.compiler.used. SmallPtrSet<const Function *, 32> UsedFunctions; /// UsedDbgLabels - labels are used by debug info entries. @@ -240,9 +241,11 @@ public: return Personalities; } - // UsedFunctions - Return set of the functions in the llvm.used list. - const SmallPtrSet<const Function *, 32>& getUsedFunctions() const { - return UsedFunctions; + /// isUsedFunction - Return true if the functions in the llvm.used list. This + /// does not return true for things in llvm.compiler.used unless they are also + /// in llvm.used. + bool isUsedFunction(const Function *F) { + return UsedFunctions.count(F); } /// addCatchTypeInfo - Provide the catch typeinfo for a landing pad. |