This is an archive of the discontinued LLVM Phabricator instance.

[BPF] explicit warning of not supporting dynamic stack allocation
ClosedPublic

Authored by yonghong-song on Feb 12 2020, 8:11 PM.

Details

Summary

Currently, BPF does not support dynamic static allocation.
For a program like below:

extern void bar(int *); 
void foo(int n) {
  int a[n];
  bar(a);
}

The current error message looks like:

unimplemented operand
UNREACHABLE executed at /.../llvm/lib/Target/BPF/BPFISelLowering.cpp:199!

Let us make error message explicit so it will be clear to the user
what is the problem. With this patch, the error message looks like:

fatal error: error in backend: Unsupported dynamic stack allocation
...

Diff Detail

Event Timeline

yonghong-song created this revision.Feb 12 2020, 8:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2020, 8:11 PM
ast accepted this revision.Feb 12 2020, 8:21 PM
This revision is now accepted and ready to land.Feb 12 2020, 8:21 PM
This revision was automatically updated to reflect the committed changes.