Hi! I am not sure if this is a bug or not. I have the following non-sense C module exc_alloc.c: #include <windows.h> void *AllocMem() { HANDLE heap = GetProcessHeap(); void *p = HeapAlloc(heap, HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY, 16*1024*1014*1024); return p; } If I execute the following commands clang -S -emit-llvm -o exc_alloc.ll exc_alloc.c llc -filetype=asm exc_alloc.ll clang -c exc_alloc.s then I get the error messages exc_alloc.s:11:31: error: invalid variant '0' callq *__imp_GetProcessHeap at 0(%rip) ^ exc_alloc.s:16:27: error: invalid variant '20' callq *__imp_HeapAlloc at 20(%rip) Do I miss something here? Regards Kai
On Fri, Jul 27, 2012 at 3:36 PM, Kai <kai at redstar.de> wrote:> Hi! > > I am not sure if this is a bug or not. > > I have the following non-sense C module exc_alloc.c: > > #include <windows.h> > > void *AllocMem() { > HANDLE heap = GetProcessHeap(); > void *p = HeapAlloc(heap, HEAP_GENERATE_EXCEPTIONS | > HEAP_ZERO_MEMORY, 16*1024*1014*1024); > return p; > } > > If I execute the following commands > > clang -S -emit-llvm -o exc_alloc.ll exc_alloc.c > llc -filetype=asm exc_alloc.ll > clang -c exc_alloc.s > > then I get the error messages > > exc_alloc.s:11:31: error: invalid variant '0' > callq *__imp_GetProcessHeap at 0(%rip) > ^ > exc_alloc.s:16:27: error: invalid variant '20' > callq *__imp_HeapAlloc at 20(%rip) > > > Do I miss something here?Looks like a bug to me. -Eli
On Fri, Jul 27, 2012 at 3:36 PM, Kai <kai at redstar.de> wrote:> Hi! > > I am not sure if this is a bug or not. > > I have the following non-sense C module exc_alloc.c: > > #include <windows.h> > > void *AllocMem() { > HANDLE heap = GetProcessHeap(); > void *p = HeapAlloc(heap, HEAP_GENERATE_EXCEPTIONS | > HEAP_ZERO_MEMORY, 16*1024*1014*1024); > return p; > } > > If I execute the following commands > > clang -S -emit-llvm -o exc_alloc.ll exc_alloc.c > llc -filetype=asm exc_alloc.ll > clang -c exc_alloc.s > > then I get the error messages > > exc_alloc.s:11:31: error: invalid variant '0' > callq *__imp_GetProcessHeap at 0(%rip) > ^ > exc_alloc.s:16:27: error: invalid variant '20' > callq *__imp_HeapAlloc at 20(%rip) > > > Do I miss something here? > > Regards > KaiMC (the part of LLVM that does asm parsing) can't parse COFF asm yet. So yes it's a bug, but expected. - Michael Spencer
On 28.07.2012 09:22, Michael Spencer wrote:> On Fri, Jul 27, 2012 at 3:36 PM, Kai <kai at redstar.de> wrote: >> Hi! >> >> I am not sure if this is a bug or not. >> >> I have the following non-sense C module exc_alloc.c: >> >> #include <windows.h> >> >> void *AllocMem() { >> HANDLE heap = GetProcessHeap(); >> void *p = HeapAlloc(heap, HEAP_GENERATE_EXCEPTIONS | >> HEAP_ZERO_MEMORY, 16*1024*1014*1024); >> return p; >> } >> >> If I execute the following commands >> >> clang -S -emit-llvm -o exc_alloc.ll exc_alloc.c >> llc -filetype=asm exc_alloc.ll >> clang -c exc_alloc.s >> >> then I get the error messages >> >> exc_alloc.s:11:31: error: invalid variant '0' >> callq *__imp_GetProcessHeap at 0(%rip) >> ^ >> exc_alloc.s:16:27: error: invalid variant '20' >> callq *__imp_HeapAlloc at 20(%rip) >> >> >> Do I miss something here? >> >> Regards >> Kai > > MC (the part of LLVM that does asm parsing) can't parse COFF asm yet. > So yes it's a bug, but expected. > > - Michael Spencer >Thanks for the explanation. I thought the asm parser were finished.... Kai