diff options
author | Dale Johannesen <dalej@apple.com> | 2009-10-13 20:46:56 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-10-13 20:46:56 +0000 |
commit | 4360298d2bf3c1ba8595a415cfa235df0bc76335 (patch) | |
tree | d8ccc1e4677e43ef3420c6a3a18007298a866a3e /lib/VMCore | |
parent | 9578c7aad61935364b28677f19e330b621016148 (diff) | |
download | external_llvm-4360298d2bf3c1ba8595a415cfa235df0bc76335.zip external_llvm-4360298d2bf3c1ba8595a415cfa235df0bc76335.tar.gz external_llvm-4360298d2bf3c1ba8595a415cfa235df0bc76335.tar.bz2 |
Add an "msasm" flag to inline asm as suggested in PR 5125.
A little ugliness is accepted to keep the binary file format
compatible. No functional change yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/Core.cpp | 5 | ||||
-rw-r--r-- | lib/VMCore/InlineAsm.cpp | 10 |
3 files changed, 11 insertions, 6 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 3e628ae..b5ae81b 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1206,6 +1206,8 @@ static void WriteAsOperandInternal(raw_ostream &Out, const Value *V, Out << "asm "; if (IA->hasSideEffects()) Out << "sideeffect "; + if (IA->isMsAsm()) + Out << "msasm "; Out << '"'; PrintEscapedString(IA->getAsmString(), Out); Out << "\", \""; diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 47a8e1b..bff3087 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -884,9 +884,10 @@ LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant, } LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, - const char *Constraints, int HasSideEffects) { + const char *Constraints, int HasSideEffects, + int IsMsAsm) { return wrap(InlineAsm::get(dyn_cast<FunctionType>(unwrap(Ty)), AsmString, - Constraints, HasSideEffects)); + Constraints, HasSideEffects, IsMsAsm)); } /*--.. Operations on global variables, functions, and aliases (globals) ....--*/ diff --git a/lib/VMCore/InlineAsm.cpp b/lib/VMCore/InlineAsm.cpp index fbd6b90..0520dfa 100644 --- a/lib/VMCore/InlineAsm.cpp +++ b/lib/VMCore/InlineAsm.cpp @@ -27,17 +27,19 @@ InlineAsm::~InlineAsm() { // case when the type gets refined. InlineAsm *InlineAsm::get(const FunctionType *Ty, const StringRef &AsmString, - const StringRef &Constraints, bool hasSideEffects) { + const StringRef &Constraints, bool hasSideEffects, + bool isMsAsm) { // FIXME: memoize! - return new InlineAsm(Ty, AsmString, Constraints, hasSideEffects); + return new InlineAsm(Ty, AsmString, Constraints, hasSideEffects, isMsAsm); } InlineAsm::InlineAsm(const FunctionType *Ty, const StringRef &asmString, - const StringRef &constraints, bool hasSideEffects) + const StringRef &constraints, bool hasSideEffects, + bool isMsAsm) : Value(PointerType::getUnqual(Ty), Value::InlineAsmVal), AsmString(asmString), - Constraints(constraints), HasSideEffects(hasSideEffects) { + Constraints(constraints), HasSideEffects(hasSideEffects), IsMsAsm(isMsAsm) { // Do various checks on the constraint string and type. assert(Verify(Ty, constraints) && "Function type not legal for constraints!"); |