emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/last-cedet-merge 8571383 16/50: semantic: Incorpor


From: David Engster
Subject: [Emacs-diffs] scratch/last-cedet-merge 8571383 16/50: semantic: Incorporate local scope when finding type
Date: Wed, 25 Jan 2017 22:15:21 +0000 (UTC)

branch: scratch/last-cedet-merge
commit 85713839e192ed03ba028c760688ae23b134cd5c
Author: Eric Ludlam <address@hidden>
Commit: David Engster <address@hidden>

    semantic: Incorporate local scope when finding type
    
    * lisp/cedet/semantic/analyze/fcn.el (semantic-analyze-tag-type): When
     first search fails, calc scope from the originating tag, and try
     again.
---
 lisp/cedet/semantic/analyze/fcn.el |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/cedet/semantic/analyze/fcn.el 
b/lisp/cedet/semantic/analyze/fcn.el
index 1abbca5..24f71bb 100644
--- a/lisp/cedet/semantic/analyze/fcn.el
+++ b/lisp/cedet/semantic/analyze/fcn.el
@@ -183,7 +183,16 @@ Optional SCOPE represents a calculated scope in which the
 types might be found.  This can be nil.
 If NOMETADEREF, then do not dereference metatypes.  This is
 used by the analyzer debugger."
-  (semantic-analyze-type (semantic-tag-type tag) scope nometaderef))
+  (or
+   (semantic-analyze-type (semantic-tag-type tag) scope nometaderef)
+   ;; If we didn't find it the 'quick' way with the passed in scope,
+   ;; perhaps the type is using a shorthand only available from the
+   ;; location of TAG, which might be a member of some struct far away
+   ;; from the original source that spawned the search.
+   (let ((tagscope (semantic-calculate-scope-for-tag tag)))
+     (when tagscope
+       (semantic-analyze-type (semantic-tag-type tag)
+                             tagscope nometaderef)))))
 
 (defun semantic-analyze-type (type-declaration &optional scope nometaderef)
   "Return the semantic tag for TYPE-DECLARATION.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]