summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/IdentifierResolver.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-02 00:19:53 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-02 00:19:53 +0000
commit5a80bd15044647ff15e12bd7b1605d82e2d0cd97 (patch)
treefd0d3d411b0366d80cd0daef039eaef2b4f17a11 /clang/lib/Sema/IdentifierResolver.h
parenta9e981225e050a02c79c68537779b36289d2115b (diff)
downloadbcm5719-llvm-5a80bd15044647ff15e12bd7b1605d82e2d0cd97.tar.gz
bcm5719-llvm-5a80bd15044647ff15e12bd7b1605d82e2d0cd97.zip
Rework the way we find locally-scoped external declarations when we
need them to evaluate redeclarations or call a function that hasn't already been declared. We now keep a DenseMap of these locally-scoped declarations so that they are not visible but can be quickly found, e.g., when we're looking for previous declarations or before we go ahead and implicitly declare a function that's being called. Fixes PR3672. llvm-svn: 65792
Diffstat (limited to 'clang/lib/Sema/IdentifierResolver.h')
-rw-r--r--clang/lib/Sema/IdentifierResolver.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/IdentifierResolver.h b/clang/lib/Sema/IdentifierResolver.h
index 067900eac1c..1843f4ebca1 100644
--- a/clang/lib/Sema/IdentifierResolver.h
+++ b/clang/lib/Sema/IdentifierResolver.h
@@ -51,6 +51,11 @@ class IdentifierResolver {
/// The decl must already be part of the decl chain.
void RemoveDecl(NamedDecl *D);
+ /// Replaces the Old declaration with the New declaration. If the
+ /// replacement is successful, returns true. If the old
+ /// declaration was not found, returns false.
+ bool ReplaceDecl(NamedDecl *Old, NamedDecl *New);
+
private:
DeclsTy Decls;
};
@@ -167,6 +172,11 @@ public:
/// The decl must already be part of the decl chain.
void RemoveDecl(NamedDecl *D);
+ /// Replace the decl Old with the new declaration New on its
+ /// identifier chain. Returns true if the old declaration was found
+ /// (and, therefore, replaced).
+ bool ReplaceDecl(NamedDecl *Old, NamedDecl *New);
+
explicit IdentifierResolver(const LangOptions &LangOpt);
~IdentifierResolver();
OpenPOWER on IntegriCloud