forked from OSchip/llvm-project
[NFC][sanitizer] Reformat a part of the file
This commit is contained in:
parent
e8a0af8013
commit
6c67ff4b05
|
@ -312,29 +312,26 @@ class Addr2LinePool final : public SymbolizerTool {
|
|||
FIRST_32_SECOND_64(UINT32_MAX, UINT64_MAX);
|
||||
};
|
||||
|
||||
#if SANITIZER_SUPPORTS_WEAK_HOOKS
|
||||
# if SANITIZER_SUPPORTS_WEAK_HOOKS
|
||||
extern "C" {
|
||||
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE bool
|
||||
__sanitizer_symbolize_code(const char *ModuleName, u64 ModuleOffset,
|
||||
char *Buffer, int MaxLength,
|
||||
bool SymbolizeInlineFrames);
|
||||
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
|
||||
bool __sanitizer_symbolize_data(const char *ModuleName, u64 ModuleOffset,
|
||||
char *Buffer, int MaxLength);
|
||||
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
|
||||
void __sanitizer_symbolize_flush();
|
||||
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
|
||||
int __sanitizer_symbolize_demangle(const char *Name, char *Buffer,
|
||||
int MaxLength);
|
||||
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE bool
|
||||
__sanitizer_symbolize_data(const char *ModuleName, u64 ModuleOffset,
|
||||
char *Buffer, int MaxLength);
|
||||
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void
|
||||
__sanitizer_symbolize_flush();
|
||||
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE int
|
||||
__sanitizer_symbolize_demangle(const char *Name, char *Buffer, int MaxLength);
|
||||
} // extern "C"
|
||||
|
||||
class InternalSymbolizer final : public SymbolizerTool {
|
||||
public:
|
||||
static InternalSymbolizer *get(LowLevelAllocator *alloc) {
|
||||
if (__sanitizer_symbolize_code != 0 &&
|
||||
__sanitizer_symbolize_data != 0) {
|
||||
return new(*alloc) InternalSymbolizer();
|
||||
}
|
||||
if (__sanitizer_symbolize_code && __sanitizer_symbolize_data)
|
||||
return new (*alloc) InternalSymbolizer();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -342,7 +339,8 @@ class InternalSymbolizer final : public SymbolizerTool {
|
|||
bool result = __sanitizer_symbolize_code(
|
||||
stack->info.module, stack->info.module_offset, buffer_, kBufferSize,
|
||||
common_flags()->symbolize_inline_frames);
|
||||
if (result) ParseSymbolizePCOutput(buffer_, stack);
|
||||
if (result)
|
||||
ParseSymbolizePCOutput(buffer_, stack);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -365,7 +363,7 @@ class InternalSymbolizer final : public SymbolizerTool {
|
|||
if (__sanitizer_symbolize_demangle) {
|
||||
for (uptr res_length = 1024;
|
||||
res_length <= InternalSizeClassMap::kMaxSize;) {
|
||||
char *res_buff = static_cast<char*>(InternalAlloc(res_length));
|
||||
char *res_buff = static_cast<char *>(InternalAlloc(res_length));
|
||||
uptr req_length =
|
||||
__sanitizer_symbolize_demangle(name, res_buff, res_length);
|
||||
if (req_length > res_length) {
|
||||
|
@ -380,19 +378,19 @@ class InternalSymbolizer final : public SymbolizerTool {
|
|||
}
|
||||
|
||||
private:
|
||||
InternalSymbolizer() { }
|
||||
InternalSymbolizer() {}
|
||||
|
||||
static const int kBufferSize = 16 * 1024;
|
||||
char buffer_[kBufferSize];
|
||||
};
|
||||
#else // SANITIZER_SUPPORTS_WEAK_HOOKS
|
||||
# else // SANITIZER_SUPPORTS_WEAK_HOOKS
|
||||
|
||||
class InternalSymbolizer final : public SymbolizerTool {
|
||||
public:
|
||||
static InternalSymbolizer *get(LowLevelAllocator *alloc) { return 0; }
|
||||
};
|
||||
|
||||
#endif // SANITIZER_SUPPORTS_WEAK_HOOKS
|
||||
# endif // SANITIZER_SUPPORTS_WEAK_HOOKS
|
||||
|
||||
const char *Symbolizer::PlatformDemangle(const char *name) {
|
||||
return DemangleSwiftAndCXX(name);
|
||||
|
|
Loading…
Reference in New Issue