Reproducible: foo.c
int main(){
if(1)
2;
else
const *foo = "{}";
}
Rewrite passes:
/usr/local/bin/clang -fcommon -g -O2 -E -o fault1.c foo.c
/usr/local/bin/clang -Xclang -load -Xclang /root/project/MSV/src/.libs/libprofiler.so.0\
-Xclang -plugin -Xclang err-profiler-gen -Xclang -plugin-arg-err-profiler-gen\
-Xclang gen.c -Xclang -plugin-arg-err-profiler-gen -Xclang gen.log -fcommon -g -O2 -c -o foo.o foo.c
/usr/local/bin/clang -Xclang -load -Xclang /root/project/MSV/src/.libs/libprofiler.so.0\
-Xclang -plugin -Xclang err-profiler-rewrite -Xclang -plugin-arg-err-profiler-rewrite\
-Xclang gen.c -Xclang -plugin-arg-err-profiler-rewrite -Xclang rewrite.c -fcommon -g -O2 -c -o xargs.o fault1.c
Output: rewrite.c
#include "_prophet_profile.h"
# 1 "fool.c"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 341 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "fool.c" 2
int main(){
__prof_init();
__prof_track(0);
if(1)
{__prof_track(1);
2;}
else
{__prof_track(2);
const *foo = }"{}";
}
Expected output:
{__prof_track(2);
const *foo = "{}";}
I think it has something to do with the function below, you can start investigating from here:
|
virtual bool VisitIfStmt(IfStmt *IF) { |
Reproducible: foo.c
Rewrite passes:
Output: rewrite.c
Expected output:
{__prof_track(2); const *foo = "{}";}I think it has something to do with the function below, you can start investigating from here:
MSV/src/ProfilerAction.cpp
Line 263 in 51f6e31