diff options
| author | Eric Ludlam | 2015-03-22 17:36:16 -0400 |
|---|---|---|
| committer | David Engster | 2017-01-22 22:25:15 +0100 |
| commit | 85713839e192ed03ba028c760688ae23b134cd5c (patch) | |
| tree | c9da98fbe48e17ebe304e69a1e9479a05e0830fa | |
| parent | fdd5968c0b451cd38a923541de8aa5ce2422bfa8 (diff) | |
| download | emacs-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.el | 11 |
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 | |||
| 183 | types might be found. This can be nil. | 183 | types might be found. This can be nil. |
| 184 | If NOMETADEREF, then do not dereference metatypes. This is | 184 | If NOMETADEREF, then do not dereference metatypes. This is |
| 185 | used by the analyzer debugger." | 185 | used 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. |