]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/analyze/fcn.el
Update copyright year to 2015
[gnu-emacs] / lisp / cedet / semantic / analyze / fcn.el
index 56353689ef691665e66420a023e951ed72aa615c..4b105c1e5b418ae6df95d34f6206e09cd8abe6c1 100644 (file)
@@ -1,6 +1,6 @@
 ;;; semantic/analyze/fcn.el --- Analyzer support functions.
 
-;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
 ;;
 ;; These queries allow a major mode to help the analyzer make decisions.
 ;;
-(define-overloadable-function semantic-analyze-tag-prototype-p (tag)
-  "Non-nil if TAG is a prototype."
-  )
-
-(defun semantic-analyze-tag-prototype-p-default (tag)
-  "Non-nil if TAG is a prototype."
-  (let ((p (semantic-tag-get-attribute tag :prototype-flag)))
-    (cond
-     ;; Trust the parser author.
-     (p p)
-     ;; Empty types might be a prototype.
-     ((eq (semantic-tag-class tag) 'type)
-      (not (semantic-tag-type-members tag)))
-     ;; No other heuristics.
-     (t nil))
-    ))
-
-;;------------------------------------------------------------
 
 (define-overloadable-function semantic-analyze-split-name (name)
   "Split a tag NAME into a sequence.
@@ -157,7 +139,7 @@ Almost all searches use the same arguments."
 ;;
 
 (define-overloadable-function semantic-analyze-dereference-metatype (type scope &optional type-declaration)
-  ;; todo - move into typecahe!!
+  ;; todo - move into typecache!!
   "Return a concrete type tag based on input TYPE tag.
 A concrete type is an actual declaration of a memory description,
 such as a structure, or class.  A meta type is an alias,
@@ -183,7 +165,10 @@ SCOPE is the scope object with additional items in which to search for names."
 The TYPE field in a tag can be nil (return nil)
 or a string, or a non-positional tag."
   (cond ((semantic-tag-p type)
-        (semantic-tag-name type))
+        (if (semantic-tag-named-parent type)
+            (semantic-analyze-unsplit-name `(,(semantic-tag-named-parent type)
+                                             ,(semantic-tag-name type)))
+          (semantic-tag-name type)))
        ((stringp type)
         type)
        ((listp type)
@@ -219,7 +204,7 @@ used by the analyzer debugger."
     (if (and type-declaration
             (semantic-tag-p type-declaration)
             (semantic-tag-of-class-p type-declaration 'type)
-            (not (semantic-analyze-tag-prototype-p type-declaration))
+            (not (semantic-tag-prototype-p type-declaration))
             )
        ;; We have an anonymous type for TAG with children.
        ;; Use this type directly.
@@ -263,6 +248,8 @@ used by the analyzer debugger."
          (semantic-scope-set-typecache scope nil)
          )))))
 
+(autoload 'semantic-tag-similar-p "semantic/tag-ls")
+
 (defun semantic-analyze-dereference-metatype-stack (type scope &optional type-declaration)
   "Dereference metatypes repeatedly until we hit a real TYPE.
 Uses `semantic-analyze-dereference-metatype'.
@@ -273,7 +260,7 @@ Optional argument TYPE-DECLARATION is how TYPE was found referenced."
        (nexttype (semantic-analyze-dereference-metatype type scope type-declaration))
        (idx 0))
     (catch 'metatype-recursion
-      (while (and nexttype (not (eq (car nexttype) lasttype)))
+      (while (and nexttype (not (semantic-tag-similar-p (car nexttype) lasttype)))
        (setq lasttype (car nexttype)
              lasttypedeclaration (cadr nexttype))
        (setq nexttype (semantic-analyze-dereference-metatype lasttype scope lasttypedeclaration))
@@ -312,7 +299,7 @@ SCOPE is the current scope."
     (when (and (semantic-tag-p ans)
               (eq (semantic-tag-class ans) 'type))
       ;; We have a tag.
-      (if (semantic-analyze-tag-prototype-p ans)
+      (if (semantic-tag-prototype-p ans)
          ;; It is a prototype.. find the real one.
          (or (and scope
                   (car-safe
@@ -334,5 +321,4 @@ SCOPE is the current scope."
 
 (provide 'semantic/analyze/fcn)
 
-;; arch-tag: 32525305-515e-4b96-ad11-216d3a99f829
 ;;; semantic/analyze/fcn.el ends here