Computer Laboratory

tesla::AssertionSiteInstrumenter Class Reference

Detailed Description

Converts calls to TESLA pseudo-assertions into instrumentation sites.

Definition at line 51 of file Assertion.h.

#include "Assertion.h"

+ Inheritance diagram for tesla::AssertionSiteInstrumenter:
+ Collaboration diagram for tesla::AssertionSiteInstrumenter:

Public Member Functions

 AssertionSiteInstrumenter (const Manifest &M, bool SuppressDI)
 
virtual ~AssertionSiteInstrumenter ()
 
const char * getPassName () const
 
virtual bool runOnModule (llvm::Module &M)
 
- Public Member Functions inherited from tesla::Instrumenter
 Instrumenter (const Manifest &M, bool SuppressDI)
 
virtual ~Instrumenter ()
 

Static Public Attributes

static char ID = 0
 

Additional Inherited Members

- Protected Attributes inherited from tesla::Instrumenter
const ManifestM
 TESLA manifest that describes automata. More...
 
const bool SuppressDebugInstr
 Don't produce debug instrumentation (e.g., printf() statements). More...
 

Constructor & Destructor Documentation

tesla::AssertionSiteInstrumenter::AssertionSiteInstrumenter ( const Manifest M,
bool  SuppressDI 
)
inline

Definition at line 54 of file Assertion.h.

55  : Instrumenter(M, SuppressDI), ModulePass(ID) {}
tesla::AssertionSiteInstrumenter::~AssertionSiteInstrumenter ( )
virtual

Definition at line 62 of file Assertion.cpp.

62  {
63  ::google::protobuf::ShutdownProtobufLibrary();
64 }

Member Function Documentation

const char* tesla::AssertionSiteInstrumenter::getPassName ( ) const
inline

Definition at line 58 of file Assertion.h.

58  {
59  return "TESLA assertion site instrumenter";
60  }
bool tesla::AssertionSiteInstrumenter::runOnModule ( llvm::Module &  M)
virtual

Definition at line 66 of file Assertion.cpp.

References tesla::INLINE_ASSERTION.

66  {
67  // If this module doesn't declare any assertions, just carry on.
68  AssertFn = M.getFunction(INLINE_ASSERTION);
69  if (!AssertFn)
70  return false;
71 
72  // Find all calls to TESLA assertion pseudo-function (before we modify IR).
73  set<CallInst*> AssertCalls;
74  for (auto I = AssertFn->use_begin(); I != AssertFn->use_end(); ++I)
75  AssertCalls.insert(cast<CallInst>(*I));
76 
77  return ConvertAssertions(AssertCalls, M);
78 }

Member Data Documentation

char tesla::AssertionSiteInstrumenter::ID = 0
static

Definition at line 53 of file Assertion.h.


The documentation for this class was generated from the following files: