Skip to content

Simplify instrumentation? #66

Description

@thetheodor

DCEMarkers

to avoid inserting curly braces everywhere, I could instrument like so:

if (C)
  STMT;
if (C && (Marker1(), 1)  || (Marker2(), 0) )
   STMT();

or

if ( C ? (Marker1(), 1) :  (Marker2(), 0))
   STMT();

loops can be handled similarly, except for range-based for loops and do while loops which must be instrumented via their bodies. It also doesn't work for if statement with a complex initializer (if (auto* X = expr())), for simple cases it would work: if (auto* X = ptr ? (Marker1(), ptr): (Marker2(), ptr)
.

The downside is that Marker() must be an expression, but I could implement is an always_inline function:

__attribute__((always_inline))
void Marker(){
 //...
}

VRMarkers

VRMarkers can be baked into expressions, e.g.:

T V = expr(x);
T V = (marker(x), expr(x));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions