summaryrefslogtreecommitdiffstats
path: root/clang/AST/Builtins.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/AST/Builtins.cpp')
-rw-r--r--clang/AST/Builtins.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/clang/AST/Builtins.cpp b/clang/AST/Builtins.cpp
index 5a470ff9506..137f4eaebbc 100644
--- a/clang/AST/Builtins.cpp
+++ b/clang/AST/Builtins.cpp
@@ -112,10 +112,10 @@ static QualType DecodeTypeFromStr(const char *&Str, ASTContext &Context) {
Type = Context.ShortTy;
break;
case 'i':
- if (Long)
- Type = Unsigned ? Context.UnsignedLongTy : Context.LongTy;
- else if (LongLong)
+ if (LongLong)
Type = Unsigned ? Context.UnsignedLongLongTy : Context.LongLongTy;
+ else if (Long)
+ Type = Unsigned ? Context.UnsignedLongTy : Context.LongTy;
else if (Unsigned)
Type = Context.UnsignedIntTy;
else
@@ -137,10 +137,22 @@ static QualType DecodeTypeFromStr(const char *&Str, ASTContext &Context) {
case 'F':
Type = Context.getCFConstantStringType();
break;
- case 'V':
+ case 'a':
Type = Context.getBuiltinVaListType();
assert(!Type.isNull() && "builtin va list type not initialized!");
break;
+ case 'V': {
+ char *End;
+
+ unsigned NumElements = strtoul(Str, &End, 10);
+ assert(End != Str && "Missing vector size");
+
+ Str = End;
+
+ QualType ElementType = DecodeTypeFromStr(Str, Context);
+ Type = Context.getVectorType(ElementType, NumElements);
+ break;
+ }
}
Done = false;
OpenPOWER on IntegriCloud