From bf48a9b6db111fc14a8faef1adefbce5d807aaef Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Sun, 21 Mar 2010 20:37:19 +0000 Subject: Memoize InlineAsms into the LLVMContext and delete them on shutdown. Fixes PR803. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99143 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/InlineAsm.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'include/llvm/InlineAsm.h') diff --git a/include/llvm/InlineAsm.h b/include/llvm/InlineAsm.h index 4490ce5a54..2ac0fcab79 100644 --- a/include/llvm/InlineAsm.h +++ b/include/llvm/InlineAsm.h @@ -24,8 +24,17 @@ namespace llvm { class PointerType; class FunctionType; class Module; +struct InlineAsmKeyType; +template +class ConstantUniqueMap; +template +struct ConstantCreator; class InlineAsm : public Value { + friend struct ConstantCreator; + friend class ConstantUniqueMap; + InlineAsm(const InlineAsm &); // do not implement void operator=(const InlineAsm&); // do not implement @@ -33,10 +42,14 @@ class InlineAsm : public Value { bool HasSideEffects; bool IsAlignStack; - InlineAsm(const FunctionType *Ty, StringRef AsmString, - StringRef Constraints, bool hasSideEffects, - bool isAlignStack = false); + InlineAsm(const PointerType *Ty, const std::string &AsmString, + const std::string &Constraints, bool hasSideEffects, + bool isAlignStack); virtual ~InlineAsm(); + + /// When the ConstantUniqueMap merges two types and makes two InlineAsms + /// identical, it destroys one of them with this method. + void destroyConstant(); public: /// InlineAsm::get - Return the specified uniqued inline asm string. -- cgit v1.2.3