diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-06-06 17:36:17 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-06-06 17:36:17 +0000 |
| commit | 8cf6d63a853e8f59df80b97c941b2162752d0c68 (patch) | |
| tree | 96e45075c1268d5bb7e8750bc95d81ff890b5ff5 /lib/CodeGen/CGExpr.cpp | |
| parent | 150a4989ecf988595f80809abf84835c9625b33c (diff) | |
| download | clang-8cf6d63a853e8f59df80b97c941b2162752d0c68.tar.gz clang-8cf6d63a853e8f59df80b97c941b2162752d0c68.tar.bz2 clang-8cf6d63a853e8f59df80b97c941b2162752d0c68.tar.xz | |
Defer codegen of inline method definitions to the end of current top level declaration
We would previously fail to emit a definition of bar() for the following code:
struct __declspec(dllexport) S {
void foo() {
t->bar();
}
struct T {
void bar() {}
};
T *t;
};
Note that foo() is an exported method, but bar() is not. However, foo() refers
to bar() so we need to emit its definition. We would previously fail to
realise that bar() is used.
By deferring the method definitions until the end of the top level declaration,
we can simply call EmitTopLevelDecl on them and rely on the usual mechanisms
to decide whether the method should be emitted or not.
Differential Revision: http://reviews.llvm.org/D4038
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210356 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
0 files changed, 0 insertions, 0 deletions
