llvm-project/clang/lib/Serialization
Alex Lorenz 45b4014711 Recommit r308327 3rd time: Add a warning for missing
'#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files

The second recommit (r309106) was reverted because the "non-default #pragma
pack value chages the alignment of struct or union members in the included file"
warning proved to be too aggressive for external projects like Chromium
(https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit
makes the problematic warning a non-default one, and gives it the
-Wpragma-pack-suspicious-include warning option.

The first recommit (r308441) caused a "non-default #pragma pack value might
change the alignment of struct or union members in the included file" warning
in LLVM itself. This recommit tweaks the added warning to avoid warnings for
#includes that don't have any records that are affected by the non-default
alignment. This tweak avoids the previously emitted warning in LLVM.

Original message:

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

Differential Revision: https://reviews.llvm.org/D35484

llvm-svn: 309386
2017-07-28 14:41:21 +00:00
..
ASTCommon.cpp Add an explicit derived class of FunctionDecl to model deduction guides rather 2017-02-17 20:05:37 +00:00
ASTCommon.h PR29097: add an update record when we instantiate the default member 2016-08-24 21:25:37 +00:00
ASTReader.cpp Recommit r308327 3rd time: Add a warning for missing 2017-07-28 14:41:21 +00:00
ASTReaderDecl.cpp [modules ts] Improve merging of module-private declarations. 2017-07-05 07:47:11 +00:00
ASTReaderInternals.h Remove move constructors that are identical to the generated default move ctor. 2016-10-21 18:55:07 +00:00
ASTReaderStmt.cpp [OPENMP] Codegen for 'in_reduction' clause. 2017-07-27 13:20:36 +00:00
ASTWriter.cpp Recommit r308327 3rd time: Add a warning for missing 2017-07-28 14:41:21 +00:00
ASTWriterDecl.cpp [modules ts] Do not emit strong function definitions from the module interface unit in every user. 2017-07-06 00:30:00 +00:00
ASTWriterStmt.cpp [OPENMP] Codegen for 'in_reduction' clause. 2017-07-27 13:20:36 +00:00
CMakeLists.txt Introduce module file extensions to piggy-back data onto module files. 2015-11-03 18:33:07 +00:00
GeneratePCH.cpp Apply clang-tidy's performance-unnecessary-value-param to parts of clang. 2017-03-21 21:35:04 +00:00
GlobalModuleIndex.cpp Modules: Use hash of PCM content for SIGNATURE 2017-03-13 18:45:08 +00:00
Module.cpp Modules: Simplify the ModuleFile constructor; likely NFC 2017-01-29 00:39:09 +00:00
ModuleFileExtension.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
ModuleManager.cpp Spelling mistakes in comments. NFCI. (PR27635) 2017-03-30 14:13:19 +00:00
MultiOnDiskHashTable.h [NFC] Header cleanup 2016-07-18 19:02:11 +00:00