diff options
author | Dan Gohman <gohman@apple.com> | 2010-10-14 23:06:10 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-10-14 23:06:10 +0000 |
commit | 3d5aff5d3036b0ff09d114857cd2276134b3d8c9 (patch) | |
tree | 63d582147e979c75e55602858d0bcae7fff6b422 /lib/CodeGen/CGValue.h | |
parent | 5bc794ff3034bad2b231b0841ea6d0a711c4af59 (diff) |
Experimental TBAA support.
This enables metadata generation by default, however the TBAA pass
in the optimizer is still disabled for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGValue.h')
-rw-r--r-- | lib/CodeGen/CGValue.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/CodeGen/CGValue.h b/lib/CodeGen/CGValue.h index ff19179db0..a000b22331 100644 --- a/lib/CodeGen/CGValue.h +++ b/lib/CodeGen/CGValue.h @@ -157,8 +157,13 @@ class LValue { bool ThreadLocalRef : 1; Expr *BaseIvarExp; + + /// TBAAInfo - TBAA information to attach to dereferences of this LValue. + llvm::MDNode *TBAAInfo; + private: - void Initialize(Qualifiers Quals, unsigned Alignment = 0) { + void Initialize(Qualifiers Quals, unsigned Alignment = 0, + llvm::MDNode *TBAAInfo = 0) { this->Quals = Quals; this->Alignment = Alignment; assert(this->Alignment == Alignment && "Alignment exceeds allowed max!"); @@ -167,6 +172,7 @@ private: this->Ivar = this->ObjIsArray = this->NonGC = this->GlobalObjCRef = false; this->ThreadLocalRef = false; this->BaseIvarExp = 0; + this->TBAAInfo = TBAAInfo; } public: @@ -208,6 +214,9 @@ public: Expr *getBaseIvarExp() const { return BaseIvarExp; } void setBaseIvarExp(Expr *V) { BaseIvarExp = V; } + llvm::MDNode *getTBAAInfo() const { return TBAAInfo; } + void setTBAAInfo(llvm::MDNode *N) { TBAAInfo = N; } + const Qualifiers &getQuals() const { return Quals; } Qualifiers &getQuals() { return Quals; } @@ -252,14 +261,15 @@ public: } static LValue MakeAddr(llvm::Value *V, QualType T, unsigned Alignment, - ASTContext &Context) { + ASTContext &Context, + llvm::MDNode *TBAAInfo = 0) { Qualifiers Quals = Context.getCanonicalType(T).getQualifiers(); Quals.setObjCGCAttr(Context.getObjCGCAttrKind(T)); LValue R; R.LVType = Simple; R.V = V; - R.Initialize(Quals, Alignment); + R.Initialize(Quals, Alignment, TBAAInfo); return R; } |