zcov: / include/clang/Frontend/DeclXML.def


Files: 1 Branches Taken: 20.5% 8 / 39
Generated: 2010-02-10 01:31 Branches Executed: 51.3% 20 / 39
Line Coverage: 64.0% 80 / 125


Programs: 1 Runs 2897


       1                 : //===-- DeclXML.def - Metadata about Decl XML nodes ------------*- C++ -*-===//
       2                 : //
       3                 : //                     The LLVM Compiler Infrastructure
       4                 : //
       5                 : // This file is distributed under the University of Illinois Open Source
       6                 : // License. See LICENSE.TXT for details.
       7                 : //
       8                 : //===----------------------------------------------------------------------===//
       9                 : //
      10                 : //  This file defines the XML statement database structure as written in
      11                 : //  <TranslationUnit> sub-nodes of the XML document.
      12                 : //  The semantics of the attributes and enums are mostly self-documenting
      13                 : //  by looking at the appropriate internally used functions and values.
      14                 : //  The following macros are used:
      15                 : //
      16                 : //  NODE_XML( CLASS, NAME ) - A node of name NAME denotes a concrete
      17                 : //  statement of class CLASS where CLASS is a class name used internally by clang.
      18                 : //  After a NODE_XML the definition of all (optional) attributes of that statement
      19                 : //  node and possible sub-nodes follows.
      20                 : //
      21                 : //  END_NODE_XML - Closes the attribute definition of the current node.
      22                 : //
      23                 : //  ID_ATTRIBUTE_XML - Some statement nodes have an "id" attribute containing a
      24                 : //  string, which value uniquely identify that statement. Other nodes may refer
      25                 : //  by reference attributes to this value (currently used only for Label).
      26                 : //
      27                 : //  TYPE_ATTRIBUTE_XML( FN ) - Type nodes refer to the result type id of an
      28                 : //  expression by a "type" attribute. FN is internally used by clang.
      29                 : //
      30                 : //  ATTRIBUTE_XML( FN, NAME ) - An attribute named NAME. FN is internally
      31                 : //  used by clang. A boolean attribute have the values "0" or "1".
      32                 : //
      33                 : //  ATTRIBUTE_SPECIAL_XML( FN, NAME ) - An attribute named NAME which deserves
      34                 : //  a special handling. See the appropriate documentations.
      35                 : //
      36                 : //  ATTRIBUTE_FILE_LOCATION_XML - A bunch of attributes denoting the location of
      37                 : //  a statement in the source file(s).
      38                 : //
      39                 : //  ATTRIBUTE_OPT_XML( FN, NAME ) - An optional attribute named NAME.
      40                 : //  Optional attributes are omitted for boolean types, if the value is false,
      41                 : //  for integral types, if the value is null and for strings,
      42                 : //  if the value is the empty string. FN is internally used by clang.
      43                 : //
      44                 : //  ATTRIBUTE_ENUM[_OPT]_XML( FN, NAME ) - An attribute named NAME. The value
      45                 : //  is an enumeration defined with ENUM_XML macros immediately following after
      46                 : //  that macro. An optional attribute is ommited, if the particular enum is the
      47                 : //  empty string. FN is internally used by clang.
      48                 : //
      49                 : //  ENUM_XML( VALUE, NAME ) - An enumeration element named NAME. VALUE is
      50                 : //  internally used by clang.
      51                 : //
      52                 : //  END_ENUM_XML - Closes the enumeration definition of the current attribute.
      53                 : //
      54                 : //  SUB_NODE_XML( CLASS ) - A mandatory sub-node of class CLASS or its sub-classes.
      55                 : //
      56                 : //  SUB_NODE_OPT_XML( CLASS ) - An optional sub-node of class CLASS or its sub-classes.
      57                 : //
      58                 : //  SUB_NODE_SEQUENCE_XML( CLASS ) - Zero or more sub-nodes of class CLASS or
      59                 : //  its sub-classes.
      60                 : //
      61                 : //===----------------------------------------------------------------------===//
      62                 : 
      63                 : #ifndef ATTRIBUTE_FILE_LOCATION_XML
      64                 : #  define ATTRIBUTE_FILE_LOCATION_XML             \
      65                 :      ATTRIBUTE_XML(getFilename(), "file")         \
      66                 :      ATTRIBUTE_XML(getLine(), "line")             \
      67                 :      ATTRIBUTE_XML(getColumn(), "col")            \
      68                 :      ATTRIBUTE_OPT_XML(getFilename(), "endfile")  \
      69                 :      ATTRIBUTE_OPT_XML(getLine(), "endline")      \
      70                 :      ATTRIBUTE_OPT_XML(getColumn(), "endcol")
      71                 : #endif
      72                 : 
      73                 : #ifndef TYPE_ATTRIBUTE_XML
      74                 : #  define TYPE_ATTRIBUTE_XML( FN )    ATTRIBUTE_XML(FN, "type")
      75                 : #endif
      76                 : 
      77                 : #ifndef CONTEXT_ATTRIBUTE_XML
      78                 : #  define CONTEXT_ATTRIBUTE_XML( FN ) ATTRIBUTE_XML(FN, "context")
      79                 : #endif
      80                 : 
      81                 : //NODE_XML(TranslationUnitDecl, "TranslationUnit")
      82                 : //  SUB_NODE_SEQUENCE_XML(Decl)
      83                 : //END_NODE_XML
      84                 : 
      85                1: NODE_XML(Decl, "FIXME_Decl")
      86                1:   ATTRIBUTE_FILE_LOCATION_XML
      87                1: END_NODE_XML
      88                 : 
      89               17: NODE_XML(FunctionDecl, "Function")
      90               17:   ID_ATTRIBUTE_XML
      91               17:   ATTRIBUTE_FILE_LOCATION_XML
      92               17:   ATTRIBUTE_XML(getDeclContext(), "context")
      93               17:   ATTRIBUTE_XML(getNameAsString(), "name")
      94               17:   TYPE_ATTRIBUTE_XML(getType()->getAs<FunctionType>()->getResultType())
      95               17:   ATTRIBUTE_XML(getType()->getAs<FunctionType>(), "function_type")
                        0: branch 1 not taken
                       12: branch 2 taken
                        4: branch 3 taken
                        1: branch 4 taken
                        0: branch 5 not taken
      96               17:   ATTRIBUTE_ENUM_OPT_XML(getStorageClass(), "storage_class")
                        0: branch 0 not taken
                       12: branch 1 taken
      97               12: 	  ENUM_XML(FunctionDecl::None, "")
                        4: branch 0 taken
                        0: branch 1 not taken
      98                4: 	  ENUM_XML(FunctionDecl::Extern, "extern")
                        1: branch 0 taken
                        0: branch 1 not taken
      99                1: 	  ENUM_XML(FunctionDecl::Static, "static")
                        0: branch 0 not taken
                        0: branch 1 not taken
     100                0: 	  ENUM_XML(FunctionDecl::PrivateExtern, "__private_extern__")
     101                 :   END_ENUM_XML
     102               17:   ATTRIBUTE_OPT_XML(isInlineSpecified(), "inline")
     103                 :   //ATTRIBUTE_OPT_XML(isVariadic(), "variadic")       // in the type reference
     104               17:   ATTRIBUTE_XML(getNumParams(), "num_args")
     105               17:   SUB_NODE_SEQUENCE_XML(ParmVarDecl)
     106                 :   //SUB_NODE_OPT_XML("Body")
     107               17: END_NODE_XML
     108                 : 
     109                0: NODE_XML(CXXMethodDecl, "CXXMethodDecl")
     110                0:   ID_ATTRIBUTE_XML
     111                0:   ATTRIBUTE_FILE_LOCATION_XML
     112                0:   ATTRIBUTE_XML(getDeclContext(), "context")
     113                0:   ATTRIBUTE_XML(getNameAsString(), "name")
     114                0:   TYPE_ATTRIBUTE_XML(getType()->getAs<FunctionType>()->getResultType())
     115                0:   ATTRIBUTE_XML(getType()->getAs<FunctionType>(), "function_type")
     116                0:   ATTRIBUTE_OPT_XML(isInlineSpecified(), "inline")
     117                0:   ATTRIBUTE_OPT_XML(isStatic(), "static")
     118                0:   ATTRIBUTE_OPT_XML(isVirtual(), "virtual")
     119                0:   ATTRIBUTE_XML(getNumParams(), "num_args")
     120                0:   SUB_NODE_SEQUENCE_XML(ParmVarDecl)
     121                 :   //SUB_NODE_OPT_XML("Body")
     122                0: END_NODE_XML
     123                 : 
     124                 : //NODE_XML("Body")
     125                 : //  SUB_NODE_XML(Stmt)
     126                 : //END_NODE_XML
     127                 : 
     128                0: NODE_XML(NamespaceDecl, "Namespace")
     129                0:   ID_ATTRIBUTE_XML
     130                0:   ATTRIBUTE_FILE_LOCATION_XML
     131                0:   ATTRIBUTE_XML(getDeclContext(), "context")
     132                0:   ATTRIBUTE_XML(getNameAsString(), "name")
     133                0: END_NODE_XML
     134                 : 
     135                0: NODE_XML(UsingDirectiveDecl, "UsingDirective")
     136                0:   ATTRIBUTE_FILE_LOCATION_XML
     137                0:   ATTRIBUTE_XML(getDeclContext(), "context")
     138                0:   ATTRIBUTE_XML(getNameAsString(), "name")
     139                0:   ATTRIBUTE_XML(getNominatedNamespace(), "ref")
     140                0: END_NODE_XML
     141                 : 
     142                0: NODE_XML(NamespaceAliasDecl, "NamespaceAlias")
     143                0:   ATTRIBUTE_FILE_LOCATION_XML
     144                0:   ATTRIBUTE_XML(getDeclContext(), "context")
     145                0:   ATTRIBUTE_XML(getNameAsString(), "name")
     146                0:   ATTRIBUTE_XML(getNamespace(), "ref")
     147                0: END_NODE_XML
     148                 : 
     149                7: NODE_XML(RecordDecl, "Record")
     150                7:   ID_ATTRIBUTE_XML
     151                7:   ATTRIBUTE_FILE_LOCATION_XML
     152                7:   ATTRIBUTE_XML(getDeclContext(), "context")
     153                7:   ATTRIBUTE_XML(getNameAsString(), "name")
     154                7:   ATTRIBUTE_OPT_XML(isDefinition() == false, "forward")
     155                7:   ATTRIBUTE_XML(getTypeForDecl(), "type")             // refers to the type this decl creates
     156                7:   SUB_NODE_SEQUENCE_XML(FieldDecl)
     157                7: END_NODE_XML
     158                 : 
     159                1: NODE_XML(EnumDecl, "Enum")
     160                1:   ID_ATTRIBUTE_XML
     161                1:   ATTRIBUTE_FILE_LOCATION_XML
     162                1:   ATTRIBUTE_XML(getDeclContext(), "context")
     163                1:   ATTRIBUTE_XML(getNameAsString(), "name")
     164                1:   ATTRIBUTE_OPT_XML(isDefinition() == false, "forward")
     165                1:   ATTRIBUTE_SPECIAL_XML(getIntegerType(), "type")     // is NULL in pure declarations thus deserves special handling
     166                1:   SUB_NODE_SEQUENCE_XML(EnumConstantDecl)             // only present in definition
     167                1: END_NODE_XML
     168                 : 
     169                1: NODE_XML(EnumConstantDecl, "EnumConstant")
     170                1:   ID_ATTRIBUTE_XML
     171                1:   ATTRIBUTE_FILE_LOCATION_XML
     172                1:   ATTRIBUTE_XML(getDeclContext(), "context")
     173                1:   ATTRIBUTE_XML(getNameAsString(), "name")
     174                1:   TYPE_ATTRIBUTE_XML(getType())
     175                1:   ATTRIBUTE_XML(getInitVal().toString(10, true), "value")     // integer
     176                1:   SUB_NODE_OPT_XML(Expr)                                      // init expr of this constant
     177                1: END_NODE_XML
     178                 : 
     179                8: NODE_XML(FieldDecl, "Field")
     180                8:   ID_ATTRIBUTE_XML
     181                8:   ATTRIBUTE_FILE_LOCATION_XML
     182                8:   ATTRIBUTE_XML(getDeclContext(), "context")
     183                8:   ATTRIBUTE_XML(getNameAsString(), "name")
     184                8:   TYPE_ATTRIBUTE_XML(getType())
     185                8:   ATTRIBUTE_OPT_XML(isMutable(), "mutable")
     186                8:   ATTRIBUTE_OPT_XML(isBitField(), "bitfield")
     187                8:   SUB_NODE_OPT_XML(Expr)                                      // init expr of a bit field
     188                8: END_NODE_XML
     189                 : 
     190                7: NODE_XML(TypedefDecl, "Typedef")
     191                7:   ID_ATTRIBUTE_XML
     192                7:   ATTRIBUTE_FILE_LOCATION_XML
     193                7:   ATTRIBUTE_XML(getDeclContext(), "context")
     194                7:   ATTRIBUTE_XML(getNameAsString(), "name")
     195                7:   TYPE_ATTRIBUTE_XML(getUnderlyingType())
     196                7: END_NODE_XML
     197                 : 
     198               63: NODE_XML(VarDecl, "Var")
     199               63:   ID_ATTRIBUTE_XML
     200               63:   ATTRIBUTE_FILE_LOCATION_XML
     201               63:   ATTRIBUTE_XML(getDeclContext(), "context")
     202               63:   ATTRIBUTE_XML(getNameAsString(), "name")
     203               63:   TYPE_ATTRIBUTE_XML(getType())
                        0: branch 1 not taken
                       63: branch 2 taken
                        0: branch 3 not taken
                        0: branch 4 not taken
                        0: branch 5 not taken
                        0: branch 6 not taken
                        0: branch 7 not taken
     204               63:   ATTRIBUTE_ENUM_OPT_XML(getStorageClass(), "storage_class")
                        0: branch 0 not taken
                       63: branch 1 taken
     205               63: 	  ENUM_XML(VarDecl::None, "")
                        0: branch 0 not taken
                        0: branch 1 not taken
     206                0: 	  ENUM_XML(VarDecl::Auto, "auto")
                        0: branch 0 not taken
                        0: branch 1 not taken
     207                0: 	  ENUM_XML(VarDecl::Register, "register")
                        0: branch 0 not taken
                        0: branch 1 not taken
     208                0: 	  ENUM_XML(VarDecl::Extern, "extern")
                        0: branch 0 not taken
                        0: branch 1 not taken
     209                0: 	  ENUM_XML(VarDecl::Static, "static")
                        0: branch 0 not taken
                        0: branch 1 not taken
     210                0: 	  ENUM_XML(VarDecl::PrivateExtern, "__private_extern__")
     211                 :   END_ENUM_XML
     212               63:   SUB_NODE_OPT_XML(Expr)                                      // init expr
     213               63: END_NODE_XML
     214                 : 
     215               17: NODE_XML(ParmVarDecl, "ParmVar")
     216               17:   ID_ATTRIBUTE_XML
     217               17:   ATTRIBUTE_FILE_LOCATION_XML
     218               17:   ATTRIBUTE_XML(getDeclContext(), "context")
     219               17:   ATTRIBUTE_XML(getNameAsString(), "name")
     220               17:   TYPE_ATTRIBUTE_XML(getType())
     221               17:   SUB_NODE_OPT_XML(Expr)                                      // default argument expression
     222               17: END_NODE_XML
     223                 : 
     224                0: NODE_XML(LinkageSpecDecl, "LinkageSpec")
     225                0:   ID_ATTRIBUTE_XML
     226                0:   ATTRIBUTE_FILE_LOCATION_XML
     227                0:   ATTRIBUTE_XML(getDeclContext(), "context")
                        0: branch 1 not taken
                        0: branch 2 not taken
                        0: branch 3 not taken
     228                0:   ATTRIBUTE_ENUM_OPT_XML(getLanguage(), "lang")
                        0: branch 0 not taken
                        0: branch 1 not taken
     229                0: 	  ENUM_XML(LinkageSpecDecl::lang_c, "C")
                        0: branch 0 not taken
                        0: branch 1 not taken
     230                0: 	  ENUM_XML(LinkageSpecDecl::lang_cxx, "CXX")
     231                 :   END_ENUM_XML
     232                0: END_NODE_XML
     233                 : 
     234                 : 
     235                 : //===----------------------------------------------------------------------===//
     236                 : #undef NODE_XML
     237                 : #undef ID_ATTRIBUTE_XML
     238                 : #undef TYPE_ATTRIBUTE_XML
     239                 : #undef ATTRIBUTE_XML
     240                 : #undef ATTRIBUTE_SPECIAL_XML
     241                 : #undef ATTRIBUTE_OPT_XML
     242                 : #undef ATTRIBUTE_ENUM_XML
     243                 : #undef ATTRIBUTE_ENUM_OPT_XML
     244                 : #undef ATTRIBUTE_FILE_LOCATION_XML
     245                 : #undef ENUM_XML
     246                 : #undef END_ENUM_XML
     247                 : #undef END_NODE_XML
     248                 : #undef SUB_NODE_XML
     249                 : #undef SUB_NODE_SEQUENCE_XML
     250                 : #undef SUB_NODE_OPT_XML

Generated: 2010-02-10 01:31 by zcov