diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-09-04 22:46:24 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-09-04 22:46:24 +0000 |
commit | 8b3014ea0459fbb5353c2629c15ce0739502e638 (patch) | |
tree | 58b417d4968aa34d3c8bc1bef5ada0b916ad9f98 /llvm/lib | |
parent | 38d24e6751bfb3b7064d46c1f6c4e949f301896e (diff) | |
download | bcm5719-llvm-8b3014ea0459fbb5353c2629c15ce0739502e638.tar.gz bcm5719-llvm-8b3014ea0459fbb5353c2629c15ce0739502e638.zip |
[ms-inline asm] Add the inline assembly dialect, AsmDialect, to the InlineAsm
class.
llvm-svn: 163175
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/ConstantsContext.h | 17 | ||||
-rw-r--r-- | llvm/lib/VMCore/Core.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/VMCore/InlineAsm.cpp | 13 |
3 files changed, 23 insertions, 13 deletions
diff --git a/llvm/lib/VMCore/ConstantsContext.h b/llvm/lib/VMCore/ConstantsContext.h index 8903a8f40f9..ddd680a55d3 100644 --- a/llvm/lib/VMCore/ConstantsContext.h +++ b/llvm/lib/VMCore/ConstantsContext.h @@ -352,18 +352,21 @@ struct ExprMapKeyType { struct InlineAsmKeyType { InlineAsmKeyType(StringRef AsmString, StringRef Constraints, bool hasSideEffects, - bool isAlignStack) + bool isAlignStack, unsigned asmDialect) : asm_string(AsmString), constraints(Constraints), - has_side_effects(hasSideEffects), is_align_stack(isAlignStack) {} + has_side_effects(hasSideEffects), is_align_stack(isAlignStack), + asm_dialect(asmDialect) {} std::string asm_string; std::string constraints; bool has_side_effects; bool is_align_stack; + unsigned asm_dialect; bool operator==(const InlineAsmKeyType& that) const { return this->asm_string == that.asm_string && this->constraints == that.constraints && this->has_side_effects == that.has_side_effects && - this->is_align_stack == that.is_align_stack; + this->is_align_stack == that.is_align_stack && + this->asm_dialect == that.asm_dialect; } bool operator<(const InlineAsmKeyType& that) const { if (this->asm_string != that.asm_string) @@ -374,6 +377,8 @@ struct InlineAsmKeyType { return this->has_side_effects < that.has_side_effects; if (this->is_align_stack != that.is_align_stack) return this->is_align_stack < that.is_align_stack; + if (this->asm_dialect != that.asm_dialect) + return this->asm_dialect < that.asm_dialect; return false; } @@ -490,7 +495,8 @@ template<> struct ConstantCreator<InlineAsm, PointerType, InlineAsmKeyType> { static InlineAsm *create(PointerType *Ty, const InlineAsmKeyType &Key) { return new InlineAsm(Ty, Key.asm_string, Key.constraints, - Key.has_side_effects, Key.is_align_stack); + Key.has_side_effects, Key.is_align_stack, + Key.asm_dialect); } }; @@ -499,7 +505,8 @@ struct ConstantKeyData<InlineAsm> { typedef InlineAsmKeyType ValType; static ValType getValType(InlineAsm *Asm) { return InlineAsmKeyType(Asm->getAsmString(), Asm->getConstraintString(), - Asm->hasSideEffects(), Asm->isAlignStack()); + Asm->hasSideEffects(), Asm->isAlignStack(), + Asm->getDialect()); } }; diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp index a56f1b282ba..9ce76f87fa7 100644 --- a/llvm/lib/VMCore/Core.cpp +++ b/llvm/lib/VMCore/Core.cpp @@ -1055,9 +1055,11 @@ LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant, LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, - LLVMBool IsAlignStack) { + LLVMBool IsAlignStack, + unsigned AsmDialect) { return wrap(InlineAsm::get(dyn_cast<FunctionType>(unwrap(Ty)), AsmString, - Constraints, HasSideEffects, IsAlignStack)); + Constraints, HasSideEffects, IsAlignStack, + AsmDialect)); } LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB) { diff --git a/llvm/lib/VMCore/InlineAsm.cpp b/llvm/lib/VMCore/InlineAsm.cpp index 736e370a6de..92414e0cef6 100644 --- a/llvm/lib/VMCore/InlineAsm.cpp +++ b/llvm/lib/VMCore/InlineAsm.cpp @@ -27,19 +27,20 @@ InlineAsm::~InlineAsm() { InlineAsm *InlineAsm::get(FunctionType *Ty, StringRef AsmString, StringRef Constraints, bool hasSideEffects, - bool isAlignStack) { - InlineAsmKeyType Key(AsmString, Constraints, hasSideEffects, isAlignStack); + bool isAlignStack, unsigned asmDialect) { + InlineAsmKeyType Key(AsmString, Constraints, hasSideEffects, isAlignStack, + asmDialect); LLVMContextImpl *pImpl = Ty->getContext().pImpl; return pImpl->InlineAsms.getOrCreate(PointerType::getUnqual(Ty), Key); } InlineAsm::InlineAsm(PointerType *Ty, const std::string &asmString, const std::string &constraints, bool hasSideEffects, - bool isAlignStack) + bool isAlignStack, unsigned asmDialect) : Value(Ty, Value::InlineAsmVal), - AsmString(asmString), - Constraints(constraints), HasSideEffects(hasSideEffects), - IsAlignStack(isAlignStack) { + AsmString(asmString), Constraints(constraints), + HasSideEffects(hasSideEffects), IsAlignStack(isAlignStack), + AsmDialect(asmDialect) { // Do various checks on the constraint string and type. assert(Verify(getFunctionType(), constraints) && |