Computer Laboratory

Detailed Description

An annotation applied by Clang/TESLA to a structure field access.

Definition at line 80 of file Annotations.h.

#include "Annotations.h"

+ Inheritance diagram for tesla::FieldAnnotation:
+ Collaboration diagram for tesla::FieldAnnotation:

Public Member Functions

virtual AnnotationKind getKind () const
 
llvm::StringRef getStructName () const
 
llvm::StringRef getFieldName () const
 
std::string completeFieldName () const
 
llvm::Value::use_iterator begin ()
 
llvm::Value::use_iterator end ()
 
 FieldAnnotation (llvm::CallInst *Call, const llvm::Value *PtrArg, llvm::StringRef StructName, llvm::StringRef FieldName, llvm::StringRef Filename, llvm::APInt &Line)
 
- Public Member Functions inherited from tesla::PtrAnnotation
virtual ~PtrAnnotation ()
 
llvm::StringRef getName () const
 
const llvm::Value * getValue () const
 

Static Public Member Functions

static bool classof (const PtrAnnotation *P)
 
- Static Public Member Functions inherited from tesla::PtrAnnotation
static bool classof (const PtrAnnotation *P)
 
static PtrAnnotationInterpret (llvm::User *)
 

Additional Inherited Members

- Public Types inherited from tesla::PtrAnnotation
enum  AnnotationKind { AK_RawAnnotation, AK_FieldAnnotation }
 
- Protected Member Functions inherited from tesla::PtrAnnotation
 PtrAnnotation (llvm::CallInst *Call, const llvm::Value *PtrArg, llvm::StringRef Name, llvm::StringRef Filename, llvm::APInt &Line)
 
- Static Protected Member Functions inherited from tesla::PtrAnnotation
static llvm::StringRef ExtractStringConstant (const llvm::Value *V)
 
- Protected Attributes inherited from tesla::PtrAnnotation
llvm::CallInst * Call
 
const llvm::Value * PtrArg
 
const llvm::StringRef Name
 
const llvm::StringRef Filename
 
const llvm::APInt & Line
 

Constructor & Destructor Documentation

tesla::FieldAnnotation::FieldAnnotation ( llvm::CallInst *  Call,
const llvm::Value *  PtrArg,
llvm::StringRef  StructName,
llvm::StringRef  FieldName,
llvm::StringRef  Filename,
llvm::APInt &  Line 
)
inline

Definition at line 94 of file Annotations.h.

97  : PtrAnnotation(Call, PtrArg, (StructName + "." + FieldName).str(),
98  Filename, Line),
99  StructName(StructName), FieldName(FieldName)
100  {
101  }

Member Function Documentation

llvm::Value::use_iterator tesla::FieldAnnotation::begin ( )
inline

Definition at line 91 of file Annotations.h.

References tesla::PtrAnnotation::Call.

91 { return Call->use_begin(); }
static bool tesla::FieldAnnotation::classof ( const PtrAnnotation P)
inlinestatic

Definition at line 83 of file Annotations.h.

References tesla::PtrAnnotation::AK_FieldAnnotation, and tesla::PtrAnnotation::getKind().

83  {
84  return (P->getKind() == AK_FieldAnnotation);
85  }

+ Here is the call graph for this function:

string tesla::FieldAnnotation::completeFieldName ( ) const

Definition at line 77 of file Annotations.cpp.

References strnlen.

Referenced by tesla::FieldReferenceInstrumenter::runOnModule().

77  {
78  string Complete = (StructName + "." + FieldName).str();
79 
80  // Remove trailing NULL character.
81  Complete.resize(strnlen(Complete.c_str(), Complete.length()));
82 
83  return Complete;
84 }

+ Here is the caller graph for this function:

llvm::Value::use_iterator tesla::FieldAnnotation::end ( )
inline

Definition at line 92 of file Annotations.h.

References tesla::PtrAnnotation::Call.

92 { return Call->use_end(); }
llvm::StringRef tesla::FieldAnnotation::getFieldName ( ) const
inline

Definition at line 88 of file Annotations.h.

88 { return FieldName; }
virtual AnnotationKind tesla::FieldAnnotation::getKind ( ) const
inlinevirtual

Reimplemented from tesla::PtrAnnotation.

Definition at line 82 of file Annotations.h.

References tesla::PtrAnnotation::AK_FieldAnnotation.

82 { return AK_FieldAnnotation; }
llvm::StringRef tesla::FieldAnnotation::getStructName ( ) const
inline

Definition at line 87 of file Annotations.h.

87 { return StructName; }

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