This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] dump() ExprEngine's internal traits into the ExplodedGraph view.
ClosedPublic

Authored by NoQ on Jan 25 2018, 3:23 PM.

Details

Summary

When viewing the ExplodedGraph through graphviz, make ExprEngine's two private program state traits - namely C++ allocator values and C++ initialized temporaries - visible in the dump.

How it looks:

Unfortunately this relies on LocationContext, so it wouldn't be available in normal ProgramState dumps. Hmm, i guess i could add a mode to print them in an unsorted order.

Diff Detail

Repository
rC Clang

Event Timeline

NoQ created this revision.Jan 25 2018, 3:23 PM

Looks good

lib/StaticAnalyzer/Core/ExprEngine.cpp
427

Actually I would put both of those into static functions: printInitializedTemporaries, printCXXNewAllocatorValues

450

Can we get a variable for I.first?

NoQ updated this revision to Diff 132010.Jan 30 2018, 11:31 AM

Address comments :)

NoQ marked 2 inline comments as done.Jan 30 2018, 11:31 AM

More debug info is always good.

lib/StaticAnalyzer/Core/ExprEngine.cpp
400

Why not ASTContext::getPrintingPolicy()?

looks good otherwise.

lib/StaticAnalyzer/Core/ExprEngine.cpp
418

indent?
actually, an even better version would be probably moving those function back inline into printState, but instead moving out the lambdas passed to dumpStack.
That would solve the eight-levels-of-indentation problem, and get rid of super-verbose lambdas

But that's all bikeshedding though

This revision is now accepted and ready to land.Jan 30 2018, 12:03 PM
NoQ updated this revision to Diff 132042.Jan 30 2018, 1:45 PM
NoQ marked 2 inline comments as done.

More debug info is always good.

I know, right?^^

But that's all bikeshedding though

Well, it's great for me because i'd finally learn how to write programs :)

lib/StaticAnalyzer/Core/ExprEngine.cpp
400

Dunno, maybe the rest of the file should be fixed as well.

This revision was automatically updated to reflect the committed changes.