mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We did not serialize them because getting USR for extensions is tricky (USRs are usually for value decls). This commit starts to make up an USR for an extension by combining the extended nominal's USR with the USR of the first value member of the extension. We use this made-up USR to associate doc comments when (de)serializing them.
44 lines
1.4 KiB
C++
44 lines
1.4 KiB
C++
//===--- USRGeneration.h - Routines for USR generation ----------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See http://swift.org/LICENSE.txt for license information
|
|
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef SWIFT_AST_USRGENERATION_H
|
|
#define SWIFT_AST_USRGENERATION_H
|
|
|
|
#include "swift/Basic/LLVM.h"
|
|
|
|
namespace swift {
|
|
class AbstractStorageDecl;
|
|
class ValueDecl;
|
|
class ExtensionDecl;
|
|
enum class AccessorKind;
|
|
|
|
namespace ide {
|
|
|
|
/// Prints out the USR for the given Decl.
|
|
/// \returns true if it failed, false on success.
|
|
bool printDeclUSR(const ValueDecl *D, raw_ostream &OS);
|
|
|
|
/// Prints out the accessor USR for the given storage Decl.
|
|
/// \returns true if it failed, false on success.
|
|
bool printAccessorUSR(const AbstractStorageDecl *D, AccessorKind AccKind,
|
|
llvm::raw_ostream &OS);
|
|
|
|
/// Prints out the extension USR for the given extension Decl.
|
|
/// \returns true if it failed, false on success.
|
|
bool printExtensionUSR(const ExtensionDecl *ED, raw_ostream &OS);
|
|
|
|
} // namespace ide
|
|
} // namespace swift
|
|
|
|
#endif // LLVM_SWIFT_AST_USRGENERATION_H
|
|
|