Skip to content

Commit

Permalink
Merge from 'master' to 'sycl-web'
Browse files Browse the repository at this point in the history
  • Loading branch information
bader committed Aug 27, 2019
2 parents bf6cf0c + 729e242 commit d3e712a
Show file tree
Hide file tree
Showing 1,869 changed files with 43,813 additions and 21,099 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief This file provides the interface for deduplicating, detecting
/// This file provides the interface for deduplicating, detecting
/// conflicts in, and applying collections of Replacements.
///
//===----------------------------------------------------------------------===//
Expand All @@ -31,21 +31,21 @@ class Rewriter;

namespace replace {

/// \brief Collection of TranslationUnitReplacements.
/// Collection of TranslationUnitReplacements.
typedef std::vector<clang::tooling::TranslationUnitReplacements> TUReplacements;

/// \brief Collection of TranslationUnitReplacement files.
/// Collection of TranslationUnitReplacement files.
typedef std::vector<std::string> TUReplacementFiles;

/// \brief Collection of TranslationUniDiagnostics.
/// Collection of TranslationUniDiagnostics.
typedef std::vector<clang::tooling::TranslationUnitDiagnostics> TUDiagnostics;

/// \brief Map mapping file name to a set of AtomicChange targeting that file.
/// Map mapping file name to a set of AtomicChange targeting that file.
typedef llvm::DenseMap<const clang::FileEntry *,
std::vector<tooling::AtomicChange>>
FileToChangesMap;

/// \brief Recursively descends through a directory structure rooted at \p
/// Recursively descends through a directory structure rooted at \p
/// Directory and attempts to deserialize *.yaml files as
/// TranslationUnitReplacements. All docs that successfully deserialize are
/// added to \p TUs.
Expand All @@ -70,7 +70,7 @@ std::error_code collectReplacementsFromDirectory(
const llvm::StringRef Directory, TUDiagnostics &TUs,
TUReplacementFiles &TUFiles, clang::DiagnosticsEngine &Diagnostics);

/// \brief Deduplicate, check for conflicts, and extract all Replacements stored
/// Deduplicate, check for conflicts, and extract all Replacements stored
/// in \c TUs. Conflicting replacements are skipped.
///
/// \post For all (key,value) in FileChanges, value[i].getOffset() <=
Expand All @@ -90,7 +90,7 @@ bool mergeAndDeduplicate(const TUReplacements &TUs, const TUDiagnostics &TUDs,
FileToChangesMap &FileChanges,
clang::SourceManager &SM);

/// \brief Apply \c AtomicChange on File and rewrite it.
/// Apply \c AtomicChange on File and rewrite it.
///
/// \param[in] File Path of the file where to apply AtomicChange.
/// \param[in] Changes to apply.
Expand All @@ -104,7 +104,7 @@ applyChanges(StringRef File, const std::vector<tooling::AtomicChange> &Changes,
const tooling::ApplyChangesSpec &Spec,
DiagnosticsEngine &Diagnostics);

/// \brief Delete the replacement files.
/// Delete the replacement files.
///
/// \param[in] Files Replacement files to delete.
/// \param[in] Diagnostics DiagnosticsEngine used for error output.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief This file provides the implementation for deduplicating, detecting
/// This file provides the implementation for deduplicating, detecting
/// conflicts in, and applying collections of Replacements.
///
/// FIXME: Use Diagnostics for output instead of llvm::errs().
Expand Down Expand Up @@ -124,7 +124,7 @@ std::error_code collectReplacementsFromDirectory(
return ErrorCode;
}

/// \brief Extract replacements from collected TranslationUnitReplacements and
/// Extract replacements from collected TranslationUnitReplacements and
/// TranslationUnitDiagnostics and group them per file. Identical replacements
/// from diagnostics are deduplicated.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief This file provides the main function for the
/// This file provides the main function for the
/// clang-apply-replacements tool.
///
//===----------------------------------------------------------------------===//
Expand Down
6 changes: 3 additions & 3 deletions clang-tools-extra/clang-doc/BitcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ unsigned ClangDocBitcodeWriter::AbbreviationMap::get(RecordId RID) const {

// Validation and Overview Blocks

/// \brief Emits the magic number header to check that its the right format,
/// Emits the magic number header to check that its the right format,
/// in this case, 'DOCS'.
void ClangDocBitcodeWriter::emitHeader() {
for (char C : BitCodeConstants::Signature)
Expand All @@ -266,7 +266,7 @@ void ClangDocBitcodeWriter::emitVersionBlock() {
emitRecord(VersionNumber, VERSION);
}

/// \brief Emits a block ID and the block name to the BLOCKINFO block.
/// Emits a block ID and the block name to the BLOCKINFO block.
void ClangDocBitcodeWriter::emitBlockID(BlockId BID) {
const auto &BlockIdName = BlockIdNameMap[BID];
assert(BlockIdName.data() && BlockIdName.size() && "Unknown BlockId.");
Expand All @@ -279,7 +279,7 @@ void ClangDocBitcodeWriter::emitBlockID(BlockId BID) {
BlockIdName.bytes_end()));
}

/// \brief Emits a record name to the BLOCKINFO block.
/// Emits a record name to the BLOCKINFO block.
void ClangDocBitcodeWriter::emitRecordID(RecordId ID) {
assert(RecordIdNameMap[ID] && "Unknown RecordId.");
prepRecordData(ID);
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/clang-doc/Representation.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct CommentInfo {
return false;

return std::equal(Children.begin(), Children.end(), Other.Children.begin(),
llvm::deref<llvm::equal>{});
llvm::deref<std::equal_to<>>{});
}

// This operator is used to sort a vector of CommentInfos.
Expand All @@ -82,7 +82,7 @@ struct CommentInfo {
if (FirstCI == SecondCI) {
return std::lexicographical_compare(
Children.begin(), Children.end(), Other.Children.begin(),
Other.Children.end(), llvm::deref<llvm::less>());
Other.Children.end(), llvm::deref<std::less<>>());
}

return false;
Expand Down
30 changes: 15 additions & 15 deletions clang-tools-extra/clang-include-fixer/IncludeFixerContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@
namespace clang {
namespace include_fixer {

/// \brief A context for a file being processed. It includes all query
/// A context for a file being processed. It includes all query
/// information, e.g. symbols being queried in database, all header candidates.
class IncludeFixerContext {
public:
struct HeaderInfo {
/// \brief The header where QualifiedName comes from.
/// The header where QualifiedName comes from.
std::string Header;
/// \brief A symbol name with completed namespace qualifiers which will
/// A symbol name with completed namespace qualifiers which will
/// replace the original symbol.
std::string QualifiedName;
};

struct QuerySymbolInfo {
/// \brief The raw symbol name being queried in database. This name might
/// The raw symbol name being queried in database. This name might
/// miss some namespace qualifiers, and will be replaced by a fully
/// qualified one.
std::string RawIdentifier;

/// \brief The qualifiers of the scope in which SymbolIdentifier lookup
/// The qualifiers of the scope in which SymbolIdentifier lookup
/// occurs. It is represented as a sequence of names and scope resolution
/// operatiors ::, ending with a scope resolution operator (e.g. a::b::).
/// Empty if SymbolIdentifier is not in a specific scope.
std::string ScopedQualifiers;

/// \brief The replacement range of RawIdentifier.
/// The replacement range of RawIdentifier.
tooling::Range Range;
};

Expand All @@ -50,41 +50,41 @@ class IncludeFixerContext {
std::vector<QuerySymbolInfo> QuerySymbols,
std::vector<find_all_symbols::SymbolInfo> Symbols);

/// \brief Get symbol name.
/// Get symbol name.
llvm::StringRef getSymbolIdentifier() const {
return QuerySymbolInfos.front().RawIdentifier;
}

/// \brief Get replacement range of the symbol.
/// Get replacement range of the symbol.
tooling::Range getSymbolRange() const {
return QuerySymbolInfos.front().Range;
}

/// \brief Get the file path to the file being processed.
/// Get the file path to the file being processed.
StringRef getFilePath() const { return FilePath; }

/// \brief Get header information.
/// Get header information.
const std::vector<HeaderInfo> &getHeaderInfos() const { return HeaderInfos; }

/// \brief Get information of symbols being querid.
/// Get information of symbols being querid.
const std::vector<QuerySymbolInfo> &getQuerySymbolInfos() const {
return QuerySymbolInfos;
}

private:
friend struct llvm::yaml::MappingTraits<IncludeFixerContext>;

/// \brief The file path to the file being processed.
/// The file path to the file being processed.
std::string FilePath;

/// \brief All instances of an unidentified symbol being queried.
/// All instances of an unidentified symbol being queried.
std::vector<QuerySymbolInfo> QuerySymbolInfos;

/// \brief The symbol candidates which match SymbolIdentifier. The symbols are
/// The symbol candidates which match SymbolIdentifier. The symbols are
/// sorted in a descending order based on the popularity info in SymbolInfo.
std::vector<find_all_symbols::SymbolInfo> MatchedSymbols;

/// \brief The header information.
/// The header information.
std::vector<HeaderInfo> HeaderInfos;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace find_all_symbols {

class HeaderMapCollector;

/// \brief A preprocessor that collects all macro symbols.
/// A preprocessor that collects all macro symbols.
/// The contexts of a macro will be ignored since they are not available during
/// preprocessing period.
class FindAllMacros : public clang::PPCallbacks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace find_all_symbols {

class HeaderMapCollector;

/// \brief FindAllSymbols collects all classes, free standing functions and
/// FindAllSymbols collects all classes, free standing functions and
/// global variables with some extra information such as the path of the header
/// file, the namespaces they are contained in, the type of variables and the
/// parameter types of functions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace clang {
namespace find_all_symbols {

/// \brief HeaderMappCollector collects all remapping header files. This maps
/// HeaderMappCollector collects all remapping header files. This maps
/// complete header names or header name regex patterns to header names.
class HeaderMapCollector {
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace clang {
namespace find_all_symbols {

/// \brief This calculates the include path for \p Loc.
/// This calculates the include path for \p Loc.
///
/// \param SM SourceManager.
/// \param Loc A SourceLocation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace find_all_symbols {

class HeaderMapCollector;

/// \brief PragmaCommentHandler parses pragma comment on include files to
/// PragmaCommentHandler parses pragma comment on include files to
/// determine when we should include a different header from the header that
/// directly defines a symbol.
///
Expand Down
32 changes: 16 additions & 16 deletions clang-tools-extra/clang-include-fixer/find-all-symbols/SymbolInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

namespace clang {
namespace find_all_symbols {
/// \brief Describes a named symbol from a header.
/// Describes a named symbol from a header.
/// Symbols with the same qualified name and type (e.g. function overloads)
/// that appear in the same header are represented by a single SymbolInfo.
///
/// TODO: keep track of instances, e.g. overload locations and signatures.
class SymbolInfo {
public:
/// \brief The SymbolInfo Type.
/// The SymbolInfo Type.
enum class SymbolKind {
Function,
Class,
Expand All @@ -38,17 +38,17 @@ class SymbolInfo {
Unknown,
};

/// \brief The Context Type.
/// The Context Type.
enum class ContextType {
Namespace, // Symbols declared in a namespace.
Record, // Symbols declared in a class.
EnumDecl, // Enum constants declared in a enum declaration.
};

/// \brief A pair of <ContextType, ContextName>.
/// A pair of <ContextType, ContextName>.
typedef std::pair<ContextType, std::string> Context;

// \brief Signals are signals gathered by observing how a symbol is used.
// Signals are signals gathered by observing how a symbol is used.
// These are used to rank results.
struct Signals {
Signals() {}
Expand Down Expand Up @@ -76,19 +76,19 @@ class SymbolInfo {

void SetFilePath(llvm::StringRef Path) { FilePath = Path; }

/// \brief Get symbol name.
/// Get symbol name.
llvm::StringRef getName() const { return Name; }

/// \brief Get the fully-qualified symbol name.
/// Get the fully-qualified symbol name.
std::string getQualifiedName() const;

/// \brief Get symbol type.
/// Get symbol type.
SymbolKind getSymbolKind() const { return Type; }

/// \brief Get a relative file path where symbol comes from.
/// Get a relative file path where symbol comes from.
llvm::StringRef getFilePath() const { return FilePath; }

/// \brief Get symbol contexts.
/// Get symbol contexts.
const std::vector<SymbolInfo::Context> &getContexts() const {
return Contexts;
}
Expand All @@ -100,17 +100,17 @@ class SymbolInfo {
private:
friend struct llvm::yaml::MappingTraits<struct SymbolAndSignals>;

/// \brief Identifier name.
/// Identifier name.
std::string Name;

/// \brief Symbol type.
/// Symbol type.
SymbolKind Type;

/// \brief The file path where the symbol comes from. It's a relative file
/// The file path where the symbol comes from. It's a relative file
/// path based on the build directory.
std::string FilePath;

/// \brief Contains information about symbol contexts. Context information is
/// Contains information about symbol contexts. Context information is
/// stored from the inner-most level to outer-most level.
///
/// For example, if a symbol 'x' is declared as:
Expand All @@ -129,11 +129,11 @@ struct SymbolAndSignals {
bool operator==(const SymbolAndSignals& RHS) const;
};

/// \brief Write SymbolInfos to a stream (YAML format).
/// Write SymbolInfos to a stream (YAML format).
bool WriteSymbolInfosToStream(llvm::raw_ostream &OS,
const SymbolInfo::SignalMap &Symbols);

/// \brief Read SymbolInfos from a YAML document.
/// Read SymbolInfos from a YAML document.
std::vector<SymbolAndSignals> ReadSymbolInfosFromYAML(llvm::StringRef Yaml);

} // namespace find_all_symbols
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace clang {
namespace find_all_symbols {

/// \brief An interface for classes that collect symbols.
/// An interface for classes that collect symbols.
class SymbolReporter {
public:
virtual ~SymbolReporter() = default;
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-query/QueryParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class QueryParser {

QueryRef endQuery(QueryRef Q);

/// \brief Parse [\p Begin,\p End).
/// Parse [\p Begin,\p End).
///
/// \return A reference to the parsed query object, which may be an
/// \c InvalidQuery if a parse error occurs.
Expand Down
Loading

0 comments on commit d3e712a

Please sign in to comment.