[MSVC Compat] Implementation of __unaligned (MS extension) as a type qualifier

This patch implements __unaligned as a type qualifier; before that, it was
modeled as an attribute. Proper mangling of __unaligned is implemented as well.
Some OpenCL code/tests are tangenially affected, as they relied on existing
number and sizes of type qualifiers.

Differential Revision: http://reviews.llvm.org/D18596

llvm-svn: 266415
This commit is contained in:
Andrey Bokhanko
2016-04-15 08:03:51 +00:00
parent 18e69f4f63
commit f7fa634887
20 changed files with 163 additions and 48 deletions

View File

@@ -3812,6 +3812,9 @@ void Sema::CodeCompleteTypeQualifiers(DeclSpec &DS) {
if (getLangOpts().C11 &&
!(DS.getTypeQualifiers() & DeclSpec::TQ_atomic))
Results.AddResult("_Atomic");
if (getLangOpts().MSVCCompat &&
!(DS.getTypeQualifiers() & DeclSpec::TQ_unaligned))
Results.AddResult("__unaligned");
Results.ExitScope();
HandleCodeCompleteResults(this, CodeCompleter,
Results.getCompletionContext(),