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

[regression] function has no AST information #895

Closed
ChuanqiXu9 opened this issue Sep 29, 2024 · 1 comment
Closed

[regression] function has no AST information #895

ChuanqiXu9 opened this issue Sep 29, 2024 · 1 comment

Comments

@ChuanqiXu9
Copy link
Member

Reproducer:

// RUN: %clang_cc1 -fclangir %s -emit-llvm -o - | FileCheck %s

static unsigned int foo (void)
{
  return 0;
}
static unsigned int bar (void)
{
  return 0;
}

struct func {
    unsigned int (*f1) (void);
    unsigned int (*f2) (void);
};

struct func_wrapper {
    struct func f;
};

struct func_wrapper def =
{
 {
    foo
 }
};

Now it will print error: function has no AST information. This was introduced in db6b7c0. -fno-clangir-call-conv-lowering is not helpful since in populateCIRToLLVMPasses from clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp, we will always pass true to populateCIRPreLoweringPasses.

BTW, it looks like the line

return op.emitError("function has no AST information");
may produce pretty long (or maybe dead lock?) compile time on some larger workload:

bt-load.i.zip

This may be a separate bug but triggered by the above patch.

CC: @sitio-couto

@bcardosolopes
Copy link
Member

Thanks for reporting this, I talked with @sitio-couto, reverting this for now

Hugobros3 pushed a commit to shady-gang/clangir that referenced this issue Oct 2, 2024
Fix llvm#895 and it's also missing some more
throughout behavior for the pass, it also needs to be enabled by default when
emitting object files.

This reverts commit db6b7c0.
smeenai pushed a commit to smeenai/clangir that referenced this issue Oct 9, 2024
Fix llvm#895 and it's also missing some more
throughout behavior for the pass, it also needs to be enabled by default when
emitting object files.

This reverts commit db6b7c0.
smeenai pushed a commit to smeenai/clangir that referenced this issue Oct 9, 2024
Fix llvm#895 and it's also missing some more
throughout behavior for the pass, it also needs to be enabled by default when
emitting object files.

This reverts commit db6b7c0.
smeenai pushed a commit to smeenai/clangir that referenced this issue Oct 9, 2024
Fix llvm#895 and it's also missing some more
throughout behavior for the pass, it also needs to be enabled by default when
emitting object files.

This reverts commit db6b7c0.
keryell pushed a commit to keryell/clangir that referenced this issue Oct 19, 2024
Fix llvm#895 and it's also missing some more
throughout behavior for the pass, it also needs to be enabled by default when
emitting object files.

This reverts commit db6b7c0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants