diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-11-04 20:52:37 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-11-04 20:52:37 +0000 |
commit | 60e1e54d50a0e64c89940f2a3f4a4a1f9999abe2 (patch) | |
tree | 2635c9b55c28e7fd98c52bf9587a0a0ca60168bf /lib/tsan/go | |
parent | 65d879d8b0beef8cce2b06073353a4d348973670 (diff) |
[TSan] Make ReportStack contain __sanitizer::AddressInfo object.
AddressInfo contains the results of symbolization. Store this object
directly in the symbolized stack, instead of copying data around and
making unnecessary memory allocations.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/go')
-rw-r--r-- | lib/tsan/go/tsan_go.cc | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/tsan/go/tsan_go.cc b/lib/tsan/go/tsan_go.cc index f36b9260d..c1d401f6f 100644 --- a/lib/tsan/go/tsan_go.cc +++ b/lib/tsan/go/tsan_go.cc @@ -39,14 +39,6 @@ ReportLocation *SymbolizeData(uptr addr) { return 0; } -ReportStack *NewReportStackEntry(uptr addr) { - ReportStack *ent = (ReportStack*)internal_alloc(MBlockReportStack, - sizeof(ReportStack)); - internal_memset(ent, 0, sizeof(*ent)); - ent->pc = addr; - return ent; -} - void *internal_alloc(MBlockType typ, uptr sz) { return InternalAlloc(sz); } @@ -68,20 +60,17 @@ struct SymbolizeContext { static void (*symbolize_cb)(SymbolizeContext *ctx); ReportStack *SymbolizeCode(uptr addr) { - ReportStack *s = (ReportStack*)internal_alloc(MBlockReportStack, - sizeof(ReportStack)); - internal_memset(s, 0, sizeof(*s)); - s->pc = addr; + ReportStack *s = ReportStack::New(addr); SymbolizeContext ctx; internal_memset(&ctx, 0, sizeof(ctx)); ctx.pc = addr; symbolize_cb(&ctx); if (ctx.res) { - s->offset = ctx.off; - s->func = internal_strdup(ctx.func ? ctx.func : "??"); - s->file = internal_strdup(ctx.file ? ctx.file : "-"); - s->line = ctx.line; - s->col = 0; + s->info.module_offset = ctx.off; + s->info.function = internal_strdup(ctx.func ? ctx.func : "??"); + s->info.file = internal_strdup(ctx.file ? ctx.file : "-"); + s->info.line = ctx.line; + s->info.column = 0; } return s; } |