aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Ludlam2015-03-22 17:36:16 -0400
committerDavid Engster2017-01-22 22:25:15 +0100
commit85713839e192ed03ba028c760688ae23b134cd5c (patch)
treec9da98fbe48e17ebe304e69a1e9479a05e0830fa
parentfdd5968c0b451cd38a923541de8aa5ce2422bfa8 (diff)
downloademacs-85713839e192ed03ba028c760688ae23b134cd5c.tar.gz
emacs-85713839e192ed03ba028c760688ae23b134cd5c.zip
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.
-rw-r--r--lisp/cedet/semantic/analyze/fcn.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/cedet/semantic/analyze/fcn.el b/lisp/cedet/semantic/analyze/fcn.el
index 1abbca5158e..24f71bbf84c 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
183types might be found. This can be nil. 183types might be found. This can be nil.
184If NOMETADEREF, then do not dereference metatypes. This is 184If NOMETADEREF, then do not dereference metatypes. This is
185used by the analyzer debugger." 185used by the analyzer debugger."
186 (semantic-analyze-type (semantic-tag-type tag) scope nometaderef)) 186 (or
187 (semantic-analyze-type (semantic-tag-type tag) scope nometaderef)
188 ;; If we didn't find it the 'quick' way with the passed in scope,
189 ;; perhaps the type is using a shorthand only available from the
190 ;; location of TAG, which might be a member of some struct far away
191 ;; from the original source that spawned the search.
192 (let ((tagscope (semantic-calculate-scope-for-tag tag)))
193 (when tagscope
194 (semantic-analyze-type (semantic-tag-type tag)
195 tagscope nometaderef)))))
187 196
188(defun semantic-analyze-type (type-declaration &optional scope nometaderef) 197(defun semantic-analyze-type (type-declaration &optional scope nometaderef)
189 "Return the semantic tag for TYPE-DECLARATION. 198 "Return the semantic tag for TYPE-DECLARATION.