Coverage Report

Created: 2019-05-19 14:56

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/lld/include/lld/Common/Strings.h
Line
Count
Source
1
//===- Strings.h ------------------------------------------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLD_STRINGS_H
10
#define LLD_STRINGS_H
11
12
#include "llvm/ADT/ArrayRef.h"
13
#include "llvm/ADT/Optional.h"
14
#include "llvm/ADT/StringRef.h"
15
#include "llvm/Support/GlobPattern.h"
16
#include <string>
17
#include <vector>
18
19
namespace lld {
20
// Returns a demangled C++ symbol name. If Name is not a mangled
21
// name, it returns Optional::None.
22
llvm::Optional<std::string> demangleItanium(llvm::StringRef Name);
23
llvm::Optional<std::string> demangleMSVC(llvm::StringRef S);
24
25
std::vector<uint8_t> parseHex(llvm::StringRef S);
26
bool isValidCIdentifier(llvm::StringRef S);
27
28
// Write the contents of the a buffer to a file
29
void saveBuffer(llvm::StringRef Buffer, const llvm::Twine &Path);
30
31
// This class represents multiple glob patterns.
32
class StringMatcher {
33
public:
34
817
  StringMatcher() = default;
35
  explicit StringMatcher(llvm::ArrayRef<llvm::StringRef> Pat);
36
37
  bool match(llvm::StringRef S) const;
38
39
private:
40
  std::vector<llvm::GlobPattern> Patterns;
41
};
42
43
} // namespace lld
44
45
#endif