This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add BeforeExecute method to PrecompiledPreamble
ClosedPublic

Authored by Nebiroth on Dec 18 2017, 11:29 AM.

Diff Detail

Repository
rC Clang

Event Timeline

Nebiroth created this revision.Dec 18 2017, 11:29 AM
ilya-biryukov requested changes to this revision.Dec 19 2017, 4:33 AM
ilya-biryukov added inline comments.
include/clang/Frontend/PrecompiledPreamble.h
249

The comment seems a bit too specific.
Maybe change it to something like "can be used to store references to various CompilerInstance fields (e.g. SourceManager) that may be interesting to the consumers of other callbacks"

lib/Frontend/PrecompiledPreamble.cpp
345

We should probably call it here, right before Execute.
Or maybe right before BeginSourceFile if we can receive the callbacks while executing BeginSourceFile. We should make sure to update the comment if you decide to call it before BeginSourceFile.

This revision now requires changes to proceed.Dec 19 2017, 4:33 AM
Nebiroth updated this revision to Diff 127619.Dec 19 2017, 4:06 PM
Nebiroth marked 2 inline comments as done.

Modified comment
Changed where BeforeExecute is called

ilya-biryukov requested changes to this revision.Dec 20 2017, 6:36 AM

LGTM modulo the comment. Should I land this for you?

include/clang/Frontend/PrecompiledPreamble.h
247

Please add that the following information to the comment:

/// Called before FrontendAction::BeginSourceFile .
/// Can be used ....
This revision now requires changes to proceed.Dec 20 2017, 6:36 AM
Nebiroth updated this revision to Diff 127715.Dec 20 2017, 6:53 AM

Updated BeforeExecute comment

Yes please land this.

This revision is now accepted and ready to land.Dec 20 2017, 8:21 AM
This revision was automatically updated to reflect the committed changes.