]> granicus.if.org Git - clang/log
clang
11 years agoSet SRet flags properly in '-cxx-abi microsoft'.
Timur Iskhodzhanov [Wed, 17 Apr 2013 12:54:10 +0000 (12:54 +0000)]
Set SRet flags properly in '-cxx-abi microsoft'.

Also,
- abstract out the indirect/in memory/in registers decisions into the CGCXXABI
- fix handling of empty struct arguments for '-cxx-abi microsoft'
- add/fix tests

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

11 years agoFix PR15291: noreturn adjustment in overload resolution for function templates, from...
Douglas Gregor [Wed, 17 Apr 2013 08:45:07 +0000 (08:45 +0000)]
Fix PR15291: noreturn adjustment in overload resolution for function templates, from Alexander Zinenko!

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

11 years agoExtended VerifyDiagnosticConsumer to also verify source file for diagnostic.
Andy Gibbs [Wed, 17 Apr 2013 08:06:46 +0000 (08:06 +0000)]
Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.

VerifyDiagnosticConsumer previously would not check that the diagnostic and
its matching directive referenced the same source file.  Common practice was
to create directives that referenced other files but only by line number,
and this led to problems such as when the file containing the directive
didn't have enough lines to match the location of the diagnostic in the
other file, leading to bizarre file formatting and other oddities.

This patch causes VerifyDiagnosticConsumer to match source files as well as
line numbers.  Therefore, a new syntax is made available for directives, for
example:

// expected-error@file:line {{diagnostic message}}

This extends the @line feature where "file" is the file where the diagnostic
is generated.  The @line syntax is still available and uses the current file
for the diagnostic.  "file" can be specified either as a relative or absolute
path - although the latter has less usefulness, I think!  The #include search
paths will be used to locate the file and if it is not found an error will be
generated.

The new check is not optional: if the directive is in a different file to the
diagnostic, the file must be specified.  Therefore, a number of test-cases
have been updated with regard to this.

This closes out PR15613.

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

11 years agoSmall improvements to clang-format documentation and integration
Daniel Jasper [Wed, 17 Apr 2013 07:55:02 +0000 (07:55 +0000)]
Small improvements to clang-format documentation and integration
scripts.

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

11 years agoAdd a bit of a hack to deal with a failing testcase on darwin10 bots.
Eric Christopher [Wed, 17 Apr 2013 07:19:56 +0000 (07:19 +0000)]
Add a bit of a hack to deal with a failing testcase on darwin10 bots.

We currently emit an error message when you try to use thread local
storage on targets that don't support it and testing C++11 thread
locals will trip this. We don't want to xfail the test for all darwin
hosts so add a quick hack to check for darwin10 and disable the
test based on that. Only checking darwin10 because anything earlier
is really old and I don't have a list of what other hosts don't
support tls handy.

Alternate suggestions welcome!

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

11 years agoRemove dead option.
Eric Christopher [Wed, 17 Apr 2013 07:19:52 +0000 (07:19 +0000)]
Remove dead option.

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

11 years agoAdd warning group -Woverloaded-shift-op-parentheses to -Wparentheses. This
Richard Trieu [Wed, 17 Apr 2013 02:12:45 +0000 (02:12 +0000)]
Add warning group -Woverloaded-shift-op-parentheses to -Wparentheses.  This
will fire on code such as:

  cout << x == 0;

which the compiler will intrepret as

  (cout << x) == 0;

This warning comes with two fixits attached to notes, one for parentheses to
silence the warning, and another to evaluate the comparison first.

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

11 years agoCorrect the range returned by ParmVarDecl::getSourceRange(), for parameters in ObjC...
Argyrios Kyrtzidis [Wed, 17 Apr 2013 01:56:48 +0000 (01:56 +0000)]
Correct the range returned by ParmVarDecl::getSourceRange(), for parameters in ObjC methods with postfix types.

For a parameter in a method like this:

-(int)methodWithFn:(void (*)(int *p))fn;

we would return the source range of the type and not include the parameter name.

Fixes rdar://13668626.

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

11 years ago[analyzer] Merge C++ status page into Open Projects.
Jordan Rose [Wed, 17 Apr 2013 00:57:39 +0000 (00:57 +0000)]
[analyzer] Merge C++ status page into Open Projects.

Also, add a few random extra open projects.

Most of C++ support is done; we don't need the status page anymore. We're
hoping that the C++-related open projects are the only major pieces of
functionality we don't model at this point.

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

11 years ago[analyzer] Open Projects: grammar, phrasing, formatting
Jordan Rose [Wed, 17 Apr 2013 00:57:24 +0000 (00:57 +0000)]
[analyzer] Open Projects: grammar, phrasing, formatting

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

11 years agoTest cases for r179655.
Chad Rosier [Wed, 17 Apr 2013 00:12:09 +0000 (00:12 +0000)]
Test cases for r179655.

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

11 years agoUse the extra info in global method pool to speed up looking for ObjC overridden...
Argyrios Kyrtzidis [Wed, 17 Apr 2013 00:09:08 +0000 (00:09 +0000)]
Use the extra info in global method pool to speed up looking for ObjC overridden methods.

When we are in a implementation, we check the global method pool whether there were category
methods with the same selector. If there were none (common case) we don't need to do lookups for
overridden methods again.

Note that for an interface method (if we don't encounter its implementation), it is considered that
it overrides methods that were declared before it, not for category methods introduced after it.

This is tradeoff in favor of performance, since it is expensive to do lookups in case there was a
category, and moving the global method pool to ASTContext (so we can check it) would increase complexity.

rdar://13508196

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

11 years agoIn ASTContext::getOverriddenMethods, call overridden_methods_begin/overridden_methods...
Argyrios Kyrtzidis [Wed, 17 Apr 2013 00:09:03 +0000 (00:09 +0000)]
In ASTContext::getOverriddenMethods, call overridden_methods_begin/overridden_methods_end directly.

This avoids unnecessary Decl::getASTContext() invocations.

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

11 years agoEnhance the ObjC global method pool to record whether there were 0, 1, or >= 2 method...
Argyrios Kyrtzidis [Wed, 17 Apr 2013 00:08:58 +0000 (00:08 +0000)]
Enhance the ObjC global method pool to record whether there were 0, 1, or >= 2 methods (with a particular selector) inside categories.

This is done by extending ObjCMethodList (which is only used by the global method pool) to have 2 extra bits of information.
We will later take advantage of this info in global method pool for the overridden methods calculation.

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

11 years ago[6/6] ARM Neon Intrinsic Tablegen Test Generator.
Michael Gottesman [Tue, 16 Apr 2013 23:00:26 +0000 (23:00 +0000)]
[6/6] ARM Neon Intrinsic Tablegen Test Generator.

Added GenerateChecksForIntrinsic method to generate FileCheck patterns
for generated arm neon tests.

Reviewed by Bob Wilson.

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

11 years ago[5/6] ARM Neon Intrinsic Tablegen Test Generator.
Michael Gottesman [Tue, 16 Apr 2013 22:55:01 +0000 (22:55 +0000)]
[5/6] ARM Neon Intrinsic Tablegen Test Generator.

Changed the test generation target cpu type from cortex-a9 to swift.

Reviewed by Bob Wilson.

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

11 years ago[4/6] ARM Neon Intrinsic Tablegen Test Generator.
Michael Gottesman [Tue, 16 Apr 2013 22:48:52 +0000 (22:48 +0000)]
[4/6] ARM Neon Intrinsic Tablegen Test Generator.

Added code to NeonEmitter::runTests so that GenTest gets all of the needed
arguments to invoke the neon test generation methods.

Reviewed by Bob Wilson.

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

11 years agoDon't propagate around TargetOptions in IR-gen; we don't use it.
John McCall [Tue, 16 Apr 2013 22:48:20 +0000 (22:48 +0000)]
Don't propagate around TargetOptions in IR-gen; we don't use it.

Patch by Stephen Lin!

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

11 years agoStandardize accesses to the TargetInfo in IR-gen.
John McCall [Tue, 16 Apr 2013 22:48:15 +0000 (22:48 +0000)]
Standardize accesses to the TargetInfo in IR-gen.

Patch by Stephen Lin!

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

11 years agoDon't put too much thought into whether or not to capture a
John McCall [Tue, 16 Apr 2013 22:32:04 +0000 (22:32 +0000)]
Don't put too much thought into whether or not to capture a
type-dependent intermediate result in a postfix ++ pseudo-
object operation.

Test case by Tong Shen.

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

11 years ago[3/6] ARM Neon Intrinsic Tablegen Test Generator.
Michael Gottesman [Tue, 16 Apr 2013 22:07:30 +0000 (22:07 +0000)]
[3/6] ARM Neon Intrinsic Tablegen Test Generator.

Refactored out the method InstructionTypeCode from MangleName for use in
further patches which perform neon tablegen test generation.

Reviewed by Bob Wilson.

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

11 years agoMake test portable.
Ted Kremenek [Tue, 16 Apr 2013 21:59:21 +0000 (21:59 +0000)]
Make test portable.

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

11 years ago[analyzer] Add experimental option "leak-diagnostics-reference-allocation".
Ted Kremenek [Tue, 16 Apr 2013 21:44:22 +0000 (21:44 +0000)]
[analyzer] Add experimental option "leak-diagnostics-reference-allocation".

This is an opt-in tweak for leak diagnostics to reference the allocation
site if the diagnostic consumer only wants a pithy amount of information,
and not the entire path.

This is a strawman enhancement that I expect to see some experimentation
with over the next week, and can go away if we don't want it.

Currently it is only used by RetainCountChecker, but could be used
by MallocChecker if and when we decide this should stay in.

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

11 years ago[analyzer] Add Open Projects page to the analyzer website
Anna Zaks [Tue, 16 Apr 2013 21:37:04 +0000 (21:37 +0000)]
[analyzer] Add Open Projects page to the analyzer website

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

11 years agoobjc_autoreleasePoolPop() can throw if a -dealloc does.
John McCall [Tue, 16 Apr 2013 21:29:40 +0000 (21:29 +0000)]
objc_autoreleasePoolPop() can throw if a -dealloc does.
Model it as throwing so that the exception can be caught.

This is generally not expected to have significant code-size
impact because the contents of the @autoreleasepool block
are very likely to contain a call, very likely at the same
cleanup level as the @autoreleasepool itself.

rdar://13660038

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

11 years agoTrying fixing test to make buildbot happy again.
Fariborz Jahanian [Tue, 16 Apr 2013 21:19:17 +0000 (21:19 +0000)]
Trying fixing test to make buildbot happy again.

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

11 years ago[2/6] ARM Neon Intrinsic Tablegen Test Generator.
Michael Gottesman [Tue, 16 Apr 2013 21:18:42 +0000 (21:18 +0000)]
[2/6] ARM Neon Intrinsic Tablegen Test Generator.

This patch causes OpInst records to be silently identified with their Non-Op
inst counterparts so that the same test generation infrastructure can be used to
generate tests.

Reviewed by Bob Wilson.

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

11 years agoProperly sort list.
Ted Kremenek [Tue, 16 Apr 2013 21:10:09 +0000 (21:10 +0000)]
Properly sort list.

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

11 years agoFactor CheckerManager to be able to pass AnalyzerOptions to checkers
Ted Kremenek [Tue, 16 Apr 2013 21:10:05 +0000 (21:10 +0000)]
Factor CheckerManager to be able to pass AnalyzerOptions to checkers
during checker registration.  There are no immediate clients of this,
but this provides a way for checkers to query the options table
at startup instead.

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

11 years agoRemove unused "getConfig()" method. A new way is to have high-level
Ted Kremenek [Tue, 16 Apr 2013 21:10:02 +0000 (21:10 +0000)]
Remove unused "getConfig()" method.  A new way is to have high-level
APIs that access the configuration table without clients reasoning
about the string table.  The string table is an implementation
detail.

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

11 years ago[1/6] ARM Neon Intrinsic Tablegen Test Generator.
Michael Gottesman [Tue, 16 Apr 2013 21:08:04 +0000 (21:08 +0000)]
[1/6] ARM Neon Intrinsic Tablegen Test Generator.

Changes necessary to arm_neon.td for the generation of Neon tests.

This is the first of six patches to add to the arm neon tablegen
generator the capability of generating tests to verify that the various
ARM intrinsics are implemented properly.

The changes include such items as:
  1. Adding attributes to the Inst record so that additional metadata that is only
     needed for the tests can be specified in TableGen.
  2. Adding wrapper classes for operator (i.e. ``Op'') intrinsics which before
     were simply notates as Inst. This allows us to classify what sort of test
     to generate for said intrinsic and further since the classes do not effect
     the behavior of the Inst base class, allow for normal functioning.

Reviewed by Bob Wilson.

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

11 years agoSema for Captured Statements
Tareq A. Siraj [Tue, 16 Apr 2013 19:37:38 +0000 (19:37 +0000)]
Sema for Captured Statements

Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic
analysis. Currently captures all variables by reference.

TODO: templates

Author: Ben Langmuir <ben.langmuir@intel.com>

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

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

11 years agorewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency.
Benjamin Kramer [Tue, 16 Apr 2013 19:08:41 +0000 (19:08 +0000)]
rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency.

This broke e.g. compiling a crash report from a glibc system on Darwin. Sadly,
the implementation had to game the lexer a lot as we're not using a real
preprocessor here. It also doesn't handle special cases like arbitrary macros in
__has_include, but since this macro isn't common outside of clang's headers we
can get away with that.

Fixes PR14422.

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

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

11 years agoImplement CapturedStmt AST
Tareq A. Siraj [Tue, 16 Apr 2013 18:53:08 +0000 (18:53 +0000)]
Implement CapturedStmt AST

CapturedStmt can be used to implement generic function outlining as described in
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html.

CapturedStmt is not exposed to the C api.

Serialization and template support are pending.

Author: Wei Pan <wei.pan@intel.com>

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

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

11 years agoParser support for #pragma clang __debug captured
Tareq A. Siraj [Tue, 16 Apr 2013 18:41:26 +0000 (18:41 +0000)]
Parser support for #pragma clang __debug captured

This patch implements parsing ‘#pragma clang __debug’ as a first step for
implementing captured statements. Captured statements are a mechanism for
doing outlining in the AST.
see http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html.

Currently returns StmtEmpty

Author: Andy Zhang <andy.zhang@intel.com>

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

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

11 years ago[Modules] Convert module specific -fno-modules-autolink into -fno-autolink.
Daniel Dunbar [Tue, 16 Apr 2013 18:21:19 +0000 (18:21 +0000)]
[Modules] Convert module specific -fno-modules-autolink into -fno-autolink.

 - There is no reason to have a modules specific flag for disabling
   autolinking. Instead, convert the existing flag into -fno-autolink (which
   should cover other autolinking code generation paths like #pragmas if and
   when we support them).

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

11 years agomodify test to try to make buildbot happy.
Fariborz Jahanian [Tue, 16 Apr 2013 17:18:37 +0000 (17:18 +0000)]
modify test to try to make buildbot happy.

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

11 years agoRemove setjmp.h header file from Sema/return.c test and include necessary
Jyotsna Verma [Tue, 16 Apr 2013 16:10:38 +0000 (16:10 +0000)]
Remove setjmp.h header file from Sema/return.c test and include necessary
declarations explicitly in the test.

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

11 years agoFix PR4296: Add parser detection/error recovery for nested functions, from Serve...
Douglas Gregor [Tue, 16 Apr 2013 16:01:32 +0000 (16:01 +0000)]
Fix PR4296: Add parser detection/error recovery for nested functions, from Serve Pavlov!

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

11 years agoUse -emit-llvm for the following tests to stop them from failing for Hexagon:
Jyotsna Verma [Tue, 16 Apr 2013 15:55:41 +0000 (15:55 +0000)]
Use -emit-llvm for the following tests to stop them from failing for Hexagon:

CodeGenCXX/vtable-debug-info.cpp
Driver/objc++-cpp-output.mm
Driver/objc-cpp-output.m

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

11 years agoFix handling of atomic shift operations, from Serge Pavlov.
Douglas Gregor [Tue, 16 Apr 2013 15:41:08 +0000 (15:41 +0000)]
Fix handling of atomic shift operations, from Serge Pavlov.

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

11 years agoObjective-C IRGen. Use llvm::WeakVH
Fariborz Jahanian [Tue, 16 Apr 2013 15:25:39 +0000 (15:25 +0000)]
Objective-C IRGen. Use llvm::WeakVH
for caching couple of global symbols used
for generation of CF/NS string meta-data
so they are not released prematuely in certain
corner cases. // rdar:// 13598026.
Reviewed by John M.

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

11 years agoSuppress unused warning on static inline function template specializations.
Rafael Espindola [Tue, 16 Apr 2013 15:21:30 +0000 (15:21 +0000)]
Suppress unused warning on static inline function template specializations.

Patch by Halfdan Ingvarsson!

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

11 years agoAdd support for sparcv9 targets.
Jakob Stoklund Olesen [Tue, 16 Apr 2013 15:17:49 +0000 (15:17 +0000)]
Add support for sparcv9 targets.

The SPARC v8 and SPARC v8 architectures are very similar, so use a base
class to share most information between them.

Include operating systems with known SPARC v9 ports.

Also fix two issues with the SPARC v8 data layout string: SPARC v8 is a
big endian target with a 64-bit aligned stack.

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

11 years agoBasic support for Microsoft property declarations and
John McCall [Tue, 16 Apr 2013 07:28:30 +0000 (07:28 +0000)]
Basic support for Microsoft property declarations and
references thereto.

Patch by Tong Shen!

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

11 years agoCorrectly propagate the storage class to function template instantiations.
Rafael Espindola [Tue, 16 Apr 2013 02:29:15 +0000 (02:29 +0000)]
Correctly propagate the storage class to function template instantiations.

This fixes pr15753. This is another case of the fuzzy definition of the
"as written" storage class of an instantiation.

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

11 years ago[analyzer] Improve the malloc checker stack hint message
Anna Zaks [Tue, 16 Apr 2013 00:22:55 +0000 (00:22 +0000)]
[analyzer] Improve the malloc checker stack hint message

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

11 years ago[analyzer] Do not crash when processing binary "?:" in C++
Anna Zaks [Mon, 15 Apr 2013 22:38:07 +0000 (22:38 +0000)]
[analyzer] Do not crash when processing binary "?:" in C++

When computing the value of ?: expression, we rely on the last expression in
the previous basic block to be the resulting value of the expression. This is
not the case for binary "?:" operator (GNU extension) in C++. As the last
basic block has the expression for the condition subexpression, which is an
R-value, whereas the true subexpression is the L-value.

Note the operator evaluation just happens to work in C since the true
subexpression is an R-value (like the condition subexpression). CFG is the
same in C and C++ case, but the AST nodes are different, which the LValue to
Rvalue conversion happening after the BinaryConditionalOperator evaluation.

Changed the logic to only use the last expression from the predecessor only
if it matches either true or false subexpression. Note, the logic needed
fortification anyway: L and R were passed but not even used by the function.

Also, change the conjureSymbolVal to correctly compute the type, when the
expression is an LG-value.

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

11 years ago[analyzer] Add pretty printing to CXXBaseObjectRegion.
Anna Zaks [Mon, 15 Apr 2013 22:38:04 +0000 (22:38 +0000)]
[analyzer] Add pretty printing to CXXBaseObjectRegion.

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

11 years ago[analyzer] Address code review for r179395
Anna Zaks [Mon, 15 Apr 2013 22:37:59 +0000 (22:37 +0000)]
[analyzer] Address code review for r179395

Mostly refactoring + handle the nested fields by printing the innermost field only.

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

11 years ago[analyzer] Add more specialized error messages for corner cases as per Jordan's code...
Anna Zaks [Mon, 15 Apr 2013 22:37:53 +0000 (22:37 +0000)]
[analyzer] Add more specialized error messages for corner cases as per Jordan's code review for r179396

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

11 years agoBreak after multiline parameters.
Daniel Jasper [Mon, 15 Apr 2013 22:36:37 +0000 (22:36 +0000)]
Break after multiline parameters.

We do this in general, but missed a few cases.

Before:
void aaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbb bbbb);

After:
void aaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
    bbbb bbbb);

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

11 years ago[analyzer] Don't assert on a temporary of pointer-to-member type.
Jordan Rose [Mon, 15 Apr 2013 22:03:38 +0000 (22:03 +0000)]
[analyzer] Don't assert on a temporary of pointer-to-member type.

While we don't do anything intelligent with pointers-to-members today,
it's perfectly legal to need a temporary of pointer-to-member type to, say,
pass by const reference. Tweak an assertion to allow this.

PR15742 and PR15747

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

11 years agoRemove some dead code that has not been used since 2010.
Joey Gouly [Mon, 15 Apr 2013 21:13:33 +0000 (21:13 +0000)]
Remove some dead code that has not been used since 2010.

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

11 years ago[analyzer] Be lazy about struct/array global invalidation too.
Jordan Rose [Mon, 15 Apr 2013 20:39:48 +0000 (20:39 +0000)]
[analyzer] Be lazy about struct/array global invalidation too.

Structs and arrays can take advantage of the single top-level global
symbol optimization (described in the previous commit) just as well
as scalars.

No intended behavioral change.

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

11 years ago[analyzer] Re-enable using global regions as a symbolic base.
Jordan Rose [Mon, 15 Apr 2013 20:39:45 +0000 (20:39 +0000)]
[analyzer] Re-enable using global regions as a symbolic base.

Now that we're invalidating global regions properly, we want to continue
taking advantage of a particular optimization: if all global regions are
invalidated together, we can represent the bindings of each region with
a "derived region value" symbol. Essentially, this lazily links each
global region with a single symbol created at invalidation time, rather
than binding each region with a new symbolic value.

We used to do this, but haven't been for a while; the previous commit
re-enabled this code path, and this handles the fallout.

<rdar://problem/13464044>

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

11 years ago[analyzer] Properly invalidate global regions on opaque function calls.
Jordan Rose [Mon, 15 Apr 2013 20:39:41 +0000 (20:39 +0000)]
[analyzer] Properly invalidate global regions on opaque function calls.

This fixes a regression where a call to a function we can't reason about
would not actually invalidate global regions that had explicit bindings.

  void test_that_now_works() {
    globalInt = 42;
    clang_analyzer_eval(globalInt == 42); // expected-warning{{TRUE}}

    invalidateGlobals();
    clang_analyzer_eval(globalInt == 42); // expected-warning{{UNKNOWN}}
  }

This has probably been around since the initial "cluster" refactoring of
RegionStore, if not longer.

<rdar://problem/13464044>

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

11 years ago[analyzer] Tests: move system functions into system header simulator files.
Jordan Rose [Mon, 15 Apr 2013 20:39:37 +0000 (20:39 +0000)]
[analyzer] Tests: move system functions into system header simulator files.

Some checkers ascribe different behavior to functions declared in system
headers, so when working with standard library functions it's probably best
to always have them in a standard location.

Test change only (no functionality change), but necessary for the next commit.

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

11 years agoRevert "Speed-up ObjCMethodDecl::getOverriddenMethods()."
Argyrios Kyrtzidis [Mon, 15 Apr 2013 18:47:22 +0000 (18:47 +0000)]
Revert "Speed-up ObjCMethodDecl::getOverriddenMethods()."

This reverts commit r179436.

Due to caching, it was possible that we could miss overridden methods that
were introduced by categories later on.

Along with reverting the commit I also included a test case that would have caught this.

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

11 years agoRemove XFAIL now that the test is standalone.
Rafael Espindola [Mon, 15 Apr 2013 17:06:15 +0000 (17:06 +0000)]
Remove XFAIL now that the test is standalone.

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

11 years ago[PCH/test] Make test/PCH/cxx-typeid.cpp self-contained by including the relevant...
Argyrios Kyrtzidis [Mon, 15 Apr 2013 16:52:57 +0000 (16:52 +0000)]
[PCH/test] Make test/PCH/cxx-typeid.cpp self-contained by including the relevant standard library declarations
instead of depending on a system header inclusion.

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

11 years agoFix unused variable warning with assertions disabled.
Alexander Kornienko [Mon, 15 Apr 2013 15:47:34 +0000 (15:47 +0000)]
Fix unused variable warning with assertions disabled.

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

11 years agoUse llvm::sys::IsBigEndianHost.
Rafael Espindola [Mon, 15 Apr 2013 15:10:35 +0000 (15:10 +0000)]
Use llvm::sys::IsBigEndianHost.

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

11 years agoUnified token breaking logic for strings and block comments.
Alexander Kornienko [Mon, 15 Apr 2013 14:28:00 +0000 (14:28 +0000)]
Unified token breaking logic for strings and block comments.

Summary:
Both strings and block comments are broken into lines in
breakProtrudingToken. Logic specific for strings or block comments is abstracted
in implementations of the BreakToken interface. Among other goodness, this
change fixes placement of backslashes after a block comment inside a
preprocessor directive (see removed FIXMEs in unit tests).

The code is far from being polished, and some parts of it will be changed for
line comments support.

Reviewers: klimek

Reviewed By: klimek

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

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

11 years agoAdd a missing space
Timur Iskhodzhanov [Mon, 15 Apr 2013 14:16:31 +0000 (14:16 +0000)]
Add a missing space

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

11 years agoRemove hasExternalLinkageUncached.
Rafael Espindola [Mon, 15 Apr 2013 12:49:13 +0000 (12:49 +0000)]
Remove hasExternalLinkageUncached.

It was being used correctly, but it is a very dangerous API to have around.
Instead, move the logic from the filtering to when we are deciding if we should
link two decls.

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

11 years agoFix the storage class of method instantiations.
Rafael Espindola [Mon, 15 Apr 2013 12:38:20 +0000 (12:38 +0000)]
Fix the storage class of method instantiations.

We keep the "as written" storage class, but that is a fuzzy concept for
instantiations. With this patch instantiations of methods of class templates
now get a storage class that is based on the semantics of isStatic(). With this
can simplify isStatic() itself.

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

11 years agoRemove reference to MSVC only building X86 backend.
Tim Northover [Mon, 15 Apr 2013 11:55:27 +0000 (11:55 +0000)]
Remove reference to MSVC only building X86 backend.

This is no longer true.

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

11 years agoLocal thread_local variables are implicitly 'static'. (This doesn't apply to _Thread_...
Richard Smith [Mon, 15 Apr 2013 08:33:22 +0000 (08:33 +0000)]
Local thread_local variables are implicitly 'static'. (This doesn't apply to _Thread_local nor __thread.)

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

11 years agoProperly check for a constant initializer for a thread-local variable.
Richard Smith [Mon, 15 Apr 2013 08:07:34 +0000 (08:07 +0000)]
Properly check for a constant initializer for a thread-local variable.

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

11 years agoAdd triple to another test.
Richard Smith [Mon, 15 Apr 2013 08:02:05 +0000 (08:02 +0000)]
Add triple to another test.

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

11 years agoAdd triples to these tests since they're now using TLS, which isn't available on...
Richard Smith [Mon, 15 Apr 2013 08:00:15 +0000 (08:00 +0000)]
Add triples to these tests since they're now using TLS, which isn't available on all targets.

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

11 years agoAdd a new flag -vectorize-slp-aggressive to enable Hals BB vectorizer.
Nadav Rotem [Mon, 15 Apr 2013 05:38:41 +0000 (05:38 +0000)]
Add a new flag -vectorize-slp-aggressive to enable Hals BB vectorizer.

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

11 years agoRename the slp-vectorizer clang/llvm flags. No functionality change.
Nadav Rotem [Mon, 15 Apr 2013 04:57:18 +0000 (04:57 +0000)]
Rename the slp-vectorizer clang/llvm flags. No functionality change.

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

11 years agoComment command table: use inheritance instead of duplicating code
Dmitri Gribenko [Mon, 15 Apr 2013 02:31:50 +0000 (02:31 +0000)]
Comment command table: use inheritance instead of duplicating code

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

11 years agoCodeGen support for function-local static thread_local variables with
Richard Smith [Sun, 14 Apr 2013 23:01:42 +0000 (23:01 +0000)]
CodeGen support for function-local static thread_local variables with
non-constant constructors or non-trivial destructors. Plus bugfixes for
thread_local references bound to temporaries (the temporaries themselves are
lifetime-extended to become thread_local), and the corresponding case for
std::initializer_list.

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

11 years agoRemoved #if 0 code that doesn't compiled if uncommented.
Rafael Espindola [Sun, 14 Apr 2013 22:08:07 +0000 (22:08 +0000)]
Removed #if 0 code that doesn't compiled if uncommented.

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

11 years agoDiagnose if a __thread or _Thread_local variable has a non-constant initializer
Richard Smith [Sun, 14 Apr 2013 20:11:31 +0000 (20:11 +0000)]
Diagnose if a __thread or _Thread_local variable has a non-constant initializer
or non-trivial destructor.

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

11 years ago[analyzer] Add a link to the Building a Checker in 24 Hours talk to the developer...
Anna Zaks [Sun, 14 Apr 2013 18:36:51 +0000 (18:36 +0000)]
[analyzer] Add a link to the Building a Checker in 24 Hours talk to the developer manual

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

11 years ago[Mips] Support -mmicromips / -mno-micromips command line options.
Simon Atanasyan [Sun, 14 Apr 2013 14:07:51 +0000 (14:07 +0000)]
[Mips] Support -mmicromips / -mno-micromips command line options.

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

11 years ago[Mips] Fix indentation.
Simon Atanasyan [Sun, 14 Apr 2013 14:07:41 +0000 (14:07 +0000)]
[Mips] Fix indentation.

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

11 years ago[Mips] Follow-up to r179481. Reduce code duplication. Use
Simon Atanasyan [Sun, 14 Apr 2013 14:07:36 +0000 (14:07 +0000)]
[Mips] Follow-up to r179481. Reduce code duplication. Use
AddTargetFeature() routine to handle -msingle-float / -mdouble-float
options.

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

11 years ago[Mips] Follow-up to r179481. Consider "single-float" as a separate
Simon Atanasyan [Sun, 14 Apr 2013 14:07:30 +0000 (14:07 +0000)]
[Mips] Follow-up to r179481. Consider "single-float" as a separate
independent of float ABI feature in the MipsTargetInfoBase class.

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

11 years agoAdd driver support for fedora 18 on ARM.
Rafael Espindola [Sun, 14 Apr 2013 10:14:21 +0000 (10:14 +0000)]
Add driver support for fedora 18 on ARM.

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

11 years agoHandle incompatible redeclarations of library builtins better.
John McCall [Sun, 14 Apr 2013 08:50:55 +0000 (08:50 +0000)]
Handle incompatible redeclarations of library builtins better.
Invalid redeclarations of valid explicit declarations shouldn't
take the same path as redeclarations of implicit declarations,
and invalid local extern declarations shouldn't foul things up
for everybody else.

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

11 years ago[Mips] Remove "single" from the list of valid MIPS float ABI names. Add
Simon Atanasyan [Sun, 14 Apr 2013 08:37:15 +0000 (08:37 +0000)]
[Mips] Remove "single" from the list of valid MIPS float ABI names. Add
two new options –msingle-float and –mdouble-float. These options can be
used simultaneously with float ABI selection options (-mfloat-abi,
-mhard-float, -msoft-float). They mark whether a floating-point
coprocessor supports double-precision operations.

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

11 years agoSimplify test so that it is more portable.
Rafael Espindola [Sat, 13 Apr 2013 22:26:02 +0000 (22:26 +0000)]
Simplify test so that it is more portable.

I have checked that the test still fails when the "|| !P.isRegularFile()" from
the original patch is removed.

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

11 years agoRemove duplicated comment.
Simon Atanasyan [Sat, 13 Apr 2013 06:43:15 +0000 (06:43 +0000)]
Remove duplicated comment.

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

11 years agoAnnotate flavor of TLS variable (statically or dynamically initialized) onto the...
Richard Smith [Sat, 13 Apr 2013 02:43:54 +0000 (02:43 +0000)]
Annotate flavor of TLS variable (statically or dynamically initialized) onto the AST.

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

11 years agoUse MapVector rather than simulating it.
Richard Smith [Sat, 13 Apr 2013 01:28:18 +0000 (01:28 +0000)]
Use MapVector rather than simulating it.

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

11 years agoSpeed-up ObjCMethodDecl::getOverriddenMethods().
Argyrios Kyrtzidis [Sat, 13 Apr 2013 01:04:01 +0000 (01:04 +0000)]
Speed-up ObjCMethodDecl::getOverriddenMethods().

Use an newly introduce ASTContext::getBaseObjCCategoriesAfterInterface() which caches its
results instead of re-calculating the categories multiple times.

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

11 years agoIntroduce SourceManager::getDecomposedIncludedLoc, that returns the "included/expande...
Argyrios Kyrtzidis [Sat, 13 Apr 2013 01:03:57 +0000 (01:03 +0000)]
Introduce SourceManager::getDecomposedIncludedLoc, that returns the "included/expanded in" decomposed location of the given FileID.

The main benefit is to speed-up SourceManager::isBeforeInTranslationUnit which is common to query
the included/expanded location of the same FileID multiple times.

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

11 years agoGive this test a triple so that its use of thread_local doesn't make it fail on the...
Richard Smith [Sat, 13 Apr 2013 00:34:48 +0000 (00:34 +0000)]
Give this test a triple so that its use of thread_local doesn't make it fail on the MSVC bot.

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

11 years agoDon't replace an existing decl in the scope chains with its
John McCall [Sat, 13 Apr 2013 00:20:21 +0000 (00:20 +0000)]
Don't replace an existing decl in the scope chains with its
local-extern redeclaration;  type refinements, default arguments,
etc. must all be locally scoped.

rdar://13535367

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

11 years agoHeaders: Don't try to use RSIZE_MAX unless we are freestanding.
Daniel Dunbar [Fri, 12 Apr 2013 23:41:08 +0000 (23:41 +0000)]
Headers: Don't try to use RSIZE_MAX unless we are freestanding.
 - We don't want to depend on the platforms stdint.h.

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

11 years ago[analyzer] Enable NewDelete checker if NewDeleteLeaks checker is enabled.
Anton Yartsev [Fri, 12 Apr 2013 23:25:40 +0000 (23:25 +0000)]
[analyzer] Enable NewDelete checker if NewDeleteLeaks checker is enabled.

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

11 years agoHeaders: Add support for ISO9899:2011 rsize_t.
Daniel Dunbar [Fri, 12 Apr 2013 23:24:56 +0000 (23:24 +0000)]
Headers: Add support for ISO9899:2011 rsize_t.

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

11 years agoNewDeleteLeaks is a subchecker of NewDelete checker; it is tested in NewDelete-checke...
Anton Yartsev [Fri, 12 Apr 2013 23:18:46 +0000 (23:18 +0000)]
NewDeleteLeaks is a subchecker of NewDelete checker; it is tested in NewDelete-checker-test.cpp

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

11 years agoParsing support for thread_local and _Thread_local. We give them the same
Richard Smith [Fri, 12 Apr 2013 22:46:28 +0000 (22:46 +0000)]
Parsing support for thread_local and _Thread_local. We give them the same
semantics as __thread for now.

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

11 years agotl;dr: Teach Clang to work around g++ changing its workaround to glibc's
Richard Smith [Fri, 12 Apr 2013 22:11:07 +0000 (22:11 +0000)]
tl;dr: Teach Clang to work around g++ changing its workaround to glibc's
implementation of C99's attempt to control the C++ standard. *sigh*

The C99 standard says that certain macros in <stdint.h>, such as SIZE_MAX,
should not be defined when the header is included in C++ mode, unless
__STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined. The C++11 standard
says "Thanks, but no thanks" and C11 removed this rule, but various C library
implementations (such as glibc) follow C99 anyway.

g++ prior to 4.8 worked around the C99 / glibc behavior by defining
__STDC_*_MACROS in <cstdint>, which was incorrect, because <stdint.h> is
supposed to provide these macros too. g++ 4.8 works around it by defining
__STDC_*_MACROS in its builtin <stdint.h> header.

This change makes Clang act like g++ 4.8 in this regard: our <stdint.h> now
countermands any attempt by the C library to implement the undesired C99 rules,
by defining the __STDC_*_MACROS first. Unlike g++, we do this even in C++98
mode, since that was the intent of the C++ committee, matches the behavior
required in C11, and matches our built-in implementation of <stdint.h>.

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