003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lld/include/lld/Common
usr
/
src
/
contrib
/
llvm-project
/
lld
/
include
/
lld
/
Common
/
📁
..
📄
Args.h
(1.12 KB)
📄
DWARF.h
(1.36 KB)
📄
Driver.h
(1.41 KB)
📄
ErrorHandler.h
(6.01 KB)
📄
Filesystem.h
(599 B)
📄
LLVM.h
(2.56 KB)
📄
Memory.h
(2.37 KB)
📄
Reproduce.h
(1.01 KB)
📄
Strings.h
(2.48 KB)
📄
TargetOptionsCommandFlags.h
(887 B)
📄
Timer.h
(1.24 KB)
📄
Version.h
(750 B)
📄
Version.inc.in
(43 B)
Editing: Strings.h
//===- Strings.h ------------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLD_STRINGS_H #define LLD_STRINGS_H #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/GlobPattern.h" #include <string> #include <vector> namespace lld { // Returns a demangled C++ symbol name. If Name is not a mangled // name, it returns name. std::string demangleItanium(llvm::StringRef name); std::vector<uint8_t> parseHex(llvm::StringRef s); bool isValidCIdentifier(llvm::StringRef s); // Write the contents of the a buffer to a file void saveBuffer(llvm::StringRef buffer, const llvm::Twine &path); // A single pattern to match against. A pattern can either be double-quoted // text that should be matched exactly after removing the quoting marks or a // glob pattern in the sense of GlobPattern. class SingleStringMatcher { public: // Create a StringPattern from Pattern to be matched exactly irregardless // of globbing characters if ExactMatch is true. SingleStringMatcher(llvm::StringRef Pattern); // Match s against this pattern, exactly if ExactMatch is true. bool match(llvm::StringRef s) const; private: // Whether to do an exact match irregardless of the presence of wildcard // character. bool ExactMatch; // GlobPattern object if not doing an exact match. llvm::GlobPattern GlobPatternMatcher; // StringRef to match exactly if doing an exact match. llvm::StringRef ExactPattern; }; // This class represents multiple patterns to match against. A pattern can // either be a double-quoted text that should be matched exactly after removing // the quoted marks or a glob pattern. class StringMatcher { private: // Patterns to match against. std::vector<SingleStringMatcher> patterns; public: StringMatcher() = default; // Matcher for a single pattern. StringMatcher(llvm::StringRef Pattern) : patterns({SingleStringMatcher(Pattern)}) {} // Add a new pattern to the existing ones to match against. void addPattern(SingleStringMatcher Matcher) { patterns.push_back(Matcher); } bool empty() { return patterns.empty(); } // Match s against the patterns. bool match(llvm::StringRef s) const; }; } // namespace lld #endif
Upload File
Create Folder