1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Add a comment describing the intended uses of CPPSemantics.getCurrentLookupPoint()

Change-Id: Ib4ba467a093873c16a1ff155e27c38c11a7590ce
This commit is contained in:
Nathan Ridge 2017-10-04 12:07:35 -04:00
parent d47cb6c4ea
commit 98e1153ba0

View file

@ -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<IASTNode> lookupPoints = fLookupPoints.get();
return lookupPoints.isEmpty() ? null : lookupPoints.peek();