aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-26 21:25:24 +0000
committerDan Gohman <gohman@apple.com>2010-07-26 21:25:24 +0000
commit3c46e8db99196179b30e7ac5c20c4efd5f3926d7 (patch)
tree2ef91bba064f8fe40b467e2dd0134f08eef99a5c /lib/Sema
parent1890eb81a6ad9df6dee4d54d5031e1ea5c6e9ce7 (diff)
Fix namespace polution.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109440 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/AnalysisBasedWarnings.cpp4
-rw-r--r--lib/Sema/SemaCXXCast.cpp2
-rw-r--r--lib/Sema/SemaDecl.cpp3
-rw-r--r--lib/Sema/SemaStmt.cpp4
4 files changed, 12 insertions, 1 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp
index 3c09122394..3d2c45f3f8 100644
--- a/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/lib/Sema/AnalysisBasedWarnings.cpp
@@ -197,6 +197,8 @@ static ControlFlowKind CheckFallThrough(AnalysisContext &AC) {
return AlwaysFallThrough;
}
+namespace {
+
struct CheckFallThroughDiagnostics {
unsigned diag_MaybeFallThrough_HasNoReturn;
unsigned diag_MaybeFallThrough_ReturnsNonVoid;
@@ -266,6 +268,8 @@ struct CheckFallThroughDiagnostics {
}
};
+}
+
/// CheckFallThroughForFunctionDef - Check that we don't fall off the end of a
/// function that should return a value. Check that we don't fall off the end
/// of a noreturn function. We assume that functions and blocks not marked
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp
index 787bd00ac8..29e9051082 100644
--- a/lib/Sema/SemaCXXCast.cpp
+++ b/lib/Sema/SemaCXXCast.cpp
@@ -197,7 +197,7 @@ Sema::BuildCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind,
/// the same kind of pointer (plain or to-member). Unlike the Sema function,
/// this one doesn't care if the two pointers-to-member don't point into the
/// same class. This is because CastsAwayConstness doesn't care.
-bool UnwrapDissimilarPointerTypes(QualType& T1, QualType& T2) {
+static bool UnwrapDissimilarPointerTypes(QualType& T1, QualType& T2) {
const PointerType *T1PtrType = T1->getAs<PointerType>(),
*T2PtrType = T2->getAs<PointerType>();
if (T1PtrType && T2PtrType) {
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 11e1ffe107..1788eb7722 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -929,6 +929,8 @@ static void MergeAttributes(Decl *New, Decl *Old, ASTContext &C) {
}
}
+namespace {
+
/// Used in MergeFunctionDecl to keep track of function parameters in
/// C.
struct GNUCompatibleParamWarning {
@@ -937,6 +939,7 @@ struct GNUCompatibleParamWarning {
QualType PromotedType;
};
+}
/// getSpecialMember - get the special member enum for a method.
Sema::CXXSpecialMember Sema::getSpecialMember(const CXXMethodDecl *MD) {
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 58131daf83..b4d207eab1 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -1577,6 +1577,8 @@ Sema::ActOnCXXCatchBlock(SourceLocation CatchLoc, DeclPtrTy ExDecl,
HandlerBlock.takeAs<Stmt>()));
}
+namespace {
+
class TypeWithHandler {
QualType t;
CXXCatchStmt *stmt;
@@ -1606,6 +1608,8 @@ public:
}
};
+}
+
/// ActOnCXXTryBlock - Takes a try compound-statement and a number of
/// handlers and creates a try statement from them.
Action::OwningStmtResult