diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-01-11 09:09:01 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-01-11 09:09:01 +0000 |
| commit | 14d4e7bdbf057f6cdcb1dfc8fa704606abf5cf5b (patch) | |
| tree | 4db7182e5f156113877ce6415bf2d96364fbc77f /clang | |
| parent | 50cb05591dcf2169e0444652f376272150f85669 (diff) | |
| download | bcm5719-llvm-14d4e7bdbf057f6cdcb1dfc8fa704606abf5cf5b.tar.gz bcm5719-llvm-14d4e7bdbf057f6cdcb1dfc8fa704606abf5cf5b.zip | |
CodeGen: Simplify consecutive '&' modifiers
LLVM the consecutive '&' modifiers are redundant, skip them.
llvm-svn: 225601
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 5 | ||||
| -rw-r--r-- | clang/test/CodeGen/asm.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index a003e8ab9e8..d910f2fb969 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -1659,6 +1659,11 @@ SimplifyConstraint(const char *Constraint, const TargetInfo &Target, while (Constraint[1] && Constraint[1] != ',') Constraint++; break; + case '&': + Result += '&'; + while (Constraint[1] && Constraint[1] == '&') + Constraint++; + break; case ',': Result += "|"; break; diff --git a/clang/test/CodeGen/asm.c b/clang/test/CodeGen/asm.c index 5dbc01b1211..c64f83f7877 100644 --- a/clang/test/CodeGen/asm.c +++ b/clang/test/CodeGen/asm.c @@ -248,3 +248,10 @@ void t29(void) { // CHECK: @t29 // CHECK: call void asm sideeffect "movl %eax, $0", "*m,~{dirflag},~{fpsr},~{flags}"([1 x i32]* @t29_var) } + +void t30(int len) { + __asm__ volatile("" + : "+&&rm"(len)); + // CHECK: @t30 + // CHECK: call void asm sideeffect "", "=*&rm,0,~{dirflag},~{fpsr},~{flags}" +} |

