[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[creduce-dev] Reducing in multiple files which share a common header



Hi creduce devs,


We work on the Clang static analyzer Cross Translation Unit (CTU)
feature, where we try to reduce crashes to a minimal example.

Let's assume we have a header and two translation units, both includes
the same header:

// Foo.hpp

struct X {

  int a;

  int b;

};

// A.cpp

#include <Foo.hpp>

void f() { X x; x.a; }

// B.cpp

#include <Foo.hpp>

void f2() { X x2; x2.a; }


We work with preprocessed files because we want creduce to reduce in
headers as well. Whenever creduce decides to remove let's say the "int
a;" member and all of it's uses from the first translation unit, is it
possible to do the same reduction step in the second translation unit?


If that is not possible, is it possible to get a unique identifier
like clang::USR
(https://clang.llvm.org/doxygen/group__CINDEX__CURSOR__XREF.html#ga51679cb755bbd94cc5e9476c685f2df3)
for the removed entity so we could reduce the same thing in the second
translation unit? (For that of course we'd need to be able to
parameterize creduce with an USR and with the other properties of the
reduction step ...)


If you have any ideas how to approach this problem we'd pretty much
appreciate it.


Thanks,

Gabor