Comments (7)
I am not planning to work on this right away. I am working on vector types #284 right now. (Can I somehow get permission to make some changes to issues, at least to assign them to myself?)
from clangir.
The original test program now works for me. Destructors are called when falling off the end of a scope. But destructors are not called when jumping out of a scope. This program is missing some destructor calls. Should I open a new issue for this, or reopen this one?
extern "C" int printf(char const*, ...);
struct A {
A() { printf("++A\n"); }
A(int n) { printf("++A(%d)\n", n); }
~A() { printf("--A\n"); }
};
void test(int x) {
printf("test(%d)\n", x);
A a;
if (x == 1) return;
{
A b(3);
if (x == 2) return;
}
if (x == 3) return;
}
int main() {
test(1);
test(2);
test(3);
test(4);
}
from clangir.
We actually do clang/test/CIR/CodeGen/dtors.cpp
but we're still missing some more basic cases. This should be an assertion, but it's probably due to my workaround in 0a59c5c to unbreak an internal build. Do you intend to work on this? If not I can take a look sooner than later.
from clangir.
Can I somehow get permission to make some changes to issues, at least to assign them to myself?
Done, let me know if it works!
from clangir.
First part of the fix: d732147, next is to fix some dtor codegen issues.
Note that this would still crash if -fexceptions
is on, but I'm tackling that separately as part of adding support for exceptions.
from clangir.
Fixed now after both 7683175 and 2aac175, the example runs on my macOS laptop, let me know if it doesn't work on Linux for any reason.
from clangir.
Thanks for reporting more variations, created #348 to track it!
from clangir.
Related Issues (20)
- Support for TBAA HOT 2
- Implement bool->int and bool->float conversions HOT 2
- Codegen ignores global variable offsets in initializers HOT 1
- Improve StructType documentation
- Add an aliases for mutable types in CIR
- Fix error message with `!IntegerType`s. HOT 6
- Loop with `break` or `continue` at top level but not last statement fails validation HOT 1
- Loop with `break` or `continue` as last statement causes assertion failure
- Failed verification of struct attribute with pointer-to-array initializer HOT 3
- Make "scoped" regions somehow explicit
- Fix XFAIL in clang/test/CIR/CodeGen/vbase.cpp HOT 1
- Fix windows builds to unblock test infra
- Re-introduce tablegen constraint for "is-this-a-CIR-type" and use it here
- Add support for clang-format-action after next rebase
- Destructors are not called when jumping out of a scope
- Statement expression dtor issue
- Invalid LLVM for constant array reference HOT 3
- Make most CIRGenTypeCache types to be MLIR type aliases
- Fix XFAILs on Lowering/globals.cir and CodeGen/fun-ptr.c HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clangir.