Граф коммитов

23095 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 7025d2cc32 Add -fno-modules to the driver, to turn off modules (although they're off by default anyway).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147449 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 17:13:05 +00:00
Douglas Gregor 752c74d99b Add a "Modules" language option, which subsumes the previous
"AutoModuleImport" preprocessor option and is tied to -fmodules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147448 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 17:07:34 +00:00
Douglas Gregor c514a8a0ea Rename the command-line option for mapping #include/#import over to
module imports from -fauto-module-import to -fmodules. The new name
will eventually be used to enable modules, and the #include/#import
mapping is a crucial part of the feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147447 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 15:21:29 +00:00
Rafael Espindola 0257b7fbbe Process attributes in explicit template instatiation definitions. Fixes PR11690.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147441 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 06:04:21 +00:00
Chandler Carruth ba9186c6fc Teach the frontend to provide the builtin preprocessor defines for
-ffast-math.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147440 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 02:46:46 +00:00
Richard Smith a2d8669b09 Add assertion to char32_t that the value is valid, as suggested by Jordy Rose.
Add a test that such characters don't make it through to StringLiteral objects
in error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147438 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-02 18:14:06 +00:00
Douglas Gregor d07cc36c71 Diagnose cases where the definition of a particular type is required,
is known (to Clang), but is not visible because the module has not yet
been imported.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147436 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-02 17:18:37 +00:00
Chandler Carruth abf07a7fb6 Fix PR11685 by implementing -ffast-math and its various friends in the
Clang driver. This involves a bunch of silly option parsing code to try
to carefully emulate GCC's options. Currently, this takes a conservative
approach, and unless all of the unsafe optimizations are enabled, none
of them are. The fine grained control doesn't seem particularly useful.
If it ever becomes useful, we can add that to LLVM first, and then
expose it here.

This also fixes a few tiny bugs in the flag management around
-fhonor-infinities and -fhonor-nans; the flags now form proper sets both
for enabling and disabling, with the last flag winning.

I've also implemented a moderately terrifying GCC feature where
a language change is also provided by the '-ffast-math' flag by defining
the __FAST_MATH__ preprocessor macro. This feature is tracked and
serialized in the frontend but it isn't used yet. A subsequent patch
will add the preprocessor macro and tests for it.

I've manually tested that codegen appears to respect this, but I've not
dug in enough to see if there is an easy way to test codegen options w/o
relying on the particulars of LLVM's optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147434 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-02 14:19:45 +00:00
Abramo Bagnara 1e8a0678df Added a missing case for -Wdisabled-macro-expansion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147433 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-02 10:08:26 +00:00
Rafael Espindola b5d763d87c Small cosmetic cleanups in code I will change anyway.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147424 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-02 06:26:22 +00:00
Douglas Gregor a28cb3ee88 Eliminate ObjCProtocolDecl's end-of-definition location. It is not
used anywhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147422 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-02 02:22:52 +00:00
Douglas Gregor 61cc296de6 Fix canonicalization of protocol-qualified types
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147421 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-02 02:00:30 +00:00
Douglas Gregor ec1a58b201 Move ObjCProtocolDecl::EndLoc into its DefinitionData, and give
ObjCProtocolDecl proper source-range information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147420 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-02 01:18:16 +00:00
Douglas Gregor c9d3c7edb5 Eliminate the ForwardDecl/InitiallyForwardDecl bits from ObjCProtocolDecl. They are no longer needed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147419 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 22:06:18 +00:00
Abramo Bagnara 163ada8a0f Added -Wdisabled-macro-expansion warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147418 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 22:01:04 +00:00
Douglas Gregor dba9361891 Implement declaration merging for Objective-C protocols across
multiple, disjoint modules. There is far too much duplicating with the
ObjCInterfaceDecl case here, which I'll eliminate shortly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147417 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 21:47:52 +00:00
Douglas Gregor 49310ba7dc Eliminate redundant, empty function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147416 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 21:39:12 +00:00
Douglas Gregor bd9482d859 Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147415 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 21:23:57 +00:00
Douglas Gregor a6387f3b44 Don't bother rewriting an Objective-C class or protocol declaration to the module file when we've merely added a definition
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147414 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 20:35:33 +00:00
Douglas Gregor 3937f87e53 Eliminate ASTMutationListener::UpdatedAttributeList, which is no
longer needed now that we aren't back-patching ObjCProtocolDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147413 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 20:33:24 +00:00
Douglas Gregor 27c6da284f Wire up redeclaration chains for Objective-C protocols, so that both
forward declarations and definitions of an Objective-C protocol are
represented within a single chain of ObjCProtocolDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147412 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 20:30:41 +00:00
Douglas Gregor 1d784b277c Introduce the core infrastructure needed to model redeclaration chains
for Objective-C protocols, including:
  - Using the first declaration as the canonical declaration
  - Using the definition as the primary DeclContext
  - Making sure that all declarations have a pointer to the definition
  data, and that we know which declaration is the definition
  - Serialization support for redeclaration chains and for adding
  definitions to already-serialized declarations.

However, note that we're not taking advantage of much of this code
yet, because we're still re-using ObjCProtocolDecls.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147410 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 19:51:50 +00:00
Douglas Gregor 5e2a1ff9f2 Move the data that corresponds to the definition of a protocol into a
separately-allocated DefinitionData structure. Introduce various
functions that will help with the separation of declarations from
definitions (isThisDeclarationADefinition(), hasDefinition(),
getDefinition()).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147408 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 19:29:29 +00:00
Rafael Espindola 27b7ce6199 Use hasSameType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147407 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 18:36:59 +00:00
Douglas Gregor 3fc73ee0c6 Use declaresSameEntity() when comparing ObjCProtocolDecls, and
getCanonicalDecl() when putting ObjCProtocolDecls into a set. This is
groundwork for making ObjCProtocolDecl redeclarable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147406 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 18:09:12 +00:00
Rafael Espindola 71cb8a2e10 Consider visibility attributes in namespaces as being explicit. I.e., they
take precedence over command line options. Fixes PR10113.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147405 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 18:06:40 +00:00
Rafael Espindola 6f26b5eeb4 Replace a isa+cast with a dyn_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147401 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 17:48:19 +00:00
Douglas Gregor 51f564f80d Implement support for module requirements, which indicate the language
features needed for a particular module to be available. This allows
mixed-language modules, where certain headers only work under some
language variants (e.g., in C++, std.tuple might only be available in
C++11 mode).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147387 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-31 04:05:44 +00:00
Richard Smith 4debc82d9d Fix crash when trying to pretty-print unicode or wide string literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147385 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 23:37:31 +00:00
Richard Smith 5120188238 Unrevert r147271, reverted in r147361.
Also temporarily remove the assumption from IR gen that we can emit IR for every
constant we can fold, since it isn't currently true in C++11, to fix PR11676.

Original comment from r147271:

constexpr: perform zero-initialization prior to / instead of performing a
constructor call when appropriate. Thanks to Eli for spotting this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147384 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 21:15:51 +00:00
NAKAMURA Takumi 5c76db3a4c clang/lib/Headers/CMakeLists.txt: Unbreak cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147373 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 10:38:16 +00:00
Craig Topper 7feb321af4 Add FMA4 intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147372 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 09:15:03 +00:00
Craig Topper f9322a6708 Remove an accidental change from r147370. Would only break if the new fma4 flag was used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147371 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 07:35:49 +00:00
Craig Topper 6a511e1407 Add FMA4 feature flag. Intrinsics coming soon. Also make sse4a feature flag imply sse3. Matches gcc behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 07:33:42 +00:00
Rafael Espindola f8c2a33b6e Revert r147271. This fixes PR11676.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147362 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 03:11:50 +00:00
Richard Smith d7c56e1114 Change the diagnostics which said 'accepted as an extension' to instead say
'is an extension'. The former is inappropriate and confusing when building with
-Werror/-pedantic-errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147357 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 21:57:33 +00:00
Richard Smith 0945f20f1c Unbreak cmake build after r147340.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147355 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 21:42:29 +00:00
Craig Topper e14e08b255 Add popcnt feature flag to match gcc. This flag is implied when sse42 is enabled, but can be disabled separately. Move popcnt intrinsics to popcntintrin.h to match gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147340 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 16:10:46 +00:00
Rafael Espindola 63d32bdf89 Fix cmake build with -DBUILD_SHARED_LIBS=ON.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147338 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 04:31:59 +00:00
DeLesley Hutchins df49782c54 Support for thread safety attributes on functions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147331 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 00:56:48 +00:00
Richard Smith 80d4b55db9 Small refactoring and simplification of constant evaluation and some of its
clients. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147318 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-28 19:48:30 +00:00
Rafael Espindola 0e743b1582 Handle a /etc/debian_version with a version number instead of a codename.
Patch by Sylvestre Ledru. Fixes PR11673.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147313 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-28 18:17:14 +00:00
Benjamin Kramer b406669fea Add a target hook for FLT_EVAL_METHOD and use it to set the value on x86 with sse disabled.
x87 math evaluates everything with 80 bits precision, so we have to set FLT_EVAL_METHOD
to "2".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147311 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-28 15:47:06 +00:00
Hans Wennborg 5294c792c7 Support the 'a' scanf length modifier as an extension in C++.
It should not be supported in C++11, since that uses the C99 standard
library, in which 'a' is a format specifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147310 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-28 13:10:50 +00:00
Zhongxing Xu 72b20ff76a Enable the user to control whether CXXConstructExpr will be added as a
block-level expr. Currently CXXConstructExpr is always added as a block-level
expr. This caused two problems for the analyzer (and potentially for the
CFG-based codegen).
1. We have no way to know whether a ctor call is base or complete.
2. We have no way to know the destination object being contructed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147306 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-28 04:38:46 +00:00
Douglas Gregor 375bb1413c Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147299 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-27 22:43:10 +00:00
Rafael Espindola fedb6ecbed Fix the visibility of methods of explicit template instantiation definition
when using -fvisibility-inlines-hidden. This matches gcc's behavior and
documentation.

Fixes PR11642.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147295 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-27 21:15:28 +00:00
Richard Smith 47d2145675 constexpr: support for evaluation and codegen of typeid constants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147290 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-27 12:18:28 +00:00
Benjamin Kramer 4a08268a69 Initialize member that ends up in PCH files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147288 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-27 11:15:04 +00:00
Eli Friedman fb8c56d604 Partially revert r147195; lib/Basic/Version.cpp conditionally depends on config.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147282 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 22:43:17 +00:00
Rafael Espindola 5df37bd024 Delay checking of typedefs of dependent types. Fixes PR11630.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147281 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 22:42:47 +00:00
Benjamin Kramer a11d309862 Fix potential use after free.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147277 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 14:18:37 +00:00
NAKAMURA Takumi b5409c5bbf clang/lib/Headers/CMakeLists.txt: Unbreak cmake build to add bmi2intrin.h since r147275.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147276 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 03:20:06 +00:00
Craig Topper f58f3647b1 Add BMI2 intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147275 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 02:31:10 +00:00
Richard Smith dd4b350143 Fix constexpr handling to allow 'extern constexpr' variable declarations. We no
longer have access to the source locations we need to produce the
'replace constexpr with const' fixits, so they're gone for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147273 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 21:17:58 +00:00
Richard Smith eba05b2e39 constexpr: perform zero-initialization prior to / instead of performing a
constructor call when appropriate. Thanks to Eli for spotting this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 20:00:17 +00:00
NAKAMURA Takumi 6ab9f02ca0 lib/Headers/CMakeLists.txt: Fix cmake build since r147263, for two missing headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147266 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 12:47:46 +00:00
Craig Topper 0b269c1f36 Add the rest of the BMI intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147265 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 07:27:12 +00:00
Craig Topper 5c75208a5b Add intrinsics for lzcnt and tzcnt instructions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147263 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 06:25:37 +00:00
Craig Topper 31ceea0965 Add BMI, BMI2, and LZCNT feature flags to enable adding intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147262 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 05:06:45 +00:00
Rafael Espindola 8d2a701734 Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147260 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 01:18:52 +00:00
Richard Smith b701d3d0b2 Always implicitly declare move assignment operations for dynamic classes, in
case they override virtual functions from a base class. Also fix -print-stats
counting of move assignment/construction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147258 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 21:56:24 +00:00
Craig Topper 5cbd751a2f Add last of the AVX2 intrinsics except for gather.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147253 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 17:20:15 +00:00
Craig Topper 34a1da4354 Add AVX2 permute intrinsics. Also add parentheses on some macro arguments in other intrinsic headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147241 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 07:55:14 +00:00
Craig Topper ee9b41d154 Add AVX2 intrinsics for FP vbroadcast, vbroadcasti128, and vpblendd.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147239 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 05:19:29 +00:00
Craig Topper 7f16caa3c0 Intrinsics for AVX2 unpack instructions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147237 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 03:58:43 +00:00
Craig Topper cbe627b54e More AVX2 intrinsics for shift, psign, some shuffles, and psadbw.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147236 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 03:28:57 +00:00
Nico Weber ff91d240d4 Fix several issues related to specializations and explicit instantiations.
Explicit instantiations following specializations are no-ops and hence have
no PointOfInstantiation. That was done correctly in most cases, but for a
specialization -> instantiation decl -> instantiation definition chain, the
definition didn't realize that it was a no-op. Fix that.

Also, when printing diagnostics for these no-ops, get the diag location from
the decl name location.

Add many test cases, one of them not yet passing (but it failed the same way
before this change). Fixes http://llvm.org/pr11558 and more.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147225 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 20:58:04 +00:00
Anton Yartsev 17ba267cae fix for PR11634
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147224 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 20:23:19 +00:00
Benjamin Kramer 430cf51d4a Give C11's __STDC_VERSION__ the final value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147222 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 17:00:41 +00:00
Benjamin Kramer ffbe9b9c64 Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" so this patch is surprisingly small.
Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147221 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 17:00:35 +00:00
Craig Topper 28a324a30b Add AVX2 multiply intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147219 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 08:31:16 +00:00
Dylan Noblesmith 8fdb6dee2d Let CompilerInvocation initialization indicate failure
This fixes the FIXMEs in ParseAnalyzeArgs. (Also a
precursor to moving the analyzer into an AST plugin.)

For consistency, do the same with AssemblerInvocation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147218 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 03:05:38 +00:00
Argyrios Kyrtzidis 9241057266 Pass context and access to Parser::ParseExplicitInstantiation() for
good parser error recovery and for not crashing.

We still have a accepts-invalid-code bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147216 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 02:16:45 +00:00
Fariborz Jahanian 712ef87453 objective-c: Use class definition AST in several situations when
building related objc ASTs which require a class definition AST.
These were uncovered when testing objc rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147210 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 00:31:02 +00:00
Douglas Gregor 224bfeeaf0 Remove spurious, but now legal, typename
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147208 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 00:27:08 +00:00
Douglas Gregor 585ec93e1b When building a module with an umbrella header, warn about any headers
found within that umbrella directory that were not actually included
by the umbrella header. They should either be referenced in the module
map or included by the umbrella header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147207 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 00:23:59 +00:00
Ted Kremenek 682060c5d9 Colorize and condense CFG pretty-printing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147203 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 23:33:52 +00:00
Nico Weber 5cb94a7820 Add -Wdangling-else.
This works like described in  http://drdobbs.com/blogs/cpp/231602010
Fixes http://llvm.org/PR11609



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147202 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 23:26:17 +00:00
Dylan Noblesmith 1770e0dadc remove unneeded config.h includes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147195 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 22:49:47 +00:00
Douglas Gregor bf1739c10a Make a note for an optimization that I'd like to implement, when the ASTs for local externs are sound
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147185 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 22:05:07 +00:00
Douglas Gregor c3cfd2ab33 Serialize the AST reader's mapping from canonical declarations to the
set of (previously-canonical) declaration IDs to the module file, so
that future AST reader instances that load the module know which
declarations are merged. This is important in the fairly tricky case
where a declaration of an entity, e.g.,

  @class X;

occurs before the import of a module that also declares that
entity. We merge the declarations, and record the fact that the
declaration of X loaded from the module was merged into the (now
canonical) declaration of X that we parsed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147181 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 21:40:42 +00:00
Nick Lewycky b0c6c33c34 Fix build under -Wswitch by adding support for FK_ListConstructorOverloadFailed
to initialization sequence dumping.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 20:21:32 +00:00
Douglas Gregor cce54aa6a4 If we end up merging an Objective-C class with an existing Objective-C
class that comes from a different module file, make sure that we load
all of the pending declarations for the original declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 19:44:59 +00:00
Kevin Enderby 567003e572 Last part of support for generating dwarf for assembly source files. This gets
the clang driver to enable this when assembling a .s file.  rdar://9275556


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 19:31:58 +00:00
Sebastian Redl cf15cef844 Overloading for initializer list construction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147156 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 18:58:38 +00:00
Sebastian Redl 62f13c9e9e Fix a parser bug that prevented it from correctly parsing explicit construct expressoins of the form T{args}.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147155 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 18:58:29 +00:00
Sebastian Redl 10f04a6267 List-initialization via constructor part 1. Still needs: pretty-printing, overloading, initializer_list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147145 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 14:44:04 +00:00
Craig Topper 231f793326 Add AVX2 intrinsics for max, min, sign extend, and zero extend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147141 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 09:18:58 +00:00
Ted Kremenek b7dcddf182 Fix typos in analyzer diagnostics pointed out by Matt Beaumont-Gay and Robert Purves.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147139 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 06:35:52 +00:00
Argyrios Kyrtzidis 04a94bcc56 In Lexer::getCharAndSizeSlow[NoWarn] if we come up against
\<newline><newline>

don't consume the second newline.

Thanks to David Blaikie for pointing out the crash!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147138 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 04:38:07 +00:00
Eli Friedman e6a24e83e7 Add support for bitcasts to vector type in Evaluate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147137 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 03:51:45 +00:00
Richard Smith 6180245e9f PR11614: Mark defaulted special constructors as constexpr if their implicit
definition would satisfy the constexpr requirements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147128 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 02:22:31 +00:00
Douglas Gregor 0f75323264 When deserializing an Objective-C class, check whether we have another
declaration of that same class that either came from some other module
or occurred in the translation unit loading the module. In this case,
we need to merge the two redeclaration chains immediately so that all
such declarations have the same canonical declaration in the resulting
AST (even though they don't in the module files we've imported).

Focusing on Objective-C classes until I'm happy with the design, then
I'll both (1) extend this notion to other kinds of declarations, and
(2) optimize away this extra checking when we're not dealing with
modules. For now, doing this checking for PCH files/preambles gives us
better testing coverage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147123 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 01:48:48 +00:00
Ted Kremenek 15ce164836 Enhance AnalysisDeclContext::getReferencedBlockVars() to understand PseudoObjExprs. It turns out
that the information collected by this method is a super set of the captured variables in BlockDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147122 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 01:30:46 +00:00
Richard Smith 974c5f93d0 PR11637: implement special-case constant evaluation for char arrays initialized
by string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147120 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 01:07:19 +00:00
Ted Kremenek 280cf1451b Fix regression in LiveVariables when reasoning about variables captured by blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147116 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 00:46:32 +00:00
Eli Friedman 58c65fcb90 Fix a failure (which led to a crash) in constant emission code with vector compound literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147111 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 00:04:00 +00:00
Argyrios Kyrtzidis f132dcaae8 In Lexer::getCharAndSizeSlow[NoWarn] make sure we don't go over the end of the buffer
when the end of the buffer is immediately after an escaped newline.

Fixes http://llvm.org/PR10153.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147091 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 20:19:55 +00:00
Fariborz Jahanian 97bbab2df7 objc, objc rewriter. Fixes couple of bugs one
because of recent refactoring and one in the
rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147070 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 19:48:07 +00:00
Ted Kremenek 3b7a48fbc6 Improve CFG pretty-printing for CXXConstructExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 19:39:59 +00:00
Matt Beaumont-Gay aa5d533427 Cast enumerators from different anonymous enums to unsigned, to appease gcc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147067 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 19:36:37 +00:00
Ted Kremenek 893d414534 Improve CFG pretty-printing of CastExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147066 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 19:32:38 +00:00
Argyrios Kyrtzidis cee5ec9df4 Fix bugs in SourceManager::computeMacroArgsCache() and add a unit test for it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147057 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 16:56:35 +00:00
Argyrios Kyrtzidis d7711ec430 For SourceManager::isBeforeInTranslationUnit(), have it consider macro arg expanded
token locations as coming before the closing ')' of a function macro expansion.

Include a unit test for SourceManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147056 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 16:56:29 +00:00
Douglas Gregor 87dd4f7f43 Implement a trivial, obvious optimization for deserialization of
redeclaration chains: only ever have the reader search for
redeclarations of the first (canonical) declaration, since we only
ever record redeclaration ranges for the that declaration. Searching
for redeclarations of non-canonical declarations will never find
anything, so it's a complete waste of time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147055 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 15:12:03 +00:00
Craig Topper 4a4f25a5a8 Add a few more AVX2 intrinsics and fix the type strings on a couple SSE intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147048 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 08:35:05 +00:00
Craig Topper 318e460ada Add AVX2 horizontal add/sub intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 08:17:40 +00:00
Richard Smith 7098cbd601 constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in
constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147035 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 05:04:46 +00:00
Nick Lewycky 9bddf4324a Bump suitable alignment on darwin ppc 32/64 and x86-32 to 16 bytes. I don't
actually know about the other OSes on X86-32 besides Linux...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147034 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 04:25:47 +00:00
Richard Smith 1d238ea926 C++11 half of r147023: In C++11, additionally eagerly instantiate:
- constexpr function template instantiations
 - variables of reference type
 - constexpr variables


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147031 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 02:55:12 +00:00
Eli Friedman 6bd9719fd9 Fix a case where Expr::isConstantInitializer would return true for an expression we can't support. In a slightly amusing twist, the case in question was already in the clang regression tests marked as a valid construct. <rdar://problem/10020074>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147026 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 00:43:02 +00:00
Richard Smith 3e9ea0b8cd C++ constant expression handling: eagerly instantiate static const integral data
members of class templates so that their values can be used in ICEs. This
required reverting r105465, to get such instantiated members to be included in
serialized ASTs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147023 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 00:25:33 +00:00
Fariborz Jahanian 28441e6cee objc QOI: Don't't warn about mismatch between attributes
on method declaration and definition if former is in
a system header. // rdar://10580333


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147020 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 00:09:11 +00:00
Richard Smith a44854a23b PR11297: Provide a better diagnostic for code which contains a
reasonable-looking but ill-formed for-range statement of the form:

  for (expression : expression)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147006 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 22:56:20 +00:00
Anna Zaks 2cbe791d3e [analyzer] Do not invalidate arguments when the parameter's
type is a pointer to const. (radar://10595327)

The regions corresponding to the pointer and reference arguments to
a function get invalidated by the calls since a function call can
possibly modify the pointed to data. With this change, we are not going
to invalidate the data if the argument is a pointer to const. This
change makes the analyzer more optimistic in reporting errors.
(Support for C, C++ and Obj C)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147002 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 22:35:30 +00:00
Fariborz Jahanian b5ea9db3cf objc/c++: Issue diagnostic when free-standing ivar is accessed
in class method instead of crash. // rdar://10593227


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146998 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 22:21:08 +00:00
Douglas Gregor 1d4c1137c3 When we make a previously-deserialized module definition visible,
notify the AST deserialization listener so that the AST writer knows
that it can write the macro definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146994 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 22:06:13 +00:00
Ted Kremenek 6ae325737c Fix inversion of static analyzer path diagnostics for path conditions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146993 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 22:00:25 +00:00
Nico Weber c7feca0392 Fix a crash on invalid, http://llvm.org/pr11599
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146988 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 20:32:49 +00:00
Douglas Gregor 2ccd89cff3 When performing name lookup for a redeclaration, ignore module
visibility restrictions. This ensures that all declarations of the
same entity end up in the same redeclaration chain, even if some of
those declarations aren't visible. While this may seem unfortunate to
some---why can't two C modules have different functions named
'f'?---it's an acknowedgment that a module does not introduce a new
"namespace" of names.

As part of this, stop merging the 'module-private' bit from previous
declarations to later declarations, because we want each declaration
in a module to stand on its own because this can effect, for example,
submodule visibility.

Note that this notion of names that are invisible to normal name
lookup but are available for redeclaration lookups is how we should
implement friend declarations and extern declarations within local
function scopes. I'm not tackling that problem now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146980 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 18:11:52 +00:00
Douglas Gregor e7aa27a826 When performing layout for an Objective-C class, make sure to dig out
the definition of that class. Fixes PR11613 / <rdar://problem/10604077>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146976 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 15:50:13 +00:00
Craig Topper 4c07c5dfeb Add AVX2 intrinsics for pavg, pblend, and pcmp instructions. Also remove unneeded builtins for SSE pcmp. Change SSE pcmpeqq and pcmpgtq to not use builtins and just use vector == and >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 09:55:26 +00:00
Chandler Carruth 3ff53b3587 Update the CMake build for r146959's new files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 08:42:15 +00:00
Richard Smith 2fbf373a56 Fix off-by-one error in an assert condition. No functionality change, but better
error detection.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146962 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 04:39:57 +00:00
Richard Smith b6f8d28411 Revert r146766, and add a testcase for which it introduced a wrong-code bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146961 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 04:00:21 +00:00
David Blaikie 99ba9e3bd7 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 02:48:34 +00:00
Richard Smith f6702a3927 Unlike in C++03, a constant-expression is not an unevaluated operand in C++11.
Split out a new ExpressionEvaluationContext flag for this case, and don't treat
it as unevaluated in C++11. This fixes some crash-on-invalids where we would
allow references to class members in potentially-evaluated constant expressions
in static member functions, and also fixes half of PR10177.

The fix to PR10177 exposed a case where template instantiation failed to provide
a source location for a diagnostic, so TreeTransform has been tweaked to supply
source locations when transforming a type. The source location is still not very
good, but MarkDeclarationsReferencedInType would need to operate on a TypeLoc to
improve it further.

Also fix MarkDeclarationReferenced in C++98 mode to trigger instantiation for
static data members of class templates which are used in constant expressions.
This fixes a link-time problem, but we still incorrectly treat the member as
non-constant. The rest of the fix for that issue is blocked on PCH support for
early-instantiated static data members, which will be added in a subsequent
patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146955 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 02:08:33 +00:00
Eli Friedman 9490ab433d Fix tentative parsing so it knows how to handle an ambiguous for-range-declaration. PR11601.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 01:50:37 +00:00
Ted Kremenek d9d12e0c0b Refine error diagnostic for using bridged casts when not using ARC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146938 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 01:03:40 +00:00
Douglas Gregor 305dc3ebaa Detect when mapping a #include/#import over to a submodule ends up
hitting a submodule that was never actually created, e.g., because
that header wasn't parsed. In such cases, complain (because the
module's umbrella headers don't cover everything) and fall back to
including the header.

Later, we'll add a warning at module-build time to catch all such
cases. However, this fallback is important to eliminate assertions in
the ASTWriter when this happens.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146933 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 00:28:52 +00:00
Bill Wendling 6446c3e360 Mark the calls to the _setjmp function as returns twice. <rdar://problem/10492556>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 23:53:28 +00:00
Eli Friedman d71f44266a Switch a few callers of MakeAddrLValue places over to MakeNaturalAlignAddrLValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146920 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 23:03:09 +00:00
Fariborz Jahanian e2eb0e9973 objc-arc: bridge casts in non-arc mode are now
error. // rdar://10597832


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146918 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 22:52:53 +00:00
Richard Smith bc6abe93a5 Evaluation support for ExprWithCleanups. We won't evaluate any expression which
actually requires non-trivial cleanups, so no cleanups need to be performed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146916 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 22:12:41 +00:00
Richard Smith af2c7a1945 Improve r146813 (for PR11595) to give an appropriate diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146915 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 22:01:37 +00:00
Chris Lattner 4cac9e169b Fix PR5279 - don't sliently drop alignment information on stores of types that have alignment less than the natural alignment of the type when it comes from a typedef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146908 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 21:16:08 +00:00
Douglas Gregor a126651270 Eliminate the first->last redeclaration map from the AST file
format. It's no longer being used, now that we have a new
implementation of redeclaration chains.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146905 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 21:09:25 +00:00
Fariborz Jahanian 00852e4126 objc-arc: bridge casts in non-objc-arc mode are ignord.
But, warn too. // rdar://10597832


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146904 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 21:06:15 +00:00
Douglas Gregor 21cf08b7e0 Remove ASTReader's PendingForwardRefs, which is now handled by the
(more general) fix-up of definition data pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146903 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 20:51:16 +00:00
Douglas Gregor fc529f7fca Once we have fully deserialized a redeclaration chain for something
with a definition pointer (e.g., C++ and Objective-C classes), zip
through the redeclaration chain to make sure that all of the
declarations point to the definition data. 

As part of this, realized again why the first redeclaration of an
entity in a file is important, and brought back that idea.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146886 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 19:00:47 +00:00
Douglas Gregor f63b0a5f54 Re-implement (de-)serialization of redeclaration chains for
redeclaration templates (RedeclarableTemplateDecl), similarly to the
way (de-)serialization is implemented for Redeclarable<T>. In the
process, found a simpler formulation for handling redeclaration
chains and implemented that in both places.

The new test establishes that we're building the redeclaration chains
properly. However, the FIXME indicates where we're tickling a
different bug that has to do with us not setting the DefinitionData
pointer properly in redeclarations that we detected after the
definition itself was deserialized. The (separable) fix for that bug
is forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146883 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 18:19:24 +00:00
Douglas Gregor adafc2edc0 The submodule offset map can introduce "empty" remapping entries for
imported modules that don't introduce any new entities of a particular
kind. Allow these entries to be replaced with entries for another
loaded module.

In the included test case, selectors exhibit this behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146870 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 16:14:14 +00:00
Douglas Gregor ecb19382e1 Optimize serialized representation of redeclarable declarations for
which there are no redeclarations. This reduced by size of the PCH
file for Cocoa.h by ~650k: ~536k of that was in the new
LOCAL_REDECLARATIONS table, which went from a ridiculous 540k down to
an acceptable 3.5k, while the rest was due to the more compact
abbreviated representation of redeclarable declaration kinds (which no
longer need to store the 'first' declaration ID).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146869 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 15:27:36 +00:00
Rafael Espindola bcf6b98247 Extend the fix for PR9614 to handle inline asm in the outer decl and
the inner decl being a builtin. This is needed to support the glibc headers
in fedora 16 (2.14).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146867 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 14:41:01 +00:00
Douglas Gregor 0f45682b46 Combine common (de-)serialization logic for typedefs and type aliases
into operations on TypedefNameDecl. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146866 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 14:40:25 +00:00
Craig Topper 735ceaa4cc Add AVX2 intrinsics for and, andn, or, and xor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146862 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 09:03:48 +00:00
Dylan Noblesmith 098eaffc0c SourceManager: use getBufferSize()
Forming an out of bounds pointer to check if it's out
of bounds was undefined behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146861 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 08:51:05 +00:00
Craig Topper 9c2ffd803a More AVX2 intrinsic support including saturating add/sub and palignr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146857 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 07:03:25 +00:00
Richard Smith 099e7f647c constexpr handling improvements. Produce detailed diagnostics when a 'constexpr'
variable is initialized by a non-constant expression, and pass in the variable
being declared so that earlier-initialized fields' values can be used.

Rearrange VarDecl init evaluation to make this possible, and in so doing fix a
long-standing issue in our C++ constant expression handling, where we would
mishandle cases like:

  extern const int a;
  const int n = a;
  const int a = 5;
  int arr[n];

Here, n is not initialized by a constant expression, so can't be used in an ICE,
even though the initialization expression would be an ICE if it appeared later
in the TU. This requires computing whether the initializer is an ICE eagerly,
and saving that information in PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146856 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 06:19:21 +00:00