aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-02 07:14:39 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-02 07:14:39 +0000
commit26faaac4b636eafc2d686516f068170652c83fd9 (patch)
tree20c23f6a9eec3602785defa1795c9604958da7a2
parent25b58eb7998ed947bc1c07e70de0b5d8f6aff857 (diff)
Rename getStdNamespace -> getOrCreateStdNamespace, to better reflect its functionality.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110030 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/Sema.h2
-rw-r--r--lib/Sema/SemaDeclCXX.cpp4
-rw-r--r--lib/Sema/SemaExprCXX.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index f676304b2f..336dfa3763 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -2167,7 +2167,7 @@ public:
AttributeList *AttrList);
virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace);
- NamespaceDecl *getStdNamespace();
+ NamespaceDecl *getOrCreateStdNamespace();
virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
SourceLocation UsingLoc,
SourceLocation NamespcLoc,
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index d9215e5bbc..cf6e354f3c 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -3313,7 +3313,7 @@ void Sema::ActOnFinishNamespaceDef(DeclPtrTy D, SourceLocation RBrace) {
/// \brief Retrieve the special "std" namespace, which may require us to
/// implicitly define the namespace.
-NamespaceDecl *Sema::getStdNamespace() {
+NamespaceDecl *Sema::getOrCreateStdNamespace() {
if (!StdNamespace) {
// The "std" namespace has not yet been defined, so build one implicitly.
StdNamespace = NamespaceDecl::Create(Context,
@@ -3355,7 +3355,7 @@ Sema::DeclPtrTy Sema::ActOnUsingDirective(Scope *S,
if ((!Qualifier || Qualifier->getKind() == NestedNameSpecifier::Global) &&
NamespcName->isStr("std")) {
Diag(IdentLoc, diag::ext_using_undefined_std);
- R.addDecl(getStdNamespace());
+ R.addDecl(getOrCreateStdNamespace());
R.resolveKind();
}
// Otherwise, attempt typo correction.
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index d9f7c13f3d..d607afac16 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1199,7 +1199,7 @@ void Sema::DeclareGlobalNewDelete() {
// The "std::bad_alloc" class has not yet been declared, so build it
// implicitly.
StdBadAlloc = CXXRecordDecl::Create(Context, TTK_Class,
- getStdNamespace(),
+ getOrCreateStdNamespace(),
SourceLocation(),
&PP.getIdentifierTable().get("bad_alloc"),
SourceLocation(), 0);