diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-19 21:54:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-19 21:54:50 +0000 |
commit | d66828daf633bfc74742339ed6e0e214cb6c959e (patch) | |
tree | 259820a9f42def9d1430e59127753a5ddd0c0b5b /clang/lib/CodeGen/ModuleBuilder.cpp | |
parent | 78b9851a3a6f5d26e46576f65b1dc4dc5360aa90 (diff) | |
download | llvm-d66828daf633bfc74742339ed6e0e214cb6c959e.zip llvm-d66828daf633bfc74742339ed6e0e214cb6c959e.tar.gz llvm-d66828daf633bfc74742339ed6e0e214cb6c959e.tar.bz2 |
In addition to in-class member functions marked with the "used"
attribute, we also care about those with the "constructor"
attribute. Fixes PR6521.
llvm-svn: 126055
Diffstat (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp')
-rw-r--r-- | clang/lib/CodeGen/ModuleBuilder.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp index d41d3ac..8945028 100644 --- a/clang/lib/CodeGen/ModuleBuilder.cpp +++ b/clang/lib/CodeGen/ModuleBuilder.cpp @@ -80,7 +80,8 @@ namespace { M != MEnd; ++M) if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(*M)) if (Method->isThisDeclarationADefinition() && - Method->hasAttr<UsedAttr>()) + (Method->hasAttr<UsedAttr>() || + Method->hasAttr<ConstructorAttr>())) Builder->EmitTopLevelDecl(Method); } } |