]> granicus.if.org Git - clang/log
clang
11 years ago[analyzer] Handle destructors for the argument to C++ 'delete'.
Jordan Rose [Wed, 25 Sep 2013 16:06:17 +0000 (16:06 +0000)]
[analyzer] Handle destructors for the argument to C++ 'delete'.

Now that the CFG includes nodes for the destructors in a delete-expression,
process them in the analyzer using the same common destructor interface
currently used for local, member, and base destructors. Also, check for when
the value is known to be null, in which case no destructor is actually run.

This does not yet handle destructors for deleted /arrays/, which may need
more CFG work. It also causes a slight regression in the location of
double delete warnings; the double delete is detected at the destructor
call, which is implicit, and so is reported on the first access within the
destructor instead of at the 'delete' statement. This will be fixed soon.

Patch by Karthik Bhat!

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

11 years agoProduce an error if a -cc1 only option is passed to the driver.
Rafael Espindola [Wed, 25 Sep 2013 15:54:41 +0000 (15:54 +0000)]
Produce an error if a -cc1 only option is passed to the driver.

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

11 years agoUse -Xclang to pass -internal-isystem and -internal-externc-isystem to -cc1.
Rafael Espindola [Wed, 25 Sep 2013 15:47:05 +0000 (15:47 +0000)]
Use -Xclang to pass -internal-isystem and -internal-externc-isystem to -cc1.

They are cc1 options only, so the driver was ignoring them.

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

11 years agoMove --relocatable-pch to Options.td.
Rafael Espindola [Wed, 25 Sep 2013 15:26:06 +0000 (15:26 +0000)]
Move --relocatable-pch to Options.td.

It is a valid driver option (we have tests for that), so it should not be
marked as NoDriverOption.

No functionality change other than it showing in --help.

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

11 years agoDon't pass -print-stats to the driver, it is a -cc1 option only.
Rafael Espindola [Wed, 25 Sep 2013 15:21:56 +0000 (15:21 +0000)]
Don't pass -print-stats to the driver, it is a -cc1 option only.

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

11 years agoclang-format: Option to removing the space before assignment operators.
Daniel Jasper [Wed, 25 Sep 2013 15:15:02 +0000 (15:15 +0000)]
clang-format: Option to removing the space before assignment operators.

Patch contributed by Aaron Wishnick. Thank you!

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

11 years agoRemove unused option.
Rafael Espindola [Wed, 25 Sep 2013 14:31:29 +0000 (14:31 +0000)]
Remove unused option.

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

11 years agoSema: Simplify code a bit, plug a potential leak.
Benjamin Kramer [Wed, 25 Sep 2013 13:10:11 +0000 (13:10 +0000)]
Sema: Simplify code a bit, plug a potential leak.

No intended functionality change.

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

11 years agoStaticAnalyzer/Core/RegionStore.cpp: Prune one last "\param IsConst", as fixup to...
NAKAMURA Takumi [Wed, 25 Sep 2013 08:17:20 +0000 (08:17 +0000)]
StaticAnalyzer/Core/RegionStore.cpp: Prune one last "\param IsConst", as fixup to r191342. [-Wdocumentation]

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

11 years agoRefactor to use C++1y 'auto' semantics directly in lambdas with no specified
Richard Smith [Wed, 25 Sep 2013 05:02:54 +0000 (05:02 +0000)]
Refactor to use C++1y 'auto' semantics directly in lambdas with no specified
return type in C++1y mode. No functionality change intended. Extracted and
tweaked from a patch by Faisal Vali!

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

11 years agoObjectiveC migrator. Don't suggest @property for
Fariborz Jahanian [Wed, 25 Sep 2013 00:17:07 +0000 (00:17 +0000)]
ObjectiveC migrator. Don't suggest @property for
methods which look like getters but belong to
known family of methods. // rdar://15044058

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

11 years ago[libclang] python: fix return type of clang_Type_getSizeOf().
Argyrios Kyrtzidis [Wed, 25 Sep 2013 00:14:43 +0000 (00:14 +0000)]
[libclang] python: fix return type of clang_Type_getSizeOf().

Patch by Loïc Jaquemet!

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

11 years ago[libclang] Provide location for attributes and expose 'packed' attribute.
Argyrios Kyrtzidis [Wed, 25 Sep 2013 00:14:38 +0000 (00:14 +0000)]
[libclang] Provide location for attributes and expose 'packed' attribute.

Patch by Loïc Jaquemet!

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

11 years ago[analyzer] This patch removes passing around of const-invalidation vs regular-invalid...
Anton Yartsev [Tue, 24 Sep 2013 23:47:29 +0000 (23:47 +0000)]
[analyzer] This patch removes passing around of const-invalidation vs regular-invalidation info by passing around a datastructure that maps regions and symbols to the type of invalidation they experience. This simplifies the code and would allow to associate more different invalidation types in the future.
With this patch things like preserving contents of regions (either hi- or low-level ones) or processing of the only top-level region can be implemented easily without passing around extra parameters.

This patch is a first step towards adequate modeling of memcpy() by the CStringChecker checker and towards eliminating of majority of false-positives produced by the NewDeleteLeaks checker.

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

11 years agoAllow dynamic_cast to void* even with -fno-rtti.
Eli Friedman [Tue, 24 Sep 2013 23:21:41 +0000 (23:21 +0000)]
Allow dynamic_cast to void* even with -fno-rtti.

PR17346.

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

11 years agoFix -Wmissing-variable-declarations regression.
Eli Friedman [Tue, 24 Sep 2013 23:10:08 +0000 (23:10 +0000)]
Fix -Wmissing-variable-declarations regression.

This issue was introduced in r181677.

PR17349.

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

11 years agoAvoid a signed/unsigned comparison warning with compilers that don't know how
Richard Smith [Tue, 24 Sep 2013 22:13:21 +0000 (22:13 +0000)]
Avoid a signed/unsigned comparison warning with compilers that don't know how
to handle constant expressions.

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

11 years agoObjectiveC migrator: provide space between the property
Fariborz Jahanian [Tue, 24 Sep 2013 21:27:58 +0000 (21:27 +0000)]
ObjectiveC migrator: provide space between the property
keyword and the rest on suggested property. // rdar://15069044

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

11 years agoObjectiveC migrator: Another test for my last patch.
Fariborz Jahanian [Tue, 24 Sep 2013 20:31:24 +0000 (20:31 +0000)]
ObjectiveC migrator: Another test for my last patch.
// rdar://15044991

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

11 years agoObjectiveC migrator: iDOn't mangle names when
Fariborz Jahanian [Tue, 24 Sep 2013 20:20:52 +0000 (20:20 +0000)]
ObjectiveC migrator: iDOn't mangle names when
NS_RETURNS_INNER_POINTER annotation is suggested on
a property. // rdar://15044991

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

11 years agoProduce an error for unknown -m options.
Rafael Espindola [Tue, 24 Sep 2013 19:35:01 +0000 (19:35 +0000)]
Produce an error for unknown -m options.

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

11 years agoAdding -mtbm and -mno-tbm command line options to the clang front end for the
Yunzhong Gao [Tue, 24 Sep 2013 19:00:58 +0000 (19:00 +0000)]
Adding -mtbm and -mno-tbm command line options to the clang front end for the
x86 TBM instruction set. Also adding a __TBM__ macro if the TBM feature is
enabled. Otherwise there should be no functionality change to existing features.

Phabricator code review is located here: http://llvm-reviews.chandlerc.com/D1693

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

11 years agoclang-cl: fix passing optimization level to cl.exe in /fallback mode
Hans Wennborg [Tue, 24 Sep 2013 18:17:21 +0000 (18:17 +0000)]
clang-cl: fix passing optimization level to cl.exe in /fallback mode

We were previously mostly passing it through, but -O0 and -O3 are not valid
options to cl.exe.

We should translate -O0 to /Od and -O3 to /Ox. -O{1,2,s} get passed through.

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

11 years agoclang-cl: pass /nologo when falling back to cl.exe
Hans Wennborg [Tue, 24 Sep 2013 17:36:21 +0000 (17:36 +0000)]
clang-cl: pass /nologo when falling back to cl.exe

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

11 years agoRevert my patch in r191155 to allow forward
Fariborz Jahanian [Tue, 24 Sep 2013 17:03:07 +0000 (17:03 +0000)]
Revert my patch in r191155 to allow forward
class/protocol decls in @implementation and
fixup modern rewriter to handle that.
// rdar://15066233

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

11 years agoUse a valid option (-msse) for testing QA_OVERRIDE_GCC3_OPTIONS.
Rafael Espindola [Tue, 24 Sep 2013 13:37:21 +0000 (13:37 +0000)]
Use a valid option (-msse) for testing QA_OVERRIDE_GCC3_OPTIONS.

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

11 years agoRemove a use of OPT_m_Joined.
Rafael Espindola [Tue, 24 Sep 2013 13:28:24 +0000 (13:28 +0000)]
Remove a use of OPT_m_Joined.

This patch turns the -mv* hexagon options into aliases. We should really produce
errors for invalid versions in the driver, but this patch preserves the old
behavior for now.

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

11 years agoFix uninitialized value bug discovered buy msan buildbot.
Daniel Jasper [Tue, 24 Sep 2013 12:30:27 +0000 (12:30 +0000)]
Fix uninitialized value bug discovered buy msan buildbot.

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

11 years agoAdd -fmodule-map-file option.
Daniel Jasper [Tue, 24 Sep 2013 09:27:13 +0000 (09:27 +0000)]
Add -fmodule-map-file option.

With this option, arbitrarily named module map files can be specified
to be loaded as required for headers in the respective (sub)directories.

This, together with the extern module declaration allows for specifying
module maps in a modular fashion without the need for files called
"module.map".

Among other things, this allows a directory to contain two modules that
are completely independent of one another.

Review: http://llvm-reviews.chandlerc.com/D1697.

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

11 years agoModule use declarations (II)
Daniel Jasper [Tue, 24 Sep 2013 09:14:14 +0000 (09:14 +0000)]
Module use declarations (II)

Review: http://llvm-reviews.chandlerc.com/D1546.

I have picked up this patch form Lawrence
(http://llvm-reviews.chandlerc.com/D1063) and did a few changes.

From the original change description (updated as appropriate):
This patch adds a check that ensures that modules only use modules they
have so declared. To this end, it adds a statement on intended module
use to the module.map grammar:

  use module-id

A module can then only use headers from other modules if it 'uses' them.
This enforcement is off by default, but may be turned on with the new
option -fmodules-decluse.

When enforcing the module semantics, we also need to consider a source
file part of a module. This is achieved with a compiler option

-fmodule-name=<module-id>.

The compiler at present only applies restrictions to the module directly
being built.

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

11 years ago[Mips] Support -mnan=2008 option. Define "__mips_nan2008" macros and pass
Simon Atanasyan [Tue, 24 Sep 2013 09:09:16 +0000 (09:09 +0000)]
[Mips] Support -mnan=2008 option. Define "__mips_nan2008" macros and pass
this option to the assembler.

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

11 years agoHopefully unbreak bots which are seeing an assert in this test. Temporary, real
Richard Smith [Tue, 24 Sep 2013 05:07:58 +0000 (05:07 +0000)]
Hopefully unbreak bots which are seeing an assert in this test. Temporary, real
fix to come once I've tracked down the problem (which is pre-existing and not
related to the change which introduced this test).

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

11 years agoImplement restriction that a partial specialization must actually specialize
Richard Smith [Tue, 24 Sep 2013 04:49:23 +0000 (04:49 +0000)]
Implement restriction that a partial specialization must actually specialize
something, for variable templates.

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

11 years agoCGBuiltin.cpp: Prune a stray default: label. [-Wcovered-switch-default]
NAKAMURA Takumi [Tue, 24 Sep 2013 04:37:50 +0000 (04:37 +0000)]
CGBuiltin.cpp: Prune a stray default: label. [-Wcovered-switch-default]

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

11 years agoHandle standard libraries that miss out the space when defining the standard
Richard Smith [Tue, 24 Sep 2013 04:06:10 +0000 (04:06 +0000)]
Handle standard libraries that miss out the space when defining the standard
literal operators. Also, for now, allow the proposed C++1y "il", "i", and "if"
suffixes too. (Will revert the latter if LWG decides not to go ahead with that
change after all.)

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

11 years ago[OPENMP] Bug fixes and improvements.
Alexey Bataev [Tue, 24 Sep 2013 03:17:45 +0000 (03:17 +0000)]
[OPENMP] Bug fixes and improvements.
1. Fixed constructor of shared clause.
2. Some macros for clauses processing are replaced by private template methods.
3. Additional checks in sema analysis of OpenMP clauses.

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

11 years agoInitial support for Neon scalar instructions.
Jiangning Liu [Tue, 24 Sep 2013 02:48:06 +0000 (02:48 +0000)]
Initial support for Neon scalar instructions.

Patch by Ana Pazos.

1.Added support for v1ix and v1fx types.
2.Added Scalar Pairwise Reduce instructions.
3.Added initial implementation of Scalar Arithmetic instructions.

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

11 years agoRemove unused option.
Rafael Espindola [Tue, 24 Sep 2013 00:10:56 +0000 (00:10 +0000)]
Remove unused option.

gcc doesn't support "gcc -m sse" and this was not tested in clang and only
used for link argument on darwin, so this was very likely just a bug.

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

11 years agoclang-cl: print diagnostics as "error(clang): foo" in /fallback mode
Hans Wennborg [Tue, 24 Sep 2013 00:08:55 +0000 (00:08 +0000)]
clang-cl: print diagnostics as "error(clang): foo" in /fallback mode

This solves two problems:

1) MSBuild will not flag the build as unsuccessful just because we print
   an error in the output, since "error(clang):" doesn't seem to match
   the regex it's using.

2) It becomes more clear that the diagnostic is coming from clang as
   supposed to cl.exe.

Differential Revision: http://llvm-reviews.chandlerc.com/D1735

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

11 years agoProduce errors for unknown options.
Rafael Espindola [Mon, 23 Sep 2013 23:55:25 +0000 (23:55 +0000)]
Produce errors for unknown options.

This doesn't change a lot since clang still thinks it knows all of the
-f*, -m* and -W* options for example.

Other than the options clang explicitly claims to know, this fixes pr9701.

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

11 years agoFix argument types of some AVX2 intrinsics.
Eli Friedman [Mon, 23 Sep 2013 23:52:04 +0000 (23:52 +0000)]
Fix argument types of some AVX2 intrinsics.

This fix makes our headers consistent with gcc.

PR17312.

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

11 years agoRemove extra space.
Fariborz Jahanian [Mon, 23 Sep 2013 23:48:04 +0000 (23:48 +0000)]
Remove extra space.

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

11 years agoFix an incomplete copy and paste in my previous patch.
Rafael Espindola [Mon, 23 Sep 2013 23:43:34 +0000 (23:43 +0000)]
Fix an incomplete copy and paste in my previous patch.

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

11 years agoAdd _mm_stream_si64 intrinsic.
Eli Friedman [Mon, 23 Sep 2013 23:38:39 +0000 (23:38 +0000)]
Add _mm_stream_si64 intrinsic.

While I'm here, also fix the alignment computation for the whole family of
intrinsics.

PR17298.

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

11 years agoAdd tests on how clang currently handles some unknown options.
Rafael Espindola [Mon, 23 Sep 2013 23:27:32 +0000 (23:27 +0000)]
Add tests on how clang currently handles some unknown options.

This is not to say this is the desired behavior, but it makes sure we notice
if it changes.

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

11 years agoObjectiveC migrator. When migrating to property declaration
Fariborz Jahanian [Mon, 23 Sep 2013 23:18:46 +0000 (23:18 +0000)]
ObjectiveC migrator. When migrating to property declaration
use Cocoa's naming convention for properties of ObjC
object type. // rdar://15045005

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

11 years agoRevert change accidentally committed in r191150.
Richard Smith [Mon, 23 Sep 2013 23:12:22 +0000 (23:12 +0000)]
Revert change accidentally committed in r191150.

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

11 years agoObjectiveC migrator: Infer NS_OPTIONS when if there is at
Fariborz Jahanian [Mon, 23 Sep 2013 20:27:06 +0000 (20:27 +0000)]
ObjectiveC migrator: Infer NS_OPTIONS when if there is at
least one hex enumerator, all others are also
hex enumerator (0 enumerator is excepted).
// rdar://15044304

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

11 years agoEnable -fsanitize=use-after-return by default under -fsanitize=address
Kostya Serebryany [Mon, 23 Sep 2013 09:52:37 +0000 (09:52 +0000)]
Enable -fsanitize=use-after-return by default under -fsanitize=address

Summary:
We enable ASAN's use-after-return instrumentation at compile-time,
but still keep it disabled at run-time.
This enables the users to flip the flag at run-time using environment variable
ASAN_OPTIONS=detect_stack_use_after_return=1 instead of using a separate build.
If UAR detection is disabled at run-time, this extra compile-time instrumentation
costs very small slowdown. On SPEC 2006 14 tests are not affected at all,
4 tests get ~ 1% slowdown and 453.povray gets 4%.

Reviewers: samsonov

Reviewed By: samsonov

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1741

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

11 years agoPR16529: Don't forget to add the CXXFunctionalCastExpr type sugar to an
Richard Smith [Mon, 23 Sep 2013 02:20:00 +0000 (02:20 +0000)]
PR16529: Don't forget to add the CXXFunctionalCastExpr type sugar to an
InitListExpr for a C++11-style T{...} construction, if initialization
registered a destructor for it.

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

11 years agoMake sort predicate match the qsort convention.
Benjamin Kramer [Sun, 22 Sep 2013 15:02:02 +0000 (15:02 +0000)]
Make sort predicate match the qsort convention.

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

11 years agoFix array_pod_sort predicates after LLVM change.
Benjamin Kramer [Sun, 22 Sep 2013 14:10:29 +0000 (14:10 +0000)]
Fix array_pod_sort predicates after LLVM change.

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

11 years agoarray_pod_sort loses some type safety, better use the right types.
Benjamin Kramer [Sun, 22 Sep 2013 12:53:24 +0000 (12:53 +0000)]
array_pod_sort loses some type safety, better use the right types.

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

11 years agoRewrite a cold use of std::sort to array_pod_sort.
Benjamin Kramer [Sun, 22 Sep 2013 12:41:24 +0000 (12:41 +0000)]
Rewrite a cold use of std::sort to array_pod_sort.

No functionality change.

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

11 years agoFix comment to match name of variable.
Nick Lewycky [Sun, 22 Sep 2013 10:07:22 +0000 (10:07 +0000)]
Fix comment to match name of variable.

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

11 years agoSimplify code to equivalent code. No need to test for null after cast<>, use
Nick Lewycky [Sun, 22 Sep 2013 10:06:57 +0000 (10:06 +0000)]
Simplify code to equivalent code. No need to test for null after cast<>, use
takeAs<> instead of cast<>(.take()). Fix 80-column violation in whitespace after
comment.

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

11 years agoFix typo. Add missing whitespace. No functionality change.
Nick Lewycky [Sun, 22 Sep 2013 10:06:01 +0000 (10:06 +0000)]
Fix typo. Add missing whitespace. No functionality change.

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

11 years agoParse: Move simple-type-specifier sanity check earlier
David Majnemer [Sun, 22 Sep 2013 03:30:01 +0000 (03:30 +0000)]
Parse: Move simple-type-specifier sanity check earlier

No functional change, just makes the error handling a bit more obvious.

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

11 years agoParse: Don't crash during parsing if we lack a simple-type-specifier
David Majnemer [Sun, 22 Sep 2013 01:24:26 +0000 (01:24 +0000)]
Parse: Don't crash during parsing if we lack a simple-type-specifier

Summary:
Parsing cast expressions during error recovery can put us in a bad
state.  Check to see if the token for a simple-type-specifier makes
sense before further parsing.

Fixes PR17255.

Reviewers: rsmith, doug.gregor, CornedBee, eli.friedman

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1696

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

11 years agoObjectiveC: ObjC declarations, including forward class
Fariborz Jahanian [Sun, 22 Sep 2013 00:02:16 +0000 (00:02 +0000)]
ObjectiveC: ObjC declarations, including forward class
and protocols can be at global scope only.

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

11 years agoPR17295: Do not allow explicit conversion functions to be used in cases where
Richard Smith [Sat, 21 Sep 2013 21:55:46 +0000 (21:55 +0000)]
PR17295: Do not allow explicit conversion functions to be used in cases where
an additional conversion (other than a qualification conversion) would be
required after the explicit conversion.

Conversely, do allow explicit conversion functions to be used when initializing
a temporary for a reference binding in direct-list-initialization.

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

11 years agoSome comment updates and tweaks for clarity.
Richard Smith [Sat, 21 Sep 2013 21:23:47 +0000 (21:23 +0000)]
Some comment updates and tweaks for clarity.

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

11 years agoRearrange narrowing checks in initialization to be a different form of step
Richard Smith [Sat, 21 Sep 2013 21:19:19 +0000 (21:19 +0000)]
Rearrange narrowing checks in initialization to be a different form of step
rather than a post-processing action, so we can support inserting these checks
at stages other than the end of the initialization. No functionality change
intended.

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

11 years agoclang-format: Improve address-of-operator detection
Daniel Jasper [Sat, 21 Sep 2013 17:31:51 +0000 (17:31 +0000)]
clang-format: Improve address-of-operator detection

Before:
  size = sizeof * a;

After:
  size = sizeof *a;

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

11 years agoFix clang-format-diff.py to accept -style again.
Daniel Jasper [Sat, 21 Sep 2013 10:05:02 +0000 (10:05 +0000)]
Fix clang-format-diff.py to accept -style again.

Copy and paste error in r190935..

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

11 years ago[Mips] Allocate NaClTargetInfo for MIPSEL NaCl
Petar Jovanovic [Sat, 21 Sep 2013 01:27:01 +0000 (01:27 +0000)]
[Mips] Allocate NaClTargetInfo for MIPSEL NaCl

A patch to AllocateTarget function to recognize llvm::Triple::NaCl for
MIPSEL and return NaClTargetInfo. Additional test has been added to check
if the expected macros get defined.

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

11 years agoFix return type of _mm_extract_epi8 etc.
Eli Friedman [Sat, 21 Sep 2013 00:05:25 +0000 (00:05 +0000)]
Fix return type of _mm_extract_epi8 etc.

PR17300.

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

11 years agoSwitch tests in test/Headers to use %clang_cc1 rather than %clang. There
Chandler Carruth [Fri, 20 Sep 2013 21:12:25 +0000 (21:12 +0000)]
Switch tests in test/Headers to use %clang_cc1 rather than %clang. There
is no need to go through the driver indirection here, and it clutters
things up as dependencies can sneak in for specific things the driver is
doing.

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

11 years agoRefactor: CheckExplicitInitList is only called to check an entire InitListExpr,
Richard Smith [Fri, 20 Sep 2013 20:10:22 +0000 (20:10 +0000)]
Refactor: CheckExplicitInitList is only called to check an entire InitListExpr,
so the Index in/out parameters are pointless (always passed in as 0, always
ignored by the caller).

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

11 years agoclang-cl: implement custom search for cl.exe in /fallback mode
Hans Wennborg [Fri, 20 Sep 2013 18:16:35 +0000 (18:16 +0000)]
clang-cl: implement custom search for cl.exe in /fallback mode

This solves the problem of fallback onto ourselves if clang-cl
has been renamed to cl.exe and put on the PATH, as happens with
the VS integration.

Differential Revision: http://llvm-reviews.chandlerc.com/D1731

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

11 years agoUpdate -fmsc-version docs for r190908, which set the default to 1700
Reid Kleckner [Fri, 20 Sep 2013 18:01:52 +0000 (18:01 +0000)]
Update -fmsc-version docs for r190908, which set the default to 1700

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

11 years agoFix ReST links I just added to the manual
Reid Kleckner [Fri, 20 Sep 2013 17:54:39 +0000 (17:54 +0000)]
Fix ReST links I just added to the manual

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

11 years agoClarify that we silently ignore some MS extensions like IDL attributes
Reid Kleckner [Fri, 20 Sep 2013 17:51:00 +0000 (17:51 +0000)]
Clarify that we silently ignore some MS extensions like IDL attributes

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

11 years agoUse -fms-compatibility to trigger lookup into dep. bases
Reid Kleckner [Fri, 20 Sep 2013 17:04:25 +0000 (17:04 +0000)]
Use -fms-compatibility to trigger lookup into dep. bases

Update the docs for -fms-extensions and -fms-compatibility to try to
clarify the difference between the two.

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

11 years ago[analyzer] Use getParentIgnoreParenCasts instead of doing it by hand.
Jordan Rose [Fri, 20 Sep 2013 16:51:50 +0000 (16:51 +0000)]
[analyzer] Use getParentIgnoreParenCasts instead of doing it by hand.

Apart from being more compact and already implemented, this also handles the
case where the parent is null. (It does also ignore all casts, not just
implicit ones, but this is more efficient to test and in the case we care
about---a message in a PseudoObjectExpr---there should only be implicit casts
anyway.

This should fix our internal buildbot.

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

11 years ago[ASan] Fix darwin-sanitizer-ld.c to test for the new order of linker flags introduced...
Alexander Potapenko [Fri, 20 Sep 2013 08:23:19 +0000 (08:23 +0000)]
[ASan] Fix darwin-sanitizer-ld.c to test for the new order of linker flags introduced by r191076.

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

11 years ago[ASan] Do not imply -undefined dynamic_lookup when linking dylibs with -fsanitize...
Alexander Potapenko [Fri, 20 Sep 2013 08:09:51 +0000 (08:09 +0000)]
[ASan] Do not imply -undefined dynamic_lookup when linking dylibs with -fsanitize=address.
Instead add the ASan runtime to the linker command line so that only the ASan API functions can be undefined in the target library.

Fixes http://llvm.org/bugs/show_bug.cgi?id=17275

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

11 years agoModify the uninitialized field visitor to detect uninitialized use across the
Richard Trieu [Fri, 20 Sep 2013 03:03:06 +0000 (03:03 +0000)]
Modify the uninitialized field visitor to detect uninitialized use across the
fields in the class.  This allows a better checking of member intiailizers and
in class initializers in regards to initialization ordering.

For instance, this code will now produce warnings:

class A {
  int x;
  int y;
  A() : x(y) {}  // y is initialized after x, warn here
  A(int): y(x) {} // default initialization of leaves x uninitialized, warn here
};

Several test cases were updated with -Wno-uninitialized to silence this warning.

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

11 years agoTestcase I forgot to svn add in r191057.
Richard Smith [Fri, 20 Sep 2013 02:48:08 +0000 (02:48 +0000)]
Testcase I forgot to svn add in r191057.

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

11 years agoSwitch the semantic DeclContext for a block-scope declaration of a function or
Richard Smith [Fri, 20 Sep 2013 01:15:31 +0000 (01:15 +0000)]
Switch the semantic DeclContext for a block-scope declaration of a function or
variable from being the function to being the enclosing namespace scope (in
C++) or the TU (in C). This allows us to fix a selection of related issues
where we would build incorrect redeclaration chains for such declarations, and
fail to notice type mismatches.

Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
which is only found when searching scopes, and not found when searching
DeclContexts. Such a declaration is only made visible in its DeclContext if
there are no non-LocalExtern declarations.

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

11 years agoPR17290: Use 'false' macro in fix-it hint for initializing a variable of type
Richard Smith [Fri, 20 Sep 2013 00:27:40 +0000 (00:27 +0000)]
PR17290: Use 'false' macro in fix-it hint for initializing a variable of type
_Bool in C, if the macro is defined. Also teach FixItUtils to look at whether
the macro was defined at the source location for which it is creating a fixit,
rather than looking at whether it's defined *now*. This is especially relevant
for analysis-based warnings which are delayed until end of TU.

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

11 years agoDon't correct typos in Sema::BuildCXXNestedNameSpecifier with -fms-extensions
Kaelyn Uhrain [Thu, 19 Sep 2013 22:38:48 +0000 (22:38 +0000)]
Don't correct typos in Sema::BuildCXXNestedNameSpecifier with -fms-extensions

When -fms-extensions is enabled, the typo correction was being called here on
non-error paths (as in test/SemaTemplate/lookup-dependent-bases.cpp) and correct
compilation depended on Sema::CorrectTypo not finding a viable candidate.

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

11 years agoclang-cl: implement /fallback mode
Hans Wennborg [Thu, 19 Sep 2013 20:32:16 +0000 (20:32 +0000)]
clang-cl: implement /fallback mode

When this flag is enabled, clang-cl falls back to cl.exe if it
cannot compile the code itself for some reason.

The idea is to use this to help build projects that almost compile
with clang-cl, except for some files that can then be built with
the fallback mechanism.

Differential Revision: http://llvm-reviews.chandlerc.com/D1711

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

11 years agoFixes a buildbot failure (was using local
Fariborz Jahanian [Thu, 19 Sep 2013 17:52:50 +0000 (17:52 +0000)]
Fixes a buildbot failure (was using local
type in template instantiation).

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

11 years agoRefinement to my previous patch for
Fariborz Jahanian [Thu, 19 Sep 2013 17:18:55 +0000 (17:18 +0000)]
Refinement to my previous patch for
objc_returns_inner_pointer on properties. // rdar://14990439

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

11 years agoclang-cl: Accept -fmsc-version so we can set it without -Xclang
Reid Kleckner [Thu, 19 Sep 2013 17:00:54 +0000 (17:00 +0000)]
clang-cl: Accept -fmsc-version so we can set it without -Xclang

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

11 years agoObjectiveC: Allow NS_RETURNS_INNER_POINTER annotation
Fariborz Jahanian [Thu, 19 Sep 2013 16:37:20 +0000 (16:37 +0000)]
ObjectiveC: Allow NS_RETURNS_INNER_POINTER annotation
of ObjectiveC properties to mean annotation of
NS_RETURNS_INNER_POINTER on its synthesized getter.
This also facilitates more migration to properties when
methods are annotated with NS_RETURNS_INNER_POINTER.
// rdar://14990439

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

11 years agoFix ifdef macro missed in previous commit
Ben Langmuir [Thu, 19 Sep 2013 14:07:14 +0000 (14:07 +0000)]
Fix ifdef macro missed in previous commit

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

11 years agoMove sha intrinsics to immintrin.h
Ben Langmuir [Thu, 19 Sep 2013 14:00:22 +0000 (14:00 +0000)]
Move sha intrinsics to immintrin.h

This is consistent with ICC and Intel's SHA-enabled GCC version.

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

11 years ago[ARMv8] Add crypto-neon-fp-armv8 -mfpu option in driver.
Amara Emerson [Thu, 19 Sep 2013 13:54:03 +0000 (13:54 +0000)]
[ARMv8] Add crypto-neon-fp-armv8 -mfpu option in driver.

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

11 years agoAdd C intrinsics for Intel SHA Extensions
Ben Langmuir [Thu, 19 Sep 2013 13:22:04 +0000 (13:22 +0000)]
Add C intrinsics for Intel SHA Extensions

Intrinsics added shaintrin.h, which is included from x86intrin.h if __SHA__ is
enabled. SHA implies SSE2, which is needed for the __m128i type.

Also add the -msha/-mno-sha option.

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

11 years agoUse -ffreestanding in ms-intrin.cpp and define size_t manually.
Reid Kleckner [Thu, 19 Sep 2013 01:54:40 +0000 (01:54 +0000)]
Use -ffreestanding in ms-intrin.cpp and define size_t manually.

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

11 years agoFix use-after-free in r190980.
Eli Friedman [Thu, 19 Sep 2013 01:51:23 +0000 (01:51 +0000)]
Fix use-after-free in r190980.

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

11 years agoUse curly braces all the way through long if/else chain for consistency and readability.
Craig Topper [Thu, 19 Sep 2013 01:13:07 +0000 (01:13 +0000)]
Use curly braces all the way through long if/else chain for consistency and readability.

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

11 years agoFix crash with cast of value-dependent expr.
Eli Friedman [Thu, 19 Sep 2013 01:12:33 +0000 (01:12 +0000)]
Fix crash with cast of value-dependent expr.

We don't really need to perform semantic analysis on the dependent expression
anyway, so just call the cast dependent.

<rdar://problem/15012610>

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

11 years agoMake Preprocessor::Lex non-recursive.
Eli Friedman [Thu, 19 Sep 2013 00:41:32 +0000 (00:41 +0000)]
Make Preprocessor::Lex non-recursive.

Before this patch, Lex() would recurse whenever the current lexer changed (e.g.
upon entry into a macro). This patch turns the recursion into a loop: the
various lex routines now don't return a token when the current lexer changes,
and at the top level Preprocessor::Lex() now loops until it finds a token.
Normally, the recursion wouldn't end up being very deep, but the recursion depth
can explode in edge cases like a bunch of consecutive macros which expand to
nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this
patch).

<rdar://problem/14569770>

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

11 years agoAvoid including <stdlib.h> in the intrin.h test
Reid Kleckner [Thu, 19 Sep 2013 00:32:11 +0000 (00:32 +0000)]
Avoid including <stdlib.h> in the intrin.h test

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

11 years agoFix ifdef ordering at the end of Intrin.h from r190965
Reid Kleckner [Thu, 19 Sep 2013 00:19:53 +0000 (00:19 +0000)]
Fix ifdef ordering at the end of Intrin.h from r190965

Test that intrin.h at least parses in C++ TUs.

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

11 years agoDisabling sse2 should disable aes and pclmul support.
Craig Topper [Thu, 19 Sep 2013 00:01:05 +0000 (00:01 +0000)]
Disabling sse2 should disable aes and pclmul support.

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

11 years agoAdd specific warning flags for GNU ext in Sema.
Eli Friedman [Wed, 18 Sep 2013 23:23:17 +0000 (23:23 +0000)]
Add specific warning flags for GNU ext in Sema.

This patch adds the following, more specific warning flags:

gnu-anonymous-struct
gnu-compound-literal-initializer
gnu-empty-struct
gnu-flexible-array-initializer
gnu-flexible-array-union-member
gnu-folding-constant
redeclared-class-member
gnu-redeclared-enum
gnu-union-cast
gnu-variable-sized-type-not-at-end

Patch by Peter Lewis.

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