This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Propogate context in TUScheduler::run
ClosedPublic

Authored by kadircet on Oct 23 2019, 1:19 AM.

Diff Detail

Event Timeline

kadircet created this revision.Oct 23 2019, 1:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2019, 1:19 AM
sammccall accepted this revision.Oct 23 2019, 2:02 AM

Can you modify TEST_F(TUSchedulerTests, Run) to verify?

This revision is now accepted and ready to land.Oct 23 2019, 2:02 AM
sammccall requested changes to this revision.Oct 23 2019, 2:02 AM

Oops, this doesn't actually work - you're not setting the cloned context anywhere...

This revision now requires changes to proceed.Oct 23 2019, 2:02 AM

Build result: fail - 59544 tests passed, 1 failed and 805 were skipped.

failed: LLVM.tools/llvm-ar/mri-utf8.test

Log files: cmake-log.txt, ninja_check_all-log.txt, CMakeCache.txt

kadircet updated this revision to Diff 226104.Oct 23 2019, 2:33 AM
  • Add tests

Oops, this doesn't actually work - you're not setting the cloned context anywhere...

I am moving it into the lambda, which should extend the lifespan of context until destruction of it. Why would I need to set it in addition to that?

ilya-biryukov added inline comments.Oct 23 2019, 2:54 AM
clang-tools-extra/clangd/TUScheduler.cpp
925

Maybe inline ActionWithCtx? This should look fine as the last argument of the function call.

Oops, this doesn't actually work - you're not setting the cloned context anywhere...

I am moving it into the lambda, which should extend the lifespan of context until destruction of it. Why would I need to set it in addition to that?

Because we don't just want the context to be alive, it should be the context associated with the current thread.
e.g. if a new span is created, it should be nested within the other context.

Build result: fail - 59544 tests passed, 1 failed and 805 were skipped.

failed: LLVM.tools/llvm-ar/mri-utf8.test

Log files: cmake-log.txt, ninja_check_all-log.txt, CMakeCache.txt

kadircet updated this revision to Diff 226122.Oct 23 2019, 5:29 AM
kadircet marked an inline comment as done.
  • Address comments

Build result: fail - 59544 tests passed, 1 failed and 805 were skipped.

failed: LLVM.tools/llvm-ar/mri-utf8.test

Log files: cmake-log.txt, ninja_check_all-log.txt, CMakeCache.txt

sammccall accepted this revision.Oct 23 2019, 5:46 AM
This revision is now accepted and ready to land.Oct 23 2019, 5:46 AM
This revision was automatically updated to reflect the committed changes.