Giter Site home page Giter Site logo

Comments (7)

dkolsen-pgi avatar dkolsen-pgi commented on July 20, 2024 1

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.

dkolsen-pgi avatar dkolsen-pgi commented on July 20, 2024 1

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.

bcardosolopes avatar bcardosolopes commented on July 20, 2024

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.

bcardosolopes avatar bcardosolopes commented on July 20, 2024

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.

bcardosolopes avatar bcardosolopes commented on July 20, 2024

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.

bcardosolopes avatar bcardosolopes commented on July 20, 2024

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.

bcardosolopes avatar bcardosolopes commented on July 20, 2024

Thanks for reporting more variations, created #348 to track it!

from clangir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.