aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-02-14 01:47:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-02-14 01:47:04 +0000
commitd2fdd4256a2efc41365ccdd27a210d1d99a1fe3a (patch)
tree806a23fc44c70cd99e6316463c8e25362d3abdbd /lib/Sema
parent950fee2555f7a6bd193e588d6b6a941fd182391a (diff)
merge hasCLanguageLinkage and isExternC. Keep the shorter name.
I added hasCLanguageLinkage while fixing some language linkage bugs some time ago so that I wouldn't have to check all users of isExternC. It turned out to be a much longer detour than expected, but this patch finally merges the two again. The isExternC function now implements just the standard notion of having C language linkage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaDecl.cpp4
-rw-r--r--lib/Sema/SemaOverload.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 9c7fb6b4b2..d2b4697ee3 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -4860,7 +4860,7 @@ void Sema::CheckShadow(Scope *S, VarDecl *D) {
template<typename T>
static bool mayConflictWithNonVisibleExternC(const T *ND) {
VarDecl::StorageClass SC = ND->getStorageClass();
- if (ND->hasCLanguageLinkage() && (SC == SC_Extern || SC == SC_PrivateExtern))
+ if (ND->isExternC() && (SC == SC_Extern || SC == SC_PrivateExtern))
return true;
return ND->getDeclContext()->isTranslationUnit();
}
@@ -6581,7 +6581,7 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
// If this function is declared as being extern "C", then check to see if
// the function returns a UDT (class, struct, or union type) that is not C
// compatible, and if it does, warn the user.
- if (NewFD->hasCLanguageLinkage()) {
+ if (NewFD->isExternC()) {
QualType R = NewFD->getResultType();
if (R->isIncompleteType() && !R->isVoidType())
Diag(NewFD->getLocation(), diag::warn_return_value_udt_incomplete)
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index c2e0d6f809..9bba5f6c78 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -967,7 +967,7 @@ Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old,
static bool canBeOverloaded(const FunctionDecl &D) {
if (D.getAttr<OverloadableAttr>())
return true;
- if (D.hasCLanguageLinkage())
+ if (D.isExternC())
return false;
// Main cannot be overloaded (basic.start.main).