summaryrefslogtreecommitdiff
path: root/lib/asan/asan_errors.h
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2016-08-26 20:59:02 +0000
committerFilipe Cabecinhas <me@filcab.net>2016-08-26 20:59:02 +0000
commitf832762fba5e33c7c0d8119637dd42d58ef46739 (patch)
treebfe8da3799cde2df05bfb4b54811597cb6d48e3d /lib/asan/asan_errors.h
parent3bb55621d71266bb8d431464f8da0fa74b5182a8 (diff)
Revert "Start reifying error descriptions"
This reverts r279862 to investigate VS failures. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_errors.h')
-rw-r--r--lib/asan/asan_errors.h78
1 files changed, 0 insertions, 78 deletions
diff --git a/lib/asan/asan_errors.h b/lib/asan/asan_errors.h
deleted file mode 100644
index a41cb2334..000000000
--- a/lib/asan/asan_errors.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//===-- asan_errors.h -------------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file is a part of AddressSanitizer, an address sanity checker.
-//
-// ASan-private header for error structures.
-//===----------------------------------------------------------------------===//
-#ifndef ASAN_ERRORS_H
-#define ASAN_ERRORS_H
-
-#include "asan_descriptions.h"
-#include "asan_scariness_score.h"
-
-namespace __asan {
-
-struct ErrorBase {
- ScarinessScore scariness;
-};
-
-struct ErrorStackOverflow : ErrorBase {
- u32 tid;
- uptr addr, pc, bp, sp;
- // ErrorStackOverflow never owns the context.
- void *context;
- ErrorStackOverflow(const SignalContext &sig, u32 tid_)
- : tid(tid_),
- addr(sig.addr),
- pc(sig.pc),
- bp(sig.bp),
- sp(sig.sp),
- context(sig.context) {
- scariness.Scare(10, "stack-overflow");
- }
- void Print();
-};
-
-enum ErrorKind {
- kErrorKindInvalid = 0,
- kErrorKindStackOverflow,
-};
-
-struct ErrorDescription {
- ErrorKind kind;
- // We're using a tagged union because it allows us to have a trivially
- // copiable type and use the same structures as the public interface.
- //
- // We can add a wrapper around it to make it "more c++-like", but that would
- // add a lot of code and the benefit wouldn't be that big.
- union {
- ErrorStackOverflow stack_overflow;
- };
- ErrorDescription() { internal_memset(this, 0, sizeof(*this)); }
- ErrorDescription(const ErrorStackOverflow &e) // NOLINT
- : kind(kErrorKindStackOverflow),
- stack_overflow(e) {}
-
- bool IsValid() { return kind != kErrorKindInvalid; }
- void Print() {
- switch (kind) {
- case kErrorKindStackOverflow:
- stack_overflow.Print();
- return;
- case kErrorKindInvalid:
- CHECK(0);
- }
- CHECK(0);
- }
-};
-
-} // namespace __asan
-
-#endif // ASAN_ERRORS_H