http://llvm.org/bugs/show_bug.cgi?id=7399

           Summary: LLVM doesn't properly parse section names (or emit
                    them into .ll files)
           Product: new-bugs
           Version: 2.7
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


If you have a section name like this:

define cc 10 void @Main_main2_entry( ) nounwind section
".text,\"ax\",@progbits\n\t.subsection 2 #"

Then llvm-as will fail to parse it as it doesn't seem to support escaped
quotes. The error returned when trying to run llvm-as on it is:

llvm-as: /tmp/ghc14264_0/ghc14264_0.ll:49:66: error: expected '{' in function
body
define cc 10 void @Main_main2_entry( ) nounwind section
".text,\"ax\",@progbits\n.subsection 2 #"
                                                                 ^

A second problem is that as well as not support escaped quotes, llvm-as/llc
don't support interpreting '\n' to mean newline. It will instead just put the
two literal characters into the section name in the assembly file.

This is also a problem because Clang produces invalid .ll files. If you get
clang to compile a C function like this to an .ll file:

__attribute__((section(".text,\"ax\",@progbits\n\t.subsection 1 #")))
void foo()
{
}

Then the .ll file produced by Clang is:

define void @food( ) section ".text,\"ax\",@progbits
.subsection 2 #"

Having Clang compile the C function to machine code works fine, its simply a
problem with parsing and printing out section names in .ll files.

Cheers,
David

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to