Go to the documentation of this file.
35 std::list<llvm::Regex> &IncludeFilters,
36 std::list<llvm::Regex> &ExcludeFilters) {
40 auto match_pred = [Item](
llvm::Regex &
R) {
return R.match(Item); };
44 if (!IncludeFilters.empty() && !
any_of(IncludeFilters, match_pred))
47 if (
any_of(ExcludeFilters, match_pred))
60 SetFilters(ExcludeTypeFilters, Filters.
ExcludeTypes.begin(),
67 SetFilters(IncludeTypeFilters, Filters.
IncludeTypes.begin(),
77 Amount = IndentSpaces;
78 CurrentIndent += Amount;
83 Amount = IndentSpaces;
84 CurrentIndent = std::max<int>(0, CurrentIndent - Amount);
114 CurrentIndent + IndentSpaces,
true);
128 CurrentIndent + IndentSpaces,
true);
145 std::vector<Run> Runs;
153 Runs.emplace_back(CurrentBlock);
154 while (!Blocks.
empty()) {
155 Run *CurrentRun = &Runs.
back();
157 if (NextBlock < CurrentBlock || (NextBlock - CurrentBlock > 1)) {
158 Runs.emplace_back(NextBlock);
159 CurrentRun = &Runs.back();
163 CurrentRun->ByteLen += Used;
164 StreamBytesRemaining -= Used;
165 CurrentBlock = NextBlock;
172 for (
const auto &R : Runs) {
173 if (Offset < R.ByteLen)
174 return std::make_pair(R, Offset);
184 if (StreamIdx >= File.getNumStreams()) {
185 formatLine(
"Stream {0}: Not present", StreamIdx);
188 if (Size + Offset > File.getStreamByteSize(StreamIdx)) {
190 "Stream {0}: Invalid offset and size, range out of stream bounds",
195 auto S = File.createIndexedStream(StreamIdx);
198 formatLine(
"Stream {0}: Not present", StreamIdx);
203 (Size == 0) ?
S->getLength() :
std::min(Offset + Size,
S->getLength());
206 formatLine(
"Stream {0}: {1} (dumping {2:N} / {3:N} bytes)", StreamIdx,
207 StreamPurpose, Size,
S->getLength());
211 Substream.
Offset = Offset;
214 auto Layout = File.getStreamLayout(StreamIdx);
232 std::tie(FoundRun, RunOffset) =
findRun(Substream.
Offset, Runs);
233 assert(FoundRun.ByteLen >= RunOffset);
234 uint64_t Len = FoundRun.ByteLen - RunOffset;
236 uint64_t Base = FoundRun.Block * File.getBlockSize() + RunOffset;
240 CurrentIndent + IndentSpaces,
true);
264 cantFail(File.getBlockData(Blocks.front(), File.getBlockSize()));
265 uint64_t BaseOffset = Blocks.front();
266 BaseOffset *= File.getBlockSize();
268 CurrentIndent + IndentSpaces,
true);
273 Blocks = Blocks.drop_front();
278 if (IsItemExcluded(
TypeName, IncludeTypeFilters, ExcludeTypeFilters))
286 return IsItemExcluded(
SymbolName, IncludeSymbolFilters, ExcludeSymbolFilters);
290 return IsItemExcluded(CompilandName, IncludeCompilandFilters,
291 ExcludeCompilandFilters);
static ManagedStatic< cl::opt< cl::boolOrDefault >, CreateUseColor > UseColor
uint32_t PaddingThreshold
std::vector< support::ulittle32_t > Blocks
This is an optimization pass for GlobalISel generic memory operations.
static const int BlockSize
Error readBytes(ArrayRef< uint8_t > &Buffer, uint32_t Size)
Read Size bytes from the underlying stream at the current offset and and set Buffer to the resulting ...
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
std::list< std::string > IncludeTypes
WithColor(LinePrinter &P, PDB_ColorItem C)
static constexpr Colors GREEN
uint64_t bytesRemaining() const
std::list< std::string > ExcludeSymbols
static constexpr Colors RED
static std::pair< Run, uint64_t > findRun(uint64_t Offset, ArrayRef< Run > Runs)
void consumeError(Error Err)
Consume a Error without doing anything.
bool empty() const
empty - Check if the array is empty.
bool IsCompilandExcluded(llvm::StringRef CompilandName)
void print(const Twine &T)
static constexpr Colors MAGENTA
auto formatv(const char *Fmt, Ts &&... Vals) -> formatv_object< decltype(std::make_tuple(detail::build_format_adapter(std::forward< Ts >(Vals))...))>
virtual raw_ostream & changeColor(enum Colors Color, bool Bold=false, bool BG=false)
Changes the foreground color of text that will be output from this point forward.
const T & back() const
back - Get the last element.
(vector float) vec_cmpeq(*A, *B) C
std::list< std::string > IncludeCompilands
BinaryStreamRef StreamData
void Indent(uint32_t Amount=0)
This class implements an extremely fast bulk output stream that can only output to a stream.
bool IsTypeExcluded(llvm::StringRef TypeName, uint64_t Size)
void formatBinary(StringRef Label, ArrayRef< uint8_t > Data, uint64_t StartOffset)
RefType keep_front(uint64_t N) const
Return a new BinaryStreamRef with only the first N elements remaining.
void formatMsfStreamBlocks(PDBFile &File, const msf::MSFStreamLayout &Stream)
Provides read only access to a subclass of BinaryStream.
void formatMsfStreamData(StringRef Label, PDBFile &File, uint32_t StreamIdx, StringRef StreamPurpose, uint64_t Offset, uint64_t Size)
bool IsSymbolExcluded(llvm::StringRef SymbolName)
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
void formatLine(const char *Fmt, Ts &&...Items)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void Unindent(uint32_t Amount=0)
void printLine(const Twine &T)
bool IsClassExcluded(const ClassLayout &Class)
std::list< std::string > ExcludeCompilands
static constexpr Colors CYAN
std::list< std::string > ExcludeTypes
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
const T & front() const
front - Get the first element.
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
constexpr char TypeName[]
Key for Kernel::Arg::Metadata::mTypeName.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
std::list< std::string > IncludeSymbols
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
virtual raw_ostream & resetColor()
Resets the colors to terminal defaults.
static std::vector< Run > computeBlockRuns(uint32_t BlockSize, const msf::MSFStreamLayout &Layout)
static constexpr Colors YELLOW
FormattedBytes format_bytes_with_ascii(ArrayRef< uint8_t > Bytes, Optional< uint64_t > FirstByteOffset=None, uint32_t NumPerLine=16, uint8_t ByteGroupSize=4, uint32_t IndentLevel=0, bool Upper=false)
detail::AlignAdapter< T > fmt_align(T &&Item, AlignStyle Where, size_t Amount, char Fill=' ')
RefType drop_front(uint64_t N) const
Return a new BinaryStreamRef with the first N elements removed.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Describes the layout of a stream in an MSF layout.