summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-22 19:26:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-22 19:26:13 +0000
commit208b5c0fa5caa5716a78a04e856bf39ef8f38732 (patch)
tree0d11ed81ffe224ee4c8a2a5e589092213952e6ca /clang/lib/CodeGen/CodeGenModule.h
parentbe38b9e15fde35e15cf87f28540bd34edfce4db6 (diff)
downloadbcm5719-llvm-208b5c0fa5caa5716a78a04e856bf39ef8f38732.tar.gz
bcm5719-llvm-208b5c0fa5caa5716a78a04e856bf39ef8f38732.zip
New fix for pr17535.
This is a fixed version of r193161. In order to handle void foo() __attribute__((alias("bar"))); void bar() {} void zed() __attribute__((alias("foo"))); it is not enough to delay aliases to the end of the TU, we have to do two passes over them to find if they are defined or not. This can be implemented by producing alias as we go and just doing the second pass at the end. This has the advantage that other parts of clang that were expecting alias to be processed in order don't have to be changed. This patch also handles cyclic aliases. llvm-svn: 193188
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 066009ca7df..25aaae61e48 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -275,6 +275,10 @@ class CodeGenModule : public CodeGenTypeCache {
/// is done.
std::vector<GlobalDecl> DeferredDeclsToEmit;
+ /// List of alias we have emitted. Used to make sure that what they point to
+ /// is defined once we get to the end of the of the translation unit.
+ std::vector<GlobalDecl> Aliases;
+
/// DeferredVTables - A queue of (optional) vtables to consider emitting.
std::vector<const CXXRecordDecl*> DeferredVTables;
@@ -1077,6 +1081,8 @@ private:
/// was deferred.
void EmitDeferred();
+ void checkAliases();
+
/// EmitDeferredVTables - Emit any vtables which we deferred and
/// still have a use for.
void EmitDeferredVTables();
OpenPOWER on IntegriCloud