[PATCH] D20590: [esan|cfrag] Add struct info registration

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 09:23:29 PDT 2016

filcab accepted this revision.
filcab added a reviewer: filcab.
filcab added a comment.
This revision is now accepted and ready to land.

LGTM with a pass of `clang-format`.

Comment at: lib/esan/cache_frag.cpp:24
@@ +23,3 @@
+// This should be kept consistent with LLVM's EfficiencySanitizer StructInfo.
+struct StructInfo {
+  const char *StructName;
> Why u32 at the end would keep binary compatibility?
Would be easier to add fields (up to 4 bytes added) after the `u32` and still fit in the same size. (Only valid because we know exactly how ABIs work on the platforms we support).
You can still add stuff using padding bytes with the `u32` being where it is, so no big deal there.

Since this sanitizer is much more complicated than something like UBSan (where we pulled off changing the structures emitted once (twice after a revision in process gets accepted)), I don't think we should worry about this too much. OK as it is.

Comment at: lib/esan/cache_frag.cpp:115
@@ +114,3 @@
+  static u64 CtxMem[sizeof(Context) / sizeof(u64) + 1];
+  Ctx = new(CtxMem) Context();
+  Ctx->NumOfStructs = 0;
Please run `clang-format` on the patch.


More information about the llvm-commits mailing list