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 | 947c9af77497a67a6ee079e3afd1ec82059b5186 (patch) | |
tree | b8d202729b8d3190fd5739df3d3608e61c1f5403 /clang/lib/CodeGen/CGValue.h | |
parent | 0f58561907985a879d90b210a2a32fac1d5518c8 (diff) | |
download | bcm5719-llvm-947c9af77497a67a6ee079e3afd1ec82059b5186.tar.gz bcm5719-llvm-947c9af77497a67a6ee079e3afd1ec82059b5186.zip |
Experimental TBAA support.
This enables metadata generation by default, however the TBAA pass
in the optimizer is still disabled for now.
llvm-svn: 116536
Diffstat (limited to 'clang/lib/CodeGen/CGValue.h')
-rw-r--r-- | clang/lib/CodeGen/CGValue.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h index ff19179db00..a000b223311 100644 --- a/clang/lib/CodeGen/CGValue.h +++ b/clang/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; } |