コード例 #1
0
ファイル: AutoloadCallback.cpp プロジェクト: bellenot/root
    bool VisitDecl(Decl* D) {
      if (!m_IsStoringState)
        return true;

      if (!D->hasAttr<AnnotateAttr>())
        return true;

      Annotations_t annotations;
      for(auto attr = D->specific_attr_begin<AnnotateAttr> (),
          end = D->specific_attr_end<AnnotateAttr> ();
          attr != end;
          ++attr)
      {
        if (!attr->isInherited()) {
          auto annot = attr->getAnnotation();
          if (annot.startswith(llvm::StringRef(annoTag, lenAnnoTag))) {
            if (annotations.first.empty()) {
              annotations.first = annot.drop_front(lenAnnoTag);
            } else {
              annotations.second = annot.drop_front(lenAnnoTag);
            }
          }
        }
      }
      InsertIntoAutoloadingState(D, annotations);

      return true;
    }
コード例 #2
0
    bool VisitDecl(Decl* D) {
      if (!m_IsStoringState)
        return true;

      if (!D->hasAttr<AnnotateAttr>())
        return true;

      AnnotateAttr* attr = D->getAttr<AnnotateAttr>();
      if (!attr)
        return true;

      switch (D->getKind()) {
      default:
        InsertIntoAutoloadingState(D, attr->getAnnotation());
        break;
      case Decl::Enum:
        // EnumDecls have extra information 2 chars after the filename used
        // for extra fixups.
        InsertIntoAutoloadingState(D, attr->getAnnotation().drop_back(2));
        break;
      }

      return true;
    }