In this testcase: declare void @"$foo"() define void @bar() { call void @"$foo"() ret void } For x86, llvm emits the following: call $foo With GAS, this gets an error: test.s:9: Error: suffix or operands invalid for `call' This can be fixed by enclosing the name in parentheses, like this: call ($foo)
Created attachment 786 [details] a possible fix This patch Works For Me, along with some corresponding testsuite changes. It could be made smarter, such as not using parentheses when no dollar signs are present, but they don't cause errors.
Interesting bug. Your patch looks like the right first step. Please do take the next one, to make it not print parens when not needed. This should only occur for the GlobalValue case, in which case a strchr of the name should work, or is there some other bad case? -Chris
Fixed. Patch here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070423/048526.html Testcase here: test/CodeGen/X86/dollar-name.ll