Changes from Git (git http://labmaster3.local/git/llvm-project.git)


  1. Add -fgnuc-version= to control __GNUC__ and other GCC macros (details)
  2. Fix __builtin_assume_aligned with too large values. (details)
Commit 5e866e411caad4c4e17e7e0c67b06d28451e1bf2 by rnk
Add -fgnuc-version= to control __GNUC__ and other GCC macros
I noticed that compiling on Windows with -fno-ms-compatibility had the
side effect of defining __GNUC__, along with __GNUG__, __GXX_RTTI__, and
a number of other macros for GCC compatibility. This is undesirable and
causes Chromium to do things like mix __attribute__ and __declspec,
which doesn't work. We should have a positive language option to enable
GCC compatibility features so that we can experiment with
-fno-ms-compatibility on Windows. This change adds -fgnuc-version= to be
that option.
My issue aside, users have, for a long time, reported that __GNUC__
doesn't match their expectations in one way or another. We have
encouraged users to migrate code away from this macro, but new code
continues to be written assuming a GCC-only environment. There's really
nothing we can do to stop that. By adding this flag, we can allow them
to choose their own adventure with __GNUC__.
This overlaps a bit with the "GNUMode" language option from -std=gnu*.
The gnu language mode tends to enable non-conforming behaviors that we'd
rather not enable by default, but the we want to set things like
__GXX_RTTI__ by default, so I've kept these separate.
Helps address PR42817
Reviewed By: hans, nickdesaulniers, MaskRay
Differential Revision: https://reviews.llvm.org/D68055
llvm-svn: 374449
The file was modifiedclang/test/Driver/rewrite-objc.m
The file was modifiedclang/test/Preprocessor/init.c
The file was modifiedclang/docs/UsersManual.rst
The file was modifiedclang/test/Driver/rewrite-legacy-objc.m
The file was modifiedclang/test/Frontend/gnu-inline.c
The file was modifiedclang/lib/Frontend/InitPreprocessor.cpp
The file was modifiedclang/test/Sema/atomic-ops.c
The file was modifiedclang/docs/ReleaseNotes.rst
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/include/clang/Driver/Options.td
The file was addedclang/test/Driver/fgnuc-version.c
The file was modifiedclang/test/Headers/stdbool.cpp
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/include/clang/Basic/LangOptions.def
Commit 31e454c1ecac59273b4864990c8368c3e3fd16b6 by erich.keane
Fix __builtin_assume_aligned with too large values.
Code to handle __builtin_assume_aligned was allowing larger values, but
would convert this to unsigned along the way. This patch removes the
EmitAssumeAligned overloads that take unsigned to do away with this
Additionally, it adds a warning that values greater than 1 <<29 are
ignored by LLVM.
Differential Revision: https://reviews.llvm.org/D68824
llvm-svn: 374450
The file was modifiedclang/lib/CodeGen/CGCall.cpp
The file was modifiedclang/lib/CodeGen/CodeGenFunction.h
The file was modifiedclang/lib/Sema/SemaChecking.cpp
The file was modifiedclang/lib/CodeGen/CGStmtOpenMP.cpp
The file was modifiedclang/test/Sema/builtin-assume-aligned.c
The file was modifiedclang/lib/CodeGen/CodeGenFunction.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp
The file was modifiedclang/lib/CodeGen/CGExprScalar.cpp