summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-11-21 02:47:19 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-11-21 02:47:19 +0000
commita508c5de587f7311353449d1ba21a4f8a37c8a95 (patch)
treef570dab0efb5583f351765e171446827d9581751 /clang/lib
parent59deec0132323046652e110b619e1c28047ef83a (diff)
downloadbcm5719-llvm-a508c5de587f7311353449d1ba21a4f8a37c8a95.tar.gz
bcm5719-llvm-a508c5de587f7311353449d1ba21a4f8a37c8a95.zip
Remove redundant code.
llvm-svn: 168410
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/Decl.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 9569841a568..ed48c439b54 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -355,30 +355,9 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D,
if (Function->getStorageClass() == SC_PrivateExtern)
LV.mergeVisibility(HiddenVisibility, true);
- // C99 6.2.2p5:
- // If the declaration of an identifier for a function has no
- // storage-class specifier, its linkage is determined exactly
- // as if it were declared with the storage-class specifier
- // extern.
- if (!Context.getLangOpts().CPlusPlus &&
- (Function->getStorageClass() == SC_Extern ||
- Function->getStorageClass() == SC_PrivateExtern ||
- Function->getStorageClass() == SC_None)) {
- // C99 6.2.2p4:
- // For an identifier declared with the storage-class specifier
- // extern in a scope in which a prior declaration of that
- // identifier is visible, if the prior declaration specifies
- // internal or external linkage, the linkage of the identifier
- // at the later declaration is the same as the linkage
- // specified at the prior declaration. If no prior declaration
- // is visible, or if the prior declaration specifies no
- // linkage, then the identifier has external linkage.
- if (const FunctionDecl *PrevFunc = Function->getPreviousDecl()) {
- LinkageInfo PrevLV = getLVForDecl(PrevFunc, OnlyTemplate);
- if (PrevLV.linkage()) LV.setLinkage(PrevLV.linkage());
- LV.mergeVisibility(PrevLV);
- }
- }
+ // Note that Sema::MergeCompatibleFunctionDecls already takes care of
+ // merging storage classes and visibility attributes, so we don't have to
+ // look at previous decls in here.
// In C++, then if the type of the function uses a type with
// unique-external linkage, it's not legally usable from outside
OpenPOWER on IntegriCloud