[compiler-rt] r253216 - tsan: replace macro check with constant check

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 11:35:21 PST 2015


Thanks!
Please try to follow this pattern whenever possible -- makes the code more
readable.

On Mon, Nov 16, 2015 at 7:55 AM, Dmitry Vyukov via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: dvyukov
> Date: Mon Nov 16 09:55:38 2015
> New Revision: 253216
>
> URL: http://llvm.org/viewvc/llvm-project?rev=253216&view=rev
> Log:
> tsan: replace macro check with constant check
>
> As per comments in 252892 commit.
>
>
> Modified:
>     compiler-rt/trunk/lib/tsan/rtl/tsan_flags.cc
>
> Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_flags.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_flags.cc?rev=253216&r1=253215&r2=253216&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/tsan/rtl/tsan_flags.cc (original)
> +++ compiler-rt/trunk/lib/tsan/rtl/tsan_flags.cc Mon Nov 16 09:55:38 2015
> @@ -61,13 +61,13 @@ void InitializeFlags(Flags *f, const cha
>      CommonFlags cf;
>      cf.CopyFrom(*common_flags());
>      cf.allow_addr2line = true;
> -#ifdef SANITIZER_GO
> -    // Does not work as expected for Go: runtime handles SIGABRT and
> crashes.
> -    cf.abort_on_error = false;
> -    // Go does not have mutexes.
> -#else
> -    cf.detect_deadlocks = true;
> -#endif
> +    if (kGoMode) {
> +      // Does not work as expected for Go: runtime handles SIGABRT and
> crashes.
> +      cf.abort_on_error = false;
> +      // Go does not have mutexes.
> +    } else {
> +      cf.detect_deadlocks = true;
> +    }
>      cf.print_suppressions = false;
>      cf.stack_trace_format = "    #%n %f %S %M";
>      cf.exitcode = 66;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151116/63835978/attachment.html>


More information about the llvm-commits mailing list