[clang] [AIX] Detect `#pragma mc_func` (PR #99888)
Qiongsi Wu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 26 08:25:30 PDT 2024
qiongsiwu wrote:
> Is that not the case?
It does not seem so. See [here](https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:___c,selection:(endColumn:40,endLineNumber:8,positionColumn:40,positionLineNumber:8,selectionStartColumn:40,selectionStartLineNumber:8,startColumn:40,startLineNumber:8),source:'%23include+%3Cstdio.h%3E%0A%0A//+Example+from+https://www.ibm.com/docs/en/xl-c-aix/13.1.0%3Ftopic%3Ddescriptions-pragma-mc-func%0A%0A//+Type+your+code+here,+or+load+an+example.%0Aint+add_logical(int,+int)%3B%0A%23pragma+mc_func+add_logical+%7B%227c632014%22+%227c630194%22%7D%0A++++++++++++++++/*+++addc+++++++r3+%3C-+r3,+r4+++++++++++*/%0A++++++++++++++++/*+++addze++++++r3+%3C-+r3,+carry+bit++++*/%0A%0Aint+main()+%7B%0A%0A++++++int+i,j,k%3B%0A%0A++++++i+%3D+4%3B%0A++++++k+%3D+-4%3B%0A++++++j+%3D+add_logical(i,k)%3B%0A++++++printf(%22%5Cn%5Cnresult+%3D+%25d%5Cn%5Cn%22,j)%3B%0A%7D%0A'),l:'5',n:'1',o:'C+source+%231',t:'0')),k:49.8238747553816,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:executor,i:(argsPanelShown:'1',compilationPanelShown:'0',compiler:cclang1810,compilerName:'',compilerOutShown:'0',execArgs:'',execStdin:'',fontScale:14,fontUsePx:'0',j:1,lang:___c,libs:!(),options:'',overrides:!(),runtimeTools:!(),source:1,stdinPanelShown:'0',wrap:'1'),l:'5',n:'0',o:'Executor+x86-64+clang+18.1.0+(C,+Editor+%231)',t:'0')),k:50.1761252446184,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4) for an example. It seems somehow the compiler is treating this symbol as an unknown function that is resolved at link time. Maybe a more reasonable behaviour is indeed to change the parser so that we do get the unknown identifier error? I have not spent too much time look into it to see how big a change that is.
https://github.com/llvm/llvm-project/pull/99888
More information about the cfe-commits
mailing list