r182773 - Fix a crash when we were trying to compute the linkage too early.
Rafael Espindola
rafael.espindola at gmail.com
Tue May 28 07:09:46 PDT 2013
Author: rafael
Date: Tue May 28 09:09:46 2013
New Revision: 182773
URL: http://llvm.org/viewvc/llvm-project?rev=182773&view=rev
Log:
Fix a crash when we were trying to compute the linkage too early.
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/test/CodeGenCXX/mangle.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=182773&r1=182772&r2=182773&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue May 28 09:09:46 2013
@@ -7999,8 +7999,7 @@ size_t ASTContext::getSideTableAllocated
void ASTContext::addUnnamedTag(const TagDecl *Tag) {
// FIXME: This mangling should be applied to function local classes too
if (!Tag->getName().empty() || Tag->getTypedefNameForAnonDecl() ||
- !isa<CXXRecordDecl>(Tag->getParent()) ||
- !Tag->isExternallyVisible())
+ !isa<CXXRecordDecl>(Tag->getParent()))
return;
std::pair<llvm::DenseMap<const DeclContext *, unsigned>::iterator, bool> P =
Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=182773&r1=182772&r2=182773&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Tue May 28 09:09:46 2013
@@ -875,3 +875,25 @@ namespace test37 {
// CHECK: define void @_Z6ASfuncPU3AS3i
void ASfunc(__attribute__((address_space(3))) int* x) {}
+
+namespace test38 {
+ // CHECK: define linkonce_odr void @_ZN6test384funcINS_3fooUt_EEEvT_
+ typedef struct {
+ struct {
+ } a;
+ } foo;
+
+ template <typename T> void func(T) {}
+ void test() { func(foo().a); }
+}
+
+namespace test39 {
+ // CHECK: define internal void @"_ZN6test394funcINS_3$_0Ut_EEEvT_"
+ typedef struct {
+ struct {} a;
+ } *foo;
+ template<typename T> void func(T) {}
+ void test(foo x) {
+ func(x->a);
+ }
+}
More information about the cfe-commits
mailing list