]> granicus.if.org Git - clang/log
clang
12 years agoHave functions return structures smaller than 128-bit in registers if ABI
Akira Hatanaka [Wed, 4 Jan 2012 03:34:42 +0000 (03:34 +0000)]
Have functions return structures smaller than 128-bit in registers if ABI
is either N32 or N64.

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

12 years agoFix messed-up indentation in r147515.
Eli Friedman [Wed, 4 Jan 2012 02:46:53 +0000 (02:46 +0000)]
Fix messed-up indentation in r147515.

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

12 years agoStub out the Sema interface for lambda expressions, and change the parser to use...
Eli Friedman [Wed, 4 Jan 2012 02:40:39 +0000 (02:40 +0000)]
Stub out the Sema interface for lambda expressions, and change the parser to use it.  Unconditionally error on lambda expressions because they don't work in any meaningful way yet.

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

12 years agoRevert r147493. It broke test/CodeGenObjC/constant-strings.m.
Rafael Espindola [Wed, 4 Jan 2012 01:32:19 +0000 (01:32 +0000)]
Revert r147493. It broke test/CodeGenObjC/constant-strings.m.

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

12 years agoTeach the static analyzer to not treat XPC types as CF types.
Ted Kremenek [Wed, 4 Jan 2012 00:35:48 +0000 (00:35 +0000)]
Teach the static analyzer to not treat XPC types as CF types.

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

12 years agoMinor code formatting cleanups.
Ted Kremenek [Wed, 4 Jan 2012 00:35:45 +0000 (00:35 +0000)]
Minor code formatting cleanups.

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

12 years agoIn non-gc, non-arc mode, property of 'Class' type
Fariborz Jahanian [Wed, 4 Jan 2012 00:31:53 +0000 (00:31 +0000)]
In non-gc, non-arc mode, property of 'Class' type
variety is treated as a 'void *'. No need to issue
warning reserved for objc object properties.
// rdar://10565506

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

12 years agoGet rid of an unnecessary check; the AST for init-lists is the same independent of...
Eli Friedman [Tue, 3 Jan 2012 23:54:05 +0000 (23:54 +0000)]
Get rid of an unnecessary check; the AST for init-lists is the same independent of whether we're in C++11 mode.

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

12 years agoEnhance UnixAPIChecker to also warn about zero-sized allocations to calloc() and...
Ted Kremenek [Tue, 3 Jan 2012 23:43:13 +0000 (23:43 +0000)]
Enhance UnixAPIChecker to also warn about zero-sized allocations to calloc() and realloc().  Patch by Cyril Roelandt!

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

12 years agoMinor tweak to name lookup for C/Objective-C: after the first name, still consider...
Douglas Gregor [Tue, 3 Jan 2012 23:34:23 +0000 (23:34 +0000)]
Minor tweak to name lookup for C/Objective-C: after the first name, still consider whether this is a redeclaration lookup when determining whether to look for the visible declaration

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

12 years agoTest "merging" of typedef types across distinct modules. At present,
Douglas Gregor [Tue, 3 Jan 2012 23:26:26 +0000 (23:26 +0000)]
Test "merging" of typedef types across distinct modules. At present,
the AST reader doesn't actually perform a merge, because name lookup
knows how to merge identical typedefs together.

As part of this, teach C/Objective-C name lookup to return multiple
results in all cases, rather than first digging through the attributes
to see if the value is overloadable. This way, we'll catch ambiguous
lookups in C/Objective-C.

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

12 years agoSupport constant evaluation for OpenCL nested vector literals. Patch by Anton Lokhmotov.
Eli Friedman [Tue, 3 Jan 2012 23:24:20 +0000 (23:24 +0000)]
Support constant evaluation for OpenCL nested vector literals.  Patch by Anton Lokhmotov.

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

12 years agoAdd initial version of checker to check if virtual member functions are called transi...
Ted Kremenek [Tue, 3 Jan 2012 23:18:57 +0000 (23:18 +0000)]
Add initial version of checker to check if virtual member functions are called transitively
from C++ constructors or destructors.  Checker by Lei Zhang with a few tweaks by Ted Kremenek.

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

12 years agoInitialise constant Objective-C string isa pointers with a weak reference to the...
David Chisnall [Tue, 3 Jan 2012 23:18:17 +0000 (23:18 +0000)]
Initialise constant Objective-C string isa pointers with a weak reference to the class, so that they are usable in +load methods if the string class has been compiled with clang - if it's been compiled with GCC, the ABI makes this impossible.  (GNU runtimes)

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

12 years agoobjc: diagnose misplacement of objc_suppress_autosynthesis
Fariborz Jahanian [Tue, 3 Jan 2012 22:52:32 +0000 (22:52 +0000)]
objc: diagnose misplacement of objc_suppress_autosynthesis
attribute.

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

12 years agoFixed by Chandler in r147434.
Chad Rosier [Tue, 3 Jan 2012 22:51:32 +0000 (22:51 +0000)]
Fixed by Chandler in r147434.

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

12 years agoImplement cross-module declaration merging for tag declarations, so
Douglas Gregor [Tue, 3 Jan 2012 22:46:00 +0000 (22:46 +0000)]
Implement cross-module declaration merging for tag declarations, so
that if two modules A and B both contain a declaration of a tag such
as

  struct X;

and those two modules are unrelated, the two declarations of X will be
merged into a single redeclaration chain.

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

12 years agoForce set-xcode-analyzer to use the system version of Python installed on OS X.
Ted Kremenek [Tue, 3 Jan 2012 22:05:57 +0000 (22:05 +0000)]
Force set-xcode-analyzer to use the system version of Python installed on OS X.

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

12 years agoAdd __has_feature(objc_modules)
Douglas Gregor [Tue, 3 Jan 2012 21:12:26 +0000 (21:12 +0000)]
Add __has_feature(objc_modules)

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

12 years agoAdd a test for the driver-level -fmodules/-fno-modules flags.
Douglas Gregor [Tue, 3 Jan 2012 21:04:31 +0000 (21:04 +0000)]
Add a test for the driver-level -fmodules/-fno-modules flags.

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

12 years agoAdd test case for PR 9774, which got fixed along the way.
Ted Kremenek [Tue, 3 Jan 2012 21:02:04 +0000 (21:02 +0000)]
Add test case for PR 9774, which got fixed along the way.

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

12 years agoAdded testcases for -Wdisabled-macro-expansion.
Abramo Bagnara [Tue, 3 Jan 2012 20:13:03 +0000 (20:13 +0000)]
Added testcases for -Wdisabled-macro-expansion.

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

12 years agoRe-uglify #public and #private to #__public_macro and #__private_macro.
Douglas Gregor [Tue, 3 Jan 2012 19:48:16 +0000 (19:48 +0000)]
Re-uglify #public and #private to #__public_macro and #__private_macro.

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

12 years agoobjc: use objc_suppress_autosynthesis attribute on classes
Fariborz Jahanian [Tue, 3 Jan 2012 19:46:00 +0000 (19:46 +0000)]
objc: use objc_suppress_autosynthesis attribute on classes
which should not be default synthesized.

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

12 years agoEliminate the uglified keyword __import_module__ for importing
Douglas Gregor [Tue, 3 Jan 2012 19:32:59 +0000 (19:32 +0000)]
Eliminate the uglified keyword __import_module__ for importing
modules. This leaves us without an explicit syntax for importing
modules in C/C++, because such a syntax needs to be discussed
first. In Objective-C/Objective-C++, the @import syntax is used to
import modules.

Note that, under -fmodules, C/C++ programs can import modules via the
#include mechanism when a module map is in place for that header. This
allows us to work with modules in C/C++ without committing to a syntax.

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

12 years agoDon't depend on undefined macros being 0, there are options for the
Joerg Sonnenberger [Tue, 3 Jan 2012 19:22:38 +0000 (19:22 +0000)]
Don't depend on undefined macros being 0, there are options for the
preprocessor to warn about it.

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

12 years agoobjc: introduce objc_suppress_autosynthesis class
Fariborz Jahanian [Tue, 3 Jan 2012 18:45:41 +0000 (18:45 +0000)]
objc: introduce objc_suppress_autosynthesis class
attributes for later use.

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

12 years agoUnder -fmodules, accept #public <macroname> and #private <macroname>
Douglas Gregor [Tue, 3 Jan 2012 18:24:14 +0000 (18:24 +0000)]
Under -fmodules, accept #public <macroname> and #private <macroname>
to make a macro public (the default for headers) or private,
respectively.

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

12 years agoIntroduce a non-uglified syntax for module imports in Objective-C:
Douglas Gregor [Tue, 3 Jan 2012 18:04:46 +0000 (18:04 +0000)]
Introduce a non-uglified syntax for module imports in Objective-C:

  @import identifier [. identifier]* ;

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

12 years agoDon't attempt to merge a deserialized declaration with existing
Douglas Gregor [Tue, 3 Jan 2012 17:31:38 +0000 (17:31 +0000)]
Don't attempt to merge a deserialized declaration with existing
declarations in the AST unless modules are enabled. This case doesn't
come up with precompiled headers, and it isn't cheap.

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

12 years agoFactor the merging of declarations in the AST reader out to a separate
Douglas Gregor [Tue, 3 Jan 2012 17:27:13 +0000 (17:27 +0000)]
Factor the merging of declarations in the AST reader out to a separate
member function template, since the behavior is identical for
ObjCInterfaceDecl and ObjCProtocolDecl. It's expected that all
redeclarable entities will have the same behavior.

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

12 years agoAdd -fno-modules to the driver, to turn off modules (although they're off by default...
Douglas Gregor [Tue, 3 Jan 2012 17:13:05 +0000 (17:13 +0000)]
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

12 years agoAdd a "Modules" language option, which subsumes the previous
Douglas Gregor [Tue, 3 Jan 2012 17:07:34 +0000 (17:07 +0000)]
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

12 years agoRename the command-line option for mapping #include/#import over to
Douglas Gregor [Tue, 3 Jan 2012 15:21:29 +0000 (15:21 +0000)]
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

12 years agoProcess attributes in explicit template instatiation definitions. Fixes PR11690.
Rafael Espindola [Tue, 3 Jan 2012 06:04:21 +0000 (06:04 +0000)]
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

12 years agoTeach the frontend to provide the builtin preprocessor defines for
Chandler Carruth [Tue, 3 Jan 2012 02:46:46 +0000 (02:46 +0000)]
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

12 years agoAdd assertion to char32_t that the value is valid, as suggested by Jordy Rose.
Richard Smith [Mon, 2 Jan 2012 18:14:06 +0000 (18:14 +0000)]
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

12 years agoDiagnose cases where the definition of a particular type is required,
Douglas Gregor [Mon, 2 Jan 2012 17:18:37 +0000 (17:18 +0000)]
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

12 years agoFix PR11685 by implementing -ffast-math and its various friends in the
Chandler Carruth [Mon, 2 Jan 2012 14:19:45 +0000 (14:19 +0000)]
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

12 years agoAdded a missing case for -Wdisabled-macro-expansion.
Abramo Bagnara [Mon, 2 Jan 2012 10:08:26 +0000 (10:08 +0000)]
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

12 years agoSmall cosmetic cleanups in code I will change anyway.
Rafael Espindola [Mon, 2 Jan 2012 06:26:22 +0000 (06:26 +0000)]
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

12 years agoSmall refactoring so that only one of the mergeVisibility/mergeLinkage functions
Rafael Espindola [Mon, 2 Jan 2012 06:00:53 +0000 (06:00 +0000)]
Small refactoring so that only one of the mergeVisibility/mergeLinkage functions
calls setVisibility/setLinkage.

No functionality change.

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

12 years agoEliminate ObjCProtocolDecl's end-of-definition location. It is not
Douglas Gregor [Mon, 2 Jan 2012 02:22:52 +0000 (02:22 +0000)]
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

12 years agoFix canonicalization of protocol-qualified types
Douglas Gregor [Mon, 2 Jan 2012 02:00:30 +0000 (02:00 +0000)]
Fix canonicalization of protocol-qualified types

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

12 years agoMove ObjCProtocolDecl::EndLoc into its DefinitionData, and give
Douglas Gregor [Mon, 2 Jan 2012 01:18:16 +0000 (01:18 +0000)]
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

12 years agoEliminate the ForwardDecl/InitiallyForwardDecl bits from ObjCProtocolDecl. They are...
Douglas Gregor [Sun, 1 Jan 2012 22:06:18 +0000 (22:06 +0000)]
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

12 years agoAdded -Wdisabled-macro-expansion warning.
Abramo Bagnara [Sun, 1 Jan 2012 22:01:04 +0000 (22:01 +0000)]
Added -Wdisabled-macro-expansion warning.

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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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