summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGValue.h
diff options
context:
space:
mode:
authorIvan A. Kosarev <ikosarev@accesssoftek.com>2017-10-03 10:52:39 +0000
committerIvan A. Kosarev <ikosarev@accesssoftek.com>2017-10-03 10:52:39 +0000
commita511ed75013f049eaf6f1978bff15cb7020524d4 (patch)
tree9c6b03cf228792b063641ea2a941a43ed6dbeb24 /clang/lib/CodeGen/CGValue.h
parente093bad472ce7ad1715321abbb3b1fdbf42e2693 (diff)
downloadbcm5719-llvm-a511ed75013f049eaf6f1978bff15cb7020524d4.tar.gz
bcm5719-llvm-a511ed75013f049eaf6f1978bff15cb7020524d4.zip
[CodeGen] Introduce generic TBAA access descriptors
With this patch we implement a concept of TBAA access descriptors that are capable of representing both scalar and struct-path accesses in a generic way. This is part of D37826 reworked to be a separate patch to simplify review. Differential Revision: https://reviews.llvm.org/D38456 llvm-svn: 314780
Diffstat (limited to 'clang/lib/CodeGen/CGValue.h')
-rw-r--r--clang/lib/CodeGen/CGValue.h28
1 files changed, 7 insertions, 21 deletions
diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h
index 02e2bab1f5b..c0348e4d2ea 100644
--- a/clang/lib/CodeGen/CGValue.h
+++ b/clang/lib/CodeGen/CGValue.h
@@ -20,6 +20,7 @@
#include "llvm/IR/Value.h"
#include "llvm/IR/Type.h"
#include "Address.h"
+#include "CodeGenTBAA.h"
namespace llvm {
class Constant;
@@ -220,6 +221,7 @@ class LValue {
bool ImpreciseLifetime : 1;
LValueBaseInfo BaseInfo;
+ TBAAAccessInfo TBAAInfo;
// This flag shows if a nontemporal load/stores should be used when accessing
// this lvalue.
@@ -227,15 +229,6 @@ class LValue {
Expr *BaseIvarExp;
- /// TBAABaseType - The base access type used by TBAA.
- QualType TBAABaseType;
-
- /// TBAAOffset - Access offset used by TBAA.
- uint64_t TBAAOffset;
-
- /// TBAAInfo - The final access type used by TBAA.
- llvm::MDNode *TBAAAccessType;
-
private:
void Initialize(QualType Type, Qualifiers Quals,
CharUnits Alignment, LValueBaseInfo BaseInfo,
@@ -248,6 +241,7 @@ private:
assert(this->Alignment == Alignment.getQuantity() &&
"Alignment exceeds allowed max!");
this->BaseInfo = BaseInfo;
+ this->TBAAInfo = TBAAAccessInfo(Type, TBAAAccessType, /* Offset= */ 0);
// Initialize Objective-C flags.
this->Ivar = this->ObjIsArray = this->NonGC = this->GlobalObjCRef = false;
@@ -255,11 +249,6 @@ private:
this->Nontemporal = false;
this->ThreadLocalRef = false;
this->BaseIvarExp = nullptr;
-
- // Initialize fields for TBAA.
- this->TBAABaseType = Type;
- this->TBAAOffset = 0;
- this->TBAAAccessType = TBAAAccessType;
}
public:
@@ -319,14 +308,11 @@ public:
Expr *getBaseIvarExp() const { return BaseIvarExp; }
void setBaseIvarExp(Expr *V) { BaseIvarExp = V; }
- QualType getTBAABaseType() const { return TBAABaseType; }
- void setTBAABaseType(QualType T) { TBAABaseType = T; }
-
- uint64_t getTBAAOffset() const { return TBAAOffset; }
- void setTBAAOffset(uint64_t O) { TBAAOffset = O; }
+ TBAAAccessInfo getTBAAInfo() const { return TBAAInfo; }
+ void setTBAAInfo(TBAAAccessInfo Info) { TBAAInfo = Info; }
- llvm::MDNode *getTBAAAccessType() const { return TBAAAccessType; }
- void setTBAAAccessType(llvm::MDNode *N) { TBAAAccessType = N; }
+ llvm::MDNode *getTBAAAccessType() const { return TBAAInfo.AccessType; }
+ void setTBAAAccessType(llvm::MDNode *N) { TBAAInfo.AccessType = N; }
const Qualifiers &getQuals() const { return Quals; }
Qualifiers &getQuals() { return Quals; }
OpenPOWER on IntegriCloud