From 98e1153ba08c78c6cee19d681b8236466369848c Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Wed, 4 Oct 2017 12:07:35 -0400 Subject: [PATCH] Add a comment describing the intended uses of CPPSemantics.getCurrentLookupPoint() Change-Id: Ib4ba467a093873c16a1ff155e27c38c11a7590ce --- .../core/dom/parser/cpp/semantics/CPPSemantics.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index 103391b60c8..fbb36114cc1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -310,6 +310,15 @@ public class CPPSemantics { public static void popLookupPoint() { fLookupPoints.get().pop(); } + /** + * Get the current point of instantiation / point of lookup for name lookups. + * + * NOTE: This is meant to be used primarily for "declaredBefore" purposes, that is, + * for determining whether something was declared before or after the point + * of lookup. It is NOT meant to be used as a general mechanism for accessing + * information about a call site without having to pass that information along + * the usual way (via function arguments). + */ public static IASTNode getCurrentLookupPoint() { Deque lookupPoints = fLookupPoints.get(); return lookupPoints.isEmpty() ? null : lookupPoints.peek();