summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGValue.h
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2009-07-22 03:08:17 +0000
committerMon P Wang <wangmp@apple.com>2009-07-22 03:08:17 +0000
commitacedf7768f6416de4c753184fe11582b805ca61a (patch)
tree792f59bcc1ec6a88ce2e7d6a0defa1ac3e106d62 /clang/lib/CodeGen/CGValue.h
parent18366cbe9785f53a478db528ed8b6d749d9d7928 (diff)
downloadbcm5719-llvm-acedf7768f6416de4c753184fe11582b805ca61a.tar.gz
bcm5719-llvm-acedf7768f6416de4c753184fe11582b805ca61a.zip
Preserve address space information through member accesses, e.g.,
__attribute__((address_space(1))) struct {int arr[ 3 ]; } *p1; ... = p1->arr[2]; // load from address space 1 llvm-svn: 76717
Diffstat (limited to 'clang/lib/CodeGen/CGValue.h')
-rw-r--r--clang/lib/CodeGen/CGValue.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h
index 820e1bd6c3e..9e937085a98 100644
--- a/clang/lib/CodeGen/CGValue.h
+++ b/clang/lib/CodeGen/CGValue.h
@@ -163,7 +163,8 @@ class LValue {
// objective-c's gc attributes
unsigned ObjCType : 2;
-
+ // address space
+ unsigned AddressSpace;
private:
static void SetQualifiers(unsigned Qualifiers, LValue& R) {
@@ -195,7 +196,9 @@ public:
bool isGlobalObjCRef() const { return GlobalObjCRef; }
bool isObjCWeak() const { return ObjCType == Weak; }
bool isObjCStrong() const { return ObjCType == Strong; }
-
+
+ unsigned getAddressSpace() const { return AddressSpace; }
+
static void SetObjCIvar(LValue& R, bool iValue) {
R.Ivar = iValue;
}
@@ -254,11 +257,13 @@ public:
}
static LValue MakeAddr(llvm::Value *V, unsigned Qualifiers,
- QualType::GCAttrTypes GCAttrs = QualType::GCNone) {
+ QualType::GCAttrTypes GCAttrs = QualType::GCNone,
+ unsigned AddressSpace = 0) {
LValue R;
R.LVType = Simple;
R.V = V;
SetQualifiers(Qualifiers,R);
+ R.AddressSpace = AddressSpace;
SetObjCType(GCAttrs, R);
return R;
}
OpenPOWER on IntegriCloud