Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature help for function pointers with calling convention does not show parameter names #1729

Closed
Befzz opened this issue Aug 14, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@Befzz
Copy link

Befzz commented Aug 14, 2023

typedef int TYPE_INT;
typedef double TYPE_DOUBLE;

typedef void (                         * FUNC_PTR_TYPE    )(TYPE_INT location, TYPE_DOUBLE x) ;
typedef void (__stdcall                * FUNC_PTR_TYPE_MS )(TYPE_INT location, TYPE_DOUBLE x) ;
typedef void (__attribute__((stdcall)) * FUNC_PTR_TYPE_GNU)(TYPE_INT location, TYPE_DOUBLE x) ;
extern FUNC_PTR_TYPE     func_ptr;
extern FUNC_PTR_TYPE_MS  func_ptr_ms;
extern FUNC_PTR_TYPE_GNU func_ptr_gnu;

void f(){
    func_ptr()      //(TYPE_INT location, TYPE_DOUBLE x) -> void
    func_ptr_ms()   //(TYPE_INT, TYPE_DOUBLE) -> void
    func_ptr_gnu()  //(TYPE_INT, TYPE_DOUBLE) -> void
}

image

image

vscode / clangd 16.0.2 / win64 / clang

@Befzz Befzz added the enhancement New feature or request label Aug 14, 2023
@HighCommander4 HighCommander4 changed the title InlayHints for function pointers with calling convention does not show parameter names Signature help for function pointers with calling convention does not show parameter names Aug 14, 2023
@HighCommander4
Copy link

(Edited title to clarify that the issue is with the content of the signature help popup. Inlay hints are a different feature.)

@HighCommander4
Copy link

Support for the case without a calling convention was added in #1068.

@HighCommander4
Copy link

Proposed fix: https://reviews.llvm.org/D157952

@HighCommander4 HighCommander4 self-assigned this Aug 15, 2023
@Befzz
Copy link
Author

Befzz commented Aug 16, 2023

#define APIENTRY __stdcall
#define APIENTRYP APIENTRY *

#define GLAPI __attribute__ ((dllexport)) extern
#define GLAPI __declspec(dllexport) extern
#define GLAPI extern


// how it is defined by glad gl c generator
typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
GLAPI PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData;
#define glNamedBufferSubData glad_glNamedBufferSubData

// this is made by me to clarify the issue
void glNamedBufferSubData_WRAP(GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data){
  glad_glNamedBufferSubData( buffer,  offset,  size, data);
}
void f(){
  glNamedBufferSubData     (        0,        sizeof(float[8]),       sizeof(char)*1,      (void*)(NULL));
  glNamedBufferSubData_WRAP(0, sizeof(float[8]), sizeof(char)*1, (void*)(NULL));
}

image

i also want to clarify desired result:
to show inlay hints for function pointers
or make it optional (not sure about performance impact, usefulness etc.)

@HighCommander4
Copy link

i also want to clarify desired result: to show inlay hints for function pointers

Could you file a separate issue for this please?

razmser pushed a commit to SuduIDE/llvm-project that referenced this issue Oct 2, 2023
razmser pushed a commit to SuduIDE/llvm-project that referenced this issue Oct 2, 2023
razmser pushed a commit to SuduIDE/llvm-project that referenced this issue Oct 2, 2023
razmser pushed a commit to SuduIDE/llvm-project that referenced this issue Oct 3, 2023
razmser pushed a commit to SuduIDE/llvm-project that referenced this issue Oct 3, 2023
razmser pushed a commit to SuduIDE/llvm-project that referenced this issue Oct 6, 2023
razmser pushed a commit to SuduIDE/llvm-project that referenced this issue Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants