summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGValue.h8
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h
index a1bd193f9e2..8153169c875 100644
--- a/clang/lib/CodeGen/CGValue.h
+++ b/clang/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;
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 6dcf18c3cdf..726b7ed284e 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -975,6 +975,10 @@ public:
return Quals;
}
+ LValue MakeAddrLValue(llvm::Value *V, QualType T) {
+ return LValue::MakeAddr(V, T, getContext());
+ }
+
/// CreateTempAlloca - This creates a alloca and inserts it into the entry
/// block. The caller is responsible for setting an appropriate alignment on
/// the alloca.
OpenPOWER on IntegriCloud