Skip to content

Commit 3bd12c3

Browse files
committed
Do not treat '\t' as a seperator for inline asm instructions.
1 parent f2e244f commit 3bd12c3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

llvm/lib/IR/InlineAsm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ FunctionType *InlineAsm::getFunctionType() const {
6363
void InlineAsm::collectAsmStrs(SmallVectorImpl<StringRef> &AsmStrs) const {
6464
StringRef AsmStr(AsmString);
6565
AsmStrs.clear();
66-
6766
// TODO: 1) Unify delimiter for inline asm, we also meet other delimiters
6867
// for example "\0A", ";".
6968
// 2) Enhance StringRef. Some of the special delimiter ("\0") can't be
7069
// split in StringRef. Also empty StringRef can not call split (will stuck).
7170
if (AsmStr.empty())
7271
return;
73-
AsmStr.split(AsmStrs, "\n\t", -1, false);
72+
AsmStr.split(AsmStrs, "\n", -1, false);
73+
errs() << "Num Asm Strs: " << AsmStrs.size() << "\n";
7474
}
7575

7676
/// Parse - Analyze the specified string (e.g. "==&{eax}") and fill in the

llvm/test/CodeGen/X86/inline-asm-function-call-pic.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ define void @func() local_unnamed_addr #0 {
5959
entry:
6060
%call = tail call i32 @static_func()
6161
;; We test call, CALL, and jmp.
62-
tail call void asm sideeffect inteldialect "call ${0:P}\0A\09CALL ${1:P}\0A\09jmp ${1:P}\0A\09shr eax, $$0\0A\09shr ebx, $$0\0A\09shr ecx, $$0\0A\09shr edx, $$0\0A\09shr edi, $$0\0A\09shr esi, $$0\0A\09shr ebp, $$0\0A\09shr esp, $$0", "*m,*m,~{eax},~{ebp},~{ebx},~{ecx},~{edi},~{edx},~{flags},~{esi},~{esp},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32 (...)) @static_func, ptr nonnull elementtype(i32 (...)) @extern_func) #0
62+
tail call void asm sideeffect inteldialect "call ${0:P}\0ACALL ${1:P}\0Ajmp ${1:P}\0Ashr eax, $$0\0Ashr ebx, $$0\0Ashr ecx, $$0\0Ashr edx, $$0\0Ashr edi, $$0\0Ashr esi, $$0\0Ashr ebp, $$0\0Ashr esp, $$0", "*m,*m,~{eax},~{ebp},~{ebx},~{ecx},~{edi},~{edx},~{flags},~{esi},~{esp},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32 (...)) @static_func, ptr nonnull elementtype(i32 (...)) @extern_func) #0
6363
ret void
6464
}
6565

llvm/test/Transforms/Inline/inline-call-with-asm-call.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ define void @caller(i32 %a, i1 %b) #0 {
2727
;; destination section and two assembly instructions in the outlined "other"
2828
;; section.
2929
define void @callee(i32 %a, i1 %b) {
30-
call void asm sideeffect "s_nop 1\0A\09.pushsection other\0A\09s_nop 2\0A\09s_nop 3\0A\09.popsection\0A\09s_nop 4\0A\09.align 32", ""()
30+
call void asm sideeffect "s_nop 1\0A.pushsection other\0A\09s_nop 2\0A\09s_nop 3\0A\09.popsection\0A\09s_nop 4\0A.align 32", ""()
3131
ret void
3232
}
3333
; CHECK: define void @callee

0 commit comments

Comments
 (0)