aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGValue.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-08-21 02:53:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-08-21 02:53:44 +0000
commit5cf8bfec711116b3c4acc70a00717b2e119e7550 (patch)
tree622f0ab026bebba8869d2a40e651af8ce79f58bf /lib/CodeGen/CGValue.h
parentf52697a589c1fdd0ff101c472b904d4546e1d373 (diff)
IRgen: Add an LValue::MakeAddr variant which takes a type and uses that to build
the qualifiers. Also, add CodeGenFunction::MakeAddrLValue() helper function which passes in the ASTContext. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGValue.h')
-rw-r--r--lib/CodeGen/CGValue.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/CGValue.h b/lib/CodeGen/CGValue.h
index a1bd193f9e..8153169c87 100644
--- a/lib/CodeGen/CGValue.h
+++ b/lib/CodeGen/CGValue.h
@@ -15,6 +15,7 @@
#ifndef CLANG_CODEGEN_CGVALUE_H
#define CLANG_CODEGEN_CGVALUE_H
+#include "clang/AST/ASTContext.h"
#include "clang/AST/Type.h"
namespace llvm {
@@ -258,6 +259,13 @@ public:
return R;
}
+ static LValue MakeAddr(llvm::Value *V, QualType T, ASTContext &Context) {
+ Qualifiers Quals = Context.getCanonicalType(T).getQualifiers();
+ Quals.setObjCGCAttr(Context.getObjCGCAttrKind(T));
+
+ return MakeAddr(V, Quals);
+ }
+
static LValue MakeVectorElt(llvm::Value *Vec, llvm::Value *Idx,
unsigned CVR) {
LValue R;