diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-22 19:43:45 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-22 19:43:45 +0000 |
commit | aa803409c3bd3930126db630c29f63d42f255153 (patch) | |
tree | 042106605c08352895ba4383ef97eae88b6b31aa /lib/AST/ASTContext.cpp | |
parent | 1ce08792766261dcaa25d8215f9d1c2f70d7b7e9 (diff) | |
download | src-test2-aa803409c3bd3930126db630c29f63d42f255153.tar.gz src-test2-aa803409c3bd3930126db630c29f63d42f255153.zip |
Notes
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 3b526a23edd9..29d970e66d71 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -8730,8 +8730,8 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context, char *End; unsigned AddrSpace = strtoul(Str, &End, 10); if (End != Str && AddrSpace != 0) { - Type = Context.getAddrSpaceQualType(Type, AddrSpace + - LangAS::Count); + Type = Context.getAddrSpaceQualType( + Type, AddrSpace + LangAS::FirstTargetAddressSpace); Str = End; } if (c == '*') @@ -9546,13 +9546,8 @@ uint64_t ASTContext::getTargetNullPointerValue(QualType QT) const { } unsigned ASTContext::getTargetAddressSpace(unsigned AS) const { - // For OpenCL, only function local variables are not explicitly marked with - // an address space in the AST, and these need to be the address space of - // alloca. - if (!AS && LangOpts.OpenCL) - return getTargetInfo().getDataLayout().getAllocaAddrSpace(); - if (AS >= LangAS::Count) - return AS - LangAS::Count; + if (AS >= LangAS::FirstTargetAddressSpace) + return AS - LangAS::FirstTargetAddressSpace; else return (*AddrSpaceMap)[AS]; } |