]> granicus.if.org Git - clang/log
clang
13 years agoImplement declaration merging for Objective-C protocols across
Douglas Gregor [Sun, 1 Jan 2012 21:47:52 +0000 (21:47 +0000)]
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

13 years agoEliminate redundant, empty function
Douglas Gregor [Sun, 1 Jan 2012 21:39:12 +0000 (21:39 +0000)]
Eliminate redundant, empty function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147416 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate ObjCForwardProtocolDecl, which is redundant now that
Douglas Gregor [Sun, 1 Jan 2012 21:23:57 +0000 (21:23 +0000)]
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

13 years agoDon't bother rewriting an Objective-C class or protocol declaration to the module...
Douglas Gregor [Sun, 1 Jan 2012 20:35:33 +0000 (20:35 +0000)]
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

13 years agoEliminate ASTMutationListener::UpdatedAttributeList, which is no
Douglas Gregor [Sun, 1 Jan 2012 20:33:24 +0000 (20:33 +0000)]
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

13 years agoWire up redeclaration chains for Objective-C protocols, so that both
Douglas Gregor [Sun, 1 Jan 2012 20:30:41 +0000 (20:30 +0000)]
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

13 years agoIntroduce the core infrastructure needed to model redeclaration chains
Douglas Gregor [Sun, 1 Jan 2012 19:51:50 +0000 (19:51 +0000)]
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

13 years agoMove the data that corresponds to the definition of a protocol into a
Douglas Gregor [Sun, 1 Jan 2012 19:29:29 +0000 (19:29 +0000)]
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

13 years agoUse hasSameType.
Rafael Espindola [Sun, 1 Jan 2012 18:36:59 +0000 (18:36 +0000)]
Use hasSameType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147407 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse declaresSameEntity() when comparing ObjCProtocolDecls, and
Douglas Gregor [Sun, 1 Jan 2012 18:09:12 +0000 (18:09 +0000)]
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

13 years agoConsider visibility attributes in namespaces as being explicit. I.e., they
Rafael Espindola [Sun, 1 Jan 2012 18:06:40 +0000 (18:06 +0000)]
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

13 years agoReplace a isa+cast with a dyn_cast.
Rafael Espindola [Sun, 1 Jan 2012 17:48:19 +0000 (17:48 +0000)]
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

13 years agoHappy new year 2012!
NAKAMURA Takumi [Sun, 1 Jan 2012 08:16:56 +0000 (08:16 +0000)]
Happy new year 2012!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147395 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoclang/unittests/Basic/SourceManagerTest.cpp: Fixup corresponding to r147387.
NAKAMURA Takumi [Sat, 31 Dec 2011 04:25:56 +0000 (04:25 +0000)]
clang/unittests/Basic/SourceManagerTest.cpp: Fixup corresponding to r147387.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147388 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement support for module requirements, which indicate the language
Douglas Gregor [Sat, 31 Dec 2011 04:05:44 +0000 (04:05 +0000)]
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

13 years agoSplit out clang/test/Driver/debug-options-as.c from debug-options.c, and mark it...
NAKAMURA Takumi [Sat, 31 Dec 2011 02:36:23 +0000 (02:36 +0000)]
Split out clang/test/Driver/debug-options-as.c from debug-options.c, and mark it as XFAIL: mingw32.

Mingw32 target has not supported integrated-as yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147386 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix crash when trying to pretty-print unicode or wide string literals.
Richard Smith [Fri, 30 Dec 2011 23:37:31 +0000 (23:37 +0000)]
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

13 years agoUnrevert r147271, reverted in r147361.
Richard Smith [Fri, 30 Dec 2011 21:15:51 +0000 (21:15 +0000)]
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

13 years agoAdd CXX_FINAL_ATTR, CXX_OVERRIDE_ATTR, ANNOTATE_ATTR and ASM_LABEL_ATTR to the
Rafael Espindola [Fri, 30 Dec 2011 15:27:22 +0000 (15:27 +0000)]
Add CXX_FINAL_ATTR, CXX_OVERRIDE_ATTR, ANNOTATE_ATTR and ASM_LABEL_ATTR to the
python bindinds.
patch by Tom Schuster!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147378 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoclang/lib/Headers/CMakeLists.txt: Unbreak cmake build.
NAKAMURA Takumi [Fri, 30 Dec 2011 10:38:16 +0000 (10:38 +0000)]
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

13 years agoAdd FMA4 intrinsics.
Craig Topper [Fri, 30 Dec 2011 09:15:03 +0000 (09:15 +0000)]
Add FMA4 intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147372 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove an accidental change from r147370. Would only break if the new fma4 flag was...
Craig Topper [Fri, 30 Dec 2011 07:35:49 +0000 (07:35 +0000)]
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

13 years agoAdd FMA4 feature flag. Intrinsics coming soon. Also make sse4a feature flag imply...
Craig Topper [Fri, 30 Dec 2011 07:33:42 +0000 (07:33 +0000)]
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

13 years agoAdd test for PRr11676.
Rafael Espindola [Fri, 30 Dec 2011 03:13:44 +0000 (03:13 +0000)]
Add test for PRr11676.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147363 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r147271. This fixes PR11676.
Rafael Espindola [Fri, 30 Dec 2011 03:11:50 +0000 (03:11 +0000)]
Revert r147271. This fixes PR11676.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147362 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange the diagnostics which said 'accepted as an extension' to instead say
Richard Smith [Thu, 29 Dec 2011 21:57:33 +0000 (21:57 +0000)]
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

13 years agoUnbreak cmake build after r147340.
Richard Smith [Thu, 29 Dec 2011 21:42:29 +0000 (21:42 +0000)]
Unbreak cmake build after r147340.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147355 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake this text slightly more accurate; thanks to Johannes Schaub for
Sean Hunt [Thu, 29 Dec 2011 18:40:13 +0000 (18:40 +0000)]
Make this text slightly more accurate; thanks to Johannes Schaub for
pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147346 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd popcnt feature flag to match gcc. This flag is implied when sse42 is enabled...
Craig Topper [Thu, 29 Dec 2011 16:10:46 +0000 (16:10 +0000)]
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

13 years agoFix cmake build with -DBUILD_SHARED_LIBS=ON.
Rafael Espindola [Thu, 29 Dec 2011 04:31:59 +0000 (04:31 +0000)]
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

13 years agoSupport for thread safety attributes on functions
DeLesley Hutchins [Thu, 29 Dec 2011 00:56:48 +0000 (00:56 +0000)]
Support for thread safety attributes on functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147331 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSmall refactoring and simplification of constant evaluation and some of its
Richard Smith [Wed, 28 Dec 2011 19:48:30 +0000 (19:48 +0000)]
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

13 years agoHandle a /etc/debian_version with a version number instead of a codename.
Rafael Espindola [Wed, 28 Dec 2011 18:17:14 +0000 (18:17 +0000)]
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

13 years agoAdd a target hook for FLT_EVAL_METHOD and use it to set the value on x86 with sse...
Benjamin Kramer [Wed, 28 Dec 2011 15:47:06 +0000 (15:47 +0000)]
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

13 years agoSupport the 'a' scanf length modifier as an extension in C++.
Hans Wennborg [Wed, 28 Dec 2011 13:10:50 +0000 (13:10 +0000)]
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

13 years agoEnable the user to control whether CXXConstructExpr will be added as a
Zhongxing Xu [Wed, 28 Dec 2011 04:38:46 +0000 (04:38 +0000)]
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

13 years agoEliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
Douglas Gregor [Tue, 27 Dec 2011 22:43:10 +0000 (22:43 +0000)]
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

13 years agoFix the visibility of methods of explicit template instantiation definition
Rafael Espindola [Tue, 27 Dec 2011 21:15:28 +0000 (21:15 +0000)]
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

13 years agoconstexpr: support for evaluation and codegen of typeid constants.
Richard Smith [Tue, 27 Dec 2011 12:18:28 +0000 (12:18 +0000)]
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

13 years agoInitialize member that ends up in PCH files.
Benjamin Kramer [Tue, 27 Dec 2011 11:15:04 +0000 (11:15 +0000)]
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

13 years agoPartially revert r147195; lib/Basic/Version.cpp conditionally depends on config.h.
Eli Friedman [Mon, 26 Dec 2011 22:43:17 +0000 (22:43 +0000)]
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

13 years agoDelay checking of typedefs of dependent types. Fixes PR11630.
Rafael Espindola [Mon, 26 Dec 2011 22:42:47 +0000 (22:42 +0000)]
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

13 years agodriver: fix unused variable warning
Dylan Noblesmith [Mon, 26 Dec 2011 19:29:47 +0000 (19:29 +0000)]
driver: fix unused variable warning

from r147218.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147278 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix potential use after free.
Benjamin Kramer [Mon, 26 Dec 2011 14:18:37 +0000 (14:18 +0000)]
Fix potential use after free.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147277 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoclang/lib/Headers/CMakeLists.txt: Unbreak cmake build to add bmi2intrin.h since r147275.
NAKAMURA Takumi [Mon, 26 Dec 2011 03:20:06 +0000 (03:20 +0000)]
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

13 years agoAdd BMI2 intrinsics.
Craig Topper [Mon, 26 Dec 2011 02:31:10 +0000 (02:31 +0000)]
Add BMI2 intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147275 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix constexpr handling to allow 'extern constexpr' variable declarations. We no
Richard Smith [Sun, 25 Dec 2011 21:17:58 +0000 (21:17 +0000)]
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

13 years agoconstexpr: perform zero-initialization prior to / instead of performing a
Richard Smith [Sun, 25 Dec 2011 20:00:17 +0000 (20:00 +0000)]
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

13 years agoChange LZCNT and BMI tests to check IR instead of X86 assembly.
Craig Topper [Sun, 25 Dec 2011 15:20:31 +0000 (15:20 +0000)]
Change LZCNT and BMI tests to check IR instead of X86 assembly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147267 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agolib/Headers/CMakeLists.txt: Fix cmake build since r147263, for two missing headers.
NAKAMURA Takumi [Sun, 25 Dec 2011 12:47:46 +0000 (12:47 +0000)]
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

13 years agoAdd the rest of the BMI intrinsics.
Craig Topper [Sun, 25 Dec 2011 07:27:12 +0000 (07:27 +0000)]
Add the rest of the BMI intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147265 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd intrinsics for lzcnt and tzcnt instructions.
Craig Topper [Sun, 25 Dec 2011 06:25:37 +0000 (06:25 +0000)]
Add intrinsics for lzcnt and tzcnt instructions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147263 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd BMI, BMI2, and LZCNT feature flags to enable adding intrinsics.
Craig Topper [Sun, 25 Dec 2011 05:06:45 +0000 (05:06 +0000)]
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

13 years agoRemove unused variables.
Rafael Espindola [Sun, 25 Dec 2011 01:18:52 +0000 (01:18 +0000)]
Remove unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147260 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAlways implicitly declare move assignment operations for dynamic classes, in
Richard Smith [Sat, 24 Dec 2011 21:56:24 +0000 (21:56 +0000)]
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

13 years agoAdd last of the AVX2 intrinsics except for gather.
Craig Topper [Sat, 24 Dec 2011 17:20:15 +0000 (17:20 +0000)]
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

13 years agoAdd AVX2 permute intrinsics. Also add parentheses on some macro arguments in other...
Craig Topper [Sat, 24 Dec 2011 07:55:25 +0000 (07:55 +0000)]
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@147242 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX2 permute intrinsics. Also add parentheses on some macro arguments in other...
Craig Topper [Sat, 24 Dec 2011 07:55:14 +0000 (07:55 +0000)]
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

13 years agoAdd AVX2 intrinsics for FP vbroadcast, vbroadcasti128, and vpblendd.
Craig Topper [Sat, 24 Dec 2011 05:19:47 +0000 (05:19 +0000)]
Add AVX2 intrinsics for FP vbroadcast, vbroadcasti128, and vpblendd.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147240 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX2 intrinsics for FP vbroadcast, vbroadcasti128, and vpblendd.
Craig Topper [Sat, 24 Dec 2011 05:19:29 +0000 (05:19 +0000)]
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

13 years agoIntrinsics for AVX2 unpack instructions.
Craig Topper [Sat, 24 Dec 2011 03:58:43 +0000 (03:58 +0000)]
Intrinsics for AVX2 unpack instructions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147237 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore AVX2 intrinsics for shift, psign, some shuffles, and psadbw.
Craig Topper [Sat, 24 Dec 2011 03:28:57 +0000 (03:28 +0000)]
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

13 years agoFix several issues related to specializations and explicit instantiations.
Nico Weber [Fri, 23 Dec 2011 20:58:04 +0000 (20:58 +0000)]
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

13 years agofix for PR11634
Anton Yartsev [Fri, 23 Dec 2011 20:23:19 +0000 (20:23 +0000)]
fix for PR11634

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147224 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGive C11's __STDC_VERSION__ the final value.
Benjamin Kramer [Fri, 23 Dec 2011 17:00:41 +0000 (17:00 +0000)]
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

13 years agoMass rename C1x references to C11. The name hasn't proliferated like "C++0x" so this...
Benjamin Kramer [Fri, 23 Dec 2011 17:00:35 +0000 (17:00 +0000)]
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

13 years agoC1X is now C11, add -std=c11 and -std=gnu11 as aliases for the c1x arguments.
Benjamin Kramer [Fri, 23 Dec 2011 15:28:31 +0000 (15:28 +0000)]
C1X is now C11, add -std=c11 and -std=gnu11 as aliases for the c1x arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147220 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX2 multiply intrinsics.
Craig Topper [Fri, 23 Dec 2011 08:31:16 +0000 (08:31 +0000)]
Add AVX2 multiply intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147219 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLet CompilerInvocation initialization indicate failure
Dylan Noblesmith [Fri, 23 Dec 2011 03:05:38 +0000 (03:05 +0000)]
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

13 years agoPass context and access to Parser::ParseExplicitInstantiation() for
Argyrios Kyrtzidis [Fri, 23 Dec 2011 02:16:45 +0000 (02:16 +0000)]
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

13 years agoobjective-c: Use class definition AST in several situations when
Fariborz Jahanian [Fri, 23 Dec 2011 00:31:02 +0000 (00:31 +0000)]
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

13 years agoRemove spurious, but now legal, typename
Douglas Gregor [Fri, 23 Dec 2011 00:27:08 +0000 (00:27 +0000)]
Remove spurious, but now legal, typename

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147208 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen building a module with an umbrella header, warn about any headers
Douglas Gregor [Fri, 23 Dec 2011 00:23:59 +0000 (00:23 +0000)]
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

13 years agoColorize and condense CFG pretty-printing.
Ted Kremenek [Thu, 22 Dec 2011 23:33:52 +0000 (23:33 +0000)]
Colorize and condense CFG pretty-printing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147203 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd -Wdangling-else.
Nico Weber [Thu, 22 Dec 2011 23:26:17 +0000 (23:26 +0000)]
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

13 years agoremove unneeded config.h includes
Dylan Noblesmith [Thu, 22 Dec 2011 22:49:47 +0000 (22:49 +0000)]
remove unneeded config.h includes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147195 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake a note for an optimization that I'd like to implement, when the ASTs for local...
Douglas Gregor [Thu, 22 Dec 2011 22:05:07 +0000 (22:05 +0000)]
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

13 years agoSerialize the AST reader's mapping from canonical declarations to the
Douglas Gregor [Thu, 22 Dec 2011 21:40:42 +0000 (21:40 +0000)]
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

13 years agoAdd missing triple to darwin clang driver test.
Kevin Enderby [Thu, 22 Dec 2011 21:32:51 +0000 (21:32 +0000)]
Add missing triple to darwin clang driver test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147179 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix build under -Wswitch by adding support for FK_ListConstructorOverloadFailed
Nick Lewycky [Thu, 22 Dec 2011 20:21:32 +0000 (20:21 +0000)]
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

13 years agoIf we end up merging an Objective-C class with an existing Objective-C
Douglas Gregor [Thu, 22 Dec 2011 19:44:59 +0000 (19:44 +0000)]
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

13 years agoLast part of support for generating dwarf for assembly source files. This gets
Kevin Enderby [Thu, 22 Dec 2011 19:31:58 +0000 (19:31 +0000)]
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

13 years agoOverloading for initializer list construction.
Sebastian Redl [Thu, 22 Dec 2011 18:58:38 +0000 (18:58 +0000)]
Overloading for initializer list construction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147156 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a parser bug that prevented it from correctly parsing explicit construct expresso...
Sebastian Redl [Thu, 22 Dec 2011 18:58:29 +0000 (18:58 +0000)]
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

13 years agoList-initialization via constructor part 1. Still needs: pretty-printing, overloading...
Sebastian Redl [Thu, 22 Dec 2011 14:44:04 +0000 (14:44 +0000)]
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

13 years agoAdd AVX2 intrinsics for max, min, sign extend, and zero extend.
Craig Topper [Thu, 22 Dec 2011 09:18:58 +0000 (09:18 +0000)]
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

13 years agoDelete stray semicolon.
Eli Friedman [Thu, 22 Dec 2011 06:36:54 +0000 (06:36 +0000)]
Delete stray semicolon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147140 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix typos in analyzer diagnostics pointed out by Matt Beaumont-Gay and Robert Purves.
Ted Kremenek [Thu, 22 Dec 2011 06:35:52 +0000 (06:35 +0000)]
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

13 years agoIn Lexer::getCharAndSizeSlow[NoWarn] if we come up against
Argyrios Kyrtzidis [Thu, 22 Dec 2011 04:38:07 +0000 (04:38 +0000)]
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

13 years agoAdd support for bitcasts to vector type in Evaluate.
Eli Friedman [Thu, 22 Dec 2011 03:51:45 +0000 (03:51 +0000)]
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

13 years agoPR11614: Mark defaulted special constructors as constexpr if their implicit
Richard Smith [Thu, 22 Dec 2011 02:22:31 +0000 (02:22 +0000)]
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

13 years agoWhen deserializing an Objective-C class, check whether we have another
Douglas Gregor [Thu, 22 Dec 2011 01:48:48 +0000 (01:48 +0000)]
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

13 years agoEnhance AnalysisDeclContext::getReferencedBlockVars() to understand PseudoObjExprs...
Ted Kremenek [Thu, 22 Dec 2011 01:30:46 +0000 (01:30 +0000)]
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

13 years agoPR11637: implement special-case constant evaluation for char arrays initialized
Richard Smith [Thu, 22 Dec 2011 01:07:19 +0000 (01:07 +0000)]
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

13 years agoFix regression in LiveVariables when reasoning about variables captured by blocks.
Ted Kremenek [Thu, 22 Dec 2011 00:46:32 +0000 (00:46 +0000)]
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

13 years agoFix a silly mistake in this test that somehow slipped into my last commit.
Eli Friedman [Thu, 22 Dec 2011 00:06:39 +0000 (00:06 +0000)]
Fix a silly mistake in this test that somehow slipped into my last commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147112 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a failure (which led to a crash) in constant emission code with vector compound...
Eli Friedman [Thu, 22 Dec 2011 00:04:00 +0000 (00:04 +0000)]
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

13 years agoIn Lexer::getCharAndSizeSlow[NoWarn] make sure we don't go over the end of the buffer
Argyrios Kyrtzidis [Wed, 21 Dec 2011 20:19:55 +0000 (20:19 +0000)]
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

13 years agoobjc, objc rewriter. Fixes couple of bugs one
Fariborz Jahanian [Wed, 21 Dec 2011 19:48:07 +0000 (19:48 +0000)]
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

13 years agoImprove CFG pretty-printing for CXXConstructExprs.
Ted Kremenek [Wed, 21 Dec 2011 19:39:59 +0000 (19:39 +0000)]
Improve CFG pretty-printing for CXXConstructExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147068 91177308-0d34-0410-b5e6-96231b3b80d8