]> granicus.if.org Git - clang/log
clang
12 years agozext ivar offsets if required (GNU runtimes).
David Chisnall [Fri, 6 Apr 2012 15:39:12 +0000 (15:39 +0000)]
zext ivar offsets if required (GNU runtimes).

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

12 years agoFixed scoping error for late parsed attributes in nested classes.
DeLesley Hutchins [Fri, 6 Apr 2012 15:10:17 +0000 (15:10 +0000)]
Fixed scoping error for late parsed attributes in nested classes.

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

12 years agoMIPS: Add tests for predefined macros for MIPS targets.
Simon Atanasyan [Fri, 6 Apr 2012 08:37:24 +0000 (08:37 +0000)]
MIPS: Add tests for predefined macros for MIPS targets.

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

12 years agoFix diagnostic text for r154163.
David Blaikie [Fri, 6 Apr 2012 06:28:32 +0000 (06:28 +0000)]
Fix diagnostic text for r154163.

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

12 years agoRestrict fixit for missing 'class' in template template parameters.
David Blaikie [Fri, 6 Apr 2012 05:26:43 +0000 (05:26 +0000)]
Restrict fixit for missing 'class' in template template parameters.

Based on Doug's feedback to r153887 this omits the FixIt if the following token
isn't syntactically valid for the context. (not a comma, '...', identifier,
'>', or '>>')

There's a bunch of work to handle the '>>' case, but it makes for a much more
pleasant diagnostic in this case.

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

12 years ago[analyzer]Fix false positive: pointer might escape through CG*WithData.
Anna Zaks [Fri, 6 Apr 2012 01:00:47 +0000 (01:00 +0000)]
[analyzer]Fix false positive: pointer might escape through CG*WithData.

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

12 years agoPoint the caret at the error for the 'expected namespace name' diagnostic in
Richard Smith [Thu, 5 Apr 2012 23:13:23 +0000 (23:13 +0000)]
Point the caret at the error for the 'expected namespace name' diagnostic in
a namespace alias declaration.

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

12 years agoImplement C90 pedantic warning for duplicate declaration specifiers which are duplica...
Eli Friedman [Thu, 5 Apr 2012 22:47:34 +0000 (22:47 +0000)]
Implement C90 pedantic warning for duplicate declaration specifiers which are duplicated via a typedef.  Patch by Tim Northover.

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

12 years agoProperly implement the C rules for composite types for qualified pointers in conditio...
Eli Friedman [Thu, 5 Apr 2012 22:30:04 +0000 (22:30 +0000)]
Properly implement the C rules for composite types for qualified pointers in conditionals.  Patch by Tim Northover.

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

12 years agoobjective-c: Don't warn when a category does not implement a method
Fariborz Jahanian [Thu, 5 Apr 2012 22:14:12 +0000 (22:14 +0000)]
objective-c: Don't warn when a category does not implement a method
declared in its adopted protocol when another category declares it
because that category will implement it. // rdar://11186449

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

12 years agoEnhance testing a bit to make sure that we're omitting the
Eric Christopher [Thu, 5 Apr 2012 22:03:35 +0000 (22:03 +0000)]
Enhance testing a bit to make sure that we're omitting the
getter and setter when they're synthesized with the default
names.

rdar://11179756

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

12 years agoOnly emit the getter and setter names if they're not the default
Eric Christopher [Thu, 5 Apr 2012 22:03:32 +0000 (22:03 +0000)]
Only emit the getter and setter names if they're not the default
synthesized ones. Reasonable debug info size reduction for objc.

rdar://11179756

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

12 years agoMake the variant of __builtin_shufflevector that takes the shuffle indexes as a vecto...
Eli Friedman [Thu, 5 Apr 2012 21:48:40 +0000 (21:48 +0000)]
Make the variant of __builtin_shufflevector that takes the shuffle indexes as a vector actually usable. Patch by David Neto.  PR12465.

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

12 years agoRequire that all static analyzer issues have a category. As part of this change,
Ted Kremenek [Thu, 5 Apr 2012 20:43:28 +0000 (20:43 +0000)]
Require that all static analyzer issues have a category.  As part of this change,
consolidate some commonly used category strings into global references (more of this can be done, I just did a few).

Fixes <rdar://problem/11191537>.

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

12 years agoMove some MIPS target macro definitions from class Mips32TargetInfoBase
Simon Atanasyan [Thu, 5 Apr 2012 19:28:31 +0000 (19:28 +0000)]
Move some MIPS target macro definitions from class Mips32TargetInfoBase
to the base class MipsTargetInfoBase. These macros are applicable for both
32/64-bits targets.

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

12 years agoTemporary workaround for bug#12457: turn the 'constexpr function never produces
Richard Smith [Thu, 5 Apr 2012 18:57:10 +0000 (18:57 +0000)]
Temporary workaround for bug#12457: turn the 'constexpr function never produces
a constant expression' error into a DefaultError ExtWarn, so that it can be
disabled and is suppressed in system headers. libstdc++4.7 contains some such
functions which we currently can't evaluate as constant expressions.

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

12 years ago[Lex] Add support for 'user specified system frameworks' (see test case).
Daniel Dunbar [Thu, 5 Apr 2012 17:10:06 +0000 (17:10 +0000)]
[Lex] Add support for 'user specified system frameworks' (see test case).
 - Developers of system frameworks need a way for their framework to be treated as a "system framework" during development. Otherwise, they are unable to properly test how their framework behaves when installed because of the semantic changes (in warning behavior) applied to system frameworks.

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

12 years ago[Lex] HeaderSearch: Introduce a FrameworkCacheEntry structure to hold the FrameworkMa...
Daniel Dunbar [Thu, 5 Apr 2012 17:09:40 +0000 (17:09 +0000)]
[Lex] HeaderSearch: Introduce a FrameworkCacheEntry structure to hold the FrameworkMap items.
 - No functionality change.

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

12 years agoSimplify.
Daniel Dunbar [Thu, 5 Apr 2012 17:09:11 +0000 (17:09 +0000)]
Simplify.

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

12 years agoImprove & simplify diagnostic for missing 'class' in template template parameter.
David Blaikie [Thu, 5 Apr 2012 16:56:02 +0000 (16:56 +0000)]
Improve & simplify diagnostic for missing 'class' in template template parameter.

Change suggested by Sebastian Redl on review feedback from r153887.

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

12 years agoHandle symbolicating a reference in an initializer expression that we don't understand.
Ted Kremenek [Thu, 5 Apr 2012 05:56:31 +0000 (05:56 +0000)]
Handle symbolicating a reference in an initializer expression that we don't understand.

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

12 years agoTeach ObjCContainersChecker that the array passed to CFArrayGetValueAtIndex might...
Ted Kremenek [Thu, 5 Apr 2012 05:18:05 +0000 (05:18 +0000)]
Teach ObjCContainersChecker that the array passed to CFArrayGetValueAtIndex might not be a symbolic value.

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

12 years agoDo not crash in the callgraph construction when encountering deleted function definit...
Ted Kremenek [Thu, 5 Apr 2012 04:03:23 +0000 (04:03 +0000)]
Do not crash in the callgraph construction when encountering deleted function definitions.  Fixes <rdar://problem/11178609>.

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

12 years ago[analyzer] Move stats calculation out of AnalysisConsumer destructor.
Anna Zaks [Thu, 5 Apr 2012 02:10:21 +0000 (02:10 +0000)]
[analyzer] Move stats calculation out of AnalysisConsumer destructor.
The ASTConsumer does not get deleted with clang --analyze (for
performance reasons), we still want the diagnostics to work.

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

12 years ago[analyzer] Change warding in a path diagnostic:
Anna Zaks [Thu, 5 Apr 2012 02:10:19 +0000 (02:10 +0000)]
[analyzer] Change warding in a path diagnostic:
"No method actually called because receiver is nil" ->
"No method is called because receiver is nil"

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

12 years ago[analyzer] Add a coverage calculation to FunctionSummaries.
Anna Zaks [Thu, 5 Apr 2012 02:10:17 +0000 (02:10 +0000)]
[analyzer] Add a coverage calculation to FunctionSummaries.

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

12 years ago[analyzer] Remove redundant if statement (pointed out by Ted).
Anna Zaks [Thu, 5 Apr 2012 02:10:14 +0000 (02:10 +0000)]
[analyzer] Remove redundant if statement (pointed out by Ted).

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

12 years agoImprove diagnostics for invalid use of non-static members / this:
Richard Smith [Thu, 5 Apr 2012 01:13:04 +0000 (01:13 +0000)]
Improve diagnostics for invalid use of non-static members / this:

* s/nonstatic/non-static/ in the diagnostics, since the latter form outvoted
  the former by 28-2 in our diagnostics.
* Fix the "use of member in static member function" diagnostic to correctly
  detect this situation inside a block or lambda.
* Produce a more specific "invalid use of non-static member" diagnostic for
  the case where a nested class member refers to a member of a
  lexically-surrounding class.

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

12 years agoAdd triples to these tests to keep them working on Windows,
Richard Smith [Thu, 5 Apr 2012 00:54:51 +0000 (00:54 +0000)]
Add triples to these tests to keep them working on Windows,
where wchar_t is only 16 bits wide.

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

12 years agoRelNote improvements made to -Wliteral-conversion by r141955.
David Blaikie [Thu, 5 Apr 2012 00:47:38 +0000 (00:47 +0000)]
RelNote improvements made to -Wliteral-conversion by r141955.

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

12 years agoFix assertions and wrong output from StmtPrinter's string literal printing.
Richard Smith [Thu, 5 Apr 2012 00:17:44 +0000 (00:17 +0000)]
Fix assertions and wrong output from StmtPrinter's string literal printing.
String literals (including unicode ones) can contain non-Unicode codepoints
if they were written using \x or similar. Write those out using \x, but be
careful that the following character can't be misinterpreted as part of the
\x escape sequence. Convert UTF-16 surrogate pairs back to codepoints before
rendering them.

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

12 years agoEnable warn_impcast_literal_float_to_integer by default.
David Blaikie [Thu, 5 Apr 2012 00:16:44 +0000 (00:16 +0000)]
Enable warn_impcast_literal_float_to_integer by default.

This diagnostic seems to be production ready, it's just an oversight that it
wasn't turned on by default.

The test changes are a bit of a mixed bag. Some tests that seemed like they
clearly didn't need to use this behavior have been modified not to use it.
Others that I couldn't be sure about, I added the necessary expected-warnings
to.

It's possible the diagnostic message could be improved to make it clearer that
this warning can be suppressed by using a value that won't lose precision when
converted to the target type (but can still be a floating point literal, such
as "bool b = 1.0;").

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

12 years agoclang/test/Tooling/clang-check.cpp: Mark it as XFAIL also on cygwin.
NAKAMURA Takumi [Wed, 4 Apr 2012 23:23:19 +0000 (23:23 +0000)]
clang/test/Tooling/clang-check.cpp: Mark it as XFAIL also on cygwin.

It seems clang-check doesn't like gcc driver on cygming. Investigating.

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

12 years agoAllow a conversion from the empty initializer list {} to an
Douglas Gregor [Wed, 4 Apr 2012 23:09:20 +0000 (23:09 +0000)]
Allow a conversion from the empty initializer list {} to an
std::initializer_list<T> so long as <T> is known. This conversion has
identity rank.

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

12 years agoHonor -fno-pic, -fno-PIC, -fno-pie, -fno-PIE.
Nico Weber [Wed, 4 Apr 2012 23:00:14 +0000 (23:00 +0000)]
Honor -fno-pic, -fno-PIC, -fno-pie, -fno-PIE.

Review at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120402/055759.html

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

12 years ago[driver] When using the -mfpmath= option, add an error message when trying to
Chad Rosier [Wed, 4 Apr 2012 22:13:40 +0000 (22:13 +0000)]
[driver] When using the -mfpmath= option, add an error message when trying to
enable neonfp on a CPU that doesn't support NEON.
rdar://11108618

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

12 years agoHardcode a triple to prevent the test failing on targets which don't support __thread.
Richard Smith [Wed, 4 Apr 2012 21:54:03 +0000 (21:54 +0000)]
Hardcode a triple to prevent the test failing on targets which don't support __thread.

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

12 years agoTest commit to check commit access.
Simon Atanasyan [Wed, 4 Apr 2012 21:22:57 +0000 (21:22 +0000)]
Test commit to check commit access.

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

12 years agoImplement C++11 [temp.arg.nontype]'s permission to use the address of an object
Richard Smith [Wed, 4 Apr 2012 21:11:30 +0000 (21:11 +0000)]
Implement C++11 [temp.arg.nontype]'s permission to use the address of an object
or function with internal linkage as a non-type template argument.

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

12 years agoFix an oversight: don't run ARC optimization cleanup at -O0.
Dan Gohman [Wed, 4 Apr 2012 21:04:56 +0000 (21:04 +0000)]
Fix an oversight: don't run ARC optimization cleanup at -O0.

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

12 years agoWhitespace.
Chad Rosier [Wed, 4 Apr 2012 20:56:36 +0000 (20:56 +0000)]
Whitespace.

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

12 years ago[driver] Add a static helper function for handling -mfpu= to remove some code
Chad Rosier [Wed, 4 Apr 2012 20:51:35 +0000 (20:51 +0000)]
[driver] Add a static helper function for handling -mfpu= to remove some code
duplication.  No functional change intended.

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

12 years agoReduce variable scope.
David Blaikie [Wed, 4 Apr 2012 20:43:14 +0000 (20:43 +0000)]
Reduce variable scope.

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

12 years ago[driver] Create a new -mfpmath= option, which is used to control whether clang
Chad Rosier [Wed, 4 Apr 2012 20:39:32 +0000 (20:39 +0000)]
[driver] Create a new -mfpmath= option, which is used to control whether clang
uses Neon instructions for single-precision FP.

-mfpmath=neon is analogous to passing llc -mattr=+neonfp.
-mfpmath=[vfp|vfp2|vfp3|vfp4] is analogous to passing llc -mattr=-neonfp.

rdar://11108618

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

12 years agoobjc-arc: provide a warning when 'receiver' of a message is 'weak'
Fariborz Jahanian [Wed, 4 Apr 2012 20:05:25 +0000 (20:05 +0000)]
objc-arc: provide a warning when 'receiver' of a message is 'weak'
in arc mode and opted-in with -Wreceiver-is-weak flag.
// rdar://10225276

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

12 years agoLook through chains of 'x = y = z' when employing silencing heuristics in the DeadSto...
Ted Kremenek [Wed, 4 Apr 2012 19:58:03 +0000 (19:58 +0000)]
Look through chains of 'x = y = z' when employing silencing heuristics in the DeadStoresChecker.

Fixes <rdar://problem/11185138>.

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

12 years agomodern objc translator. Add more
Fariborz Jahanian [Wed, 4 Apr 2012 18:50:28 +0000 (18:50 +0000)]
modern objc translator. Add more
rewriter specific option to cc1 with -rewrite-objc.
// rdar://11143173

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

12 years agoRemove unused argument.
Fariborz Jahanian [Wed, 4 Apr 2012 18:28:00 +0000 (18:28 +0000)]
Remove unused argument.

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

12 years agoInclude the "issue context" (e.g. function or method) where a static analyzer issue...
Ted Kremenek [Wed, 4 Apr 2012 18:11:35 +0000 (18:11 +0000)]
Include the "issue context" (e.g. function or method) where a static analyzer issue occurred in the plist output.

Fixes <rdar://problem/11004527>

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

12 years agoMove the computation of the lambda mangling information (mangling
Douglas Gregor [Wed, 4 Apr 2012 17:40:10 +0000 (17:40 +0000)]
Move the computation of the lambda mangling information (mangling
number + context) to the point where we initially start defining the
lambda, so that the linkage won't change when that information is made
available. Fixes the assertion in <rdar://problem/11182962>.

Plus, actually mangle the context of lambdas properly.

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

12 years agoobjective-c modern translation. Remove commenting out
Fariborz Jahanian [Wed, 4 Apr 2012 17:16:15 +0000 (17:16 +0000)]
objective-c modern translation. Remove commenting out
of extern "C". // rdar://11169733

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

12 years agoSimplify test a bit now that it's not actually running cc1plus.
Bob Wilson [Wed, 4 Apr 2012 14:43:40 +0000 (14:43 +0000)]
Simplify test a bit now that it's not actually running cc1plus.

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

12 years agoclang/test/Tooling/clang-check.cpp: Mark it as XFAIL mingw,msvc for now.
NAKAMURA Takumi [Wed, 4 Apr 2012 14:35:23 +0000 (14:35 +0000)]
clang/test/Tooling/clang-check.cpp: Mark it as XFAIL mingw,msvc for now.

It seems JSON parser doesn't like path separator '\' on Win32 hosts.

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

12 years agoTooling.cpp: Reorder inclusions according to the conding standards.
NAKAMURA Takumi [Wed, 4 Apr 2012 13:59:41 +0000 (13:59 +0000)]
Tooling.cpp: Reorder inclusions according to the conding standards.

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

12 years agoTooling.cpp: Don't refer to $ENV{PWD}. Use llvm::sys::fs instead.
NAKAMURA Takumi [Wed, 4 Apr 2012 13:59:36 +0000 (13:59 +0000)]
Tooling.cpp: Don't refer to $ENV{PWD}. Use llvm::sys::fs instead.

$ENV{PWD} is not expected to be set on all hosts.

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

12 years agoDon't crash (assert failure) when generating blocks for C++ types with a non-const...
David Chisnall [Wed, 4 Apr 2012 13:07:13 +0000 (13:07 +0000)]
Don't crash (assert failure) when generating blocks for C++ types with a non-const copy constructor.

This was caused by the code deciding the number of fields in the byref structure using a different test to the part of the code creating the GEPs into said structure.

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

12 years agoUpdated release notes for tooling.
Manuel Klimek [Wed, 4 Apr 2012 12:53:16 +0000 (12:53 +0000)]
Updated release notes for tooling.

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

12 years agoclangFrontend depends on clangEdit.
Benjamin Kramer [Wed, 4 Apr 2012 12:25:11 +0000 (12:25 +0000)]
clangFrontend depends on clangEdit.

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

12 years agoAdd the dependency on clang-check to clang-test, so clang-check
Manuel Klimek [Wed, 4 Apr 2012 12:18:22 +0000 (12:18 +0000)]
Add the dependency on clang-check to clang-test, so clang-check
can be integration tested.

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

12 years agoAdds a tooling library.
Manuel Klimek [Wed, 4 Apr 2012 12:07:46 +0000 (12:07 +0000)]
Adds a tooling library.

Provides an API to run clang tools (FrontendActions) as standalone tools,
or repeatedly in-memory in a process. This is useful for unit-testing,
map-reduce style applications, source transformation daemons or command line
tools.

The ability to run over multiple translation units with different command
line arguments enables building up refactoring tools that need to apply
transformations across translation unit boundaries.

See tools/clang-check/ClangCheck.cpp for an example.

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

12 years agoDon't actually execute gcc during testing.
Benjamin Kramer [Wed, 4 Apr 2012 09:05:21 +0000 (09:05 +0000)]
Don't actually execute gcc during testing.

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

12 years agoAdd a testcase for svn r153854.
Bob Wilson [Wed, 4 Apr 2012 07:06:30 +0000 (07:06 +0000)]
Add a testcase for svn r153854.

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

12 years agoFix diagnostic typos: "non-template arguments" vs "non-type template arguments".
Richard Smith [Wed, 4 Apr 2012 06:47:16 +0000 (06:47 +0000)]
Fix diagnostic typos: "non-template arguments" vs "non-type template arguments".
No test updates: we don't appear to have any test coverage for these diagnostics!

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

12 years agoFor PR11916: Add support for g++'s __int128 keyword. Unlike __int128_t, this is
Richard Smith [Wed, 4 Apr 2012 06:24:32 +0000 (06:24 +0000)]
For PR11916: Add support for g++'s __int128 keyword. Unlike __int128_t, this is
a type specifier and can be combined with unsigned. This allows libstdc++4.7 to
be used with clang in c++98 mode.

Several other changes are still required for libstdc++4.7 to work with clang in
c++11 mode.

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

12 years agoWhen performing template argument deduction for an initializer list,
Douglas Gregor [Wed, 4 Apr 2012 05:10:53 +0000 (05:10 +0000)]
When performing template argument deduction for an initializer list,
be sure to perform the argument type adjustments in
[temp.deduct.call]p2, e.g., array decay.

And, when performing these deductions in the context of 'auto', make
sure that we're deducing the P' in std::initializer_list<P'> rather
than the whole initializer list.

Together, this makes code like

  for( auto s : {"Deferred", "New", "Open", "Review"}) { }

work properly.

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

12 years agoDependent-sequence initialization of a single element can be direct
Douglas Gregor [Wed, 4 Apr 2012 04:06:51 +0000 (04:06 +0000)]
Dependent-sequence initialization of a single element can be direct
list-initialization. Loosen an over-eager assertion to fix PR12453.

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

12 years ago[preprocessor] In Preprocessor::CachingLex() check whether there were more tokens
Argyrios Kyrtzidis [Wed, 4 Apr 2012 02:57:01 +0000 (02:57 +0000)]
[preprocessor] In Preprocessor::CachingLex() check whether there were more tokens
cached during the non-cached lex, otherwise we are going to drop them.

Fixes a bogus "_Pragma takes a parenthesized string literal" error when
expanding consecutive _Pragmas in a macro argument.

Part of rdar://11168596

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

12 years agoWhen computing the conversion sequence in overload resolution
John McCall [Wed, 4 Apr 2012 02:40:27 +0000 (02:40 +0000)]
When computing the conversion sequence in overload resolution
for converting an empty list to a scalar, be sure to initialize
the source and destination types so that comparison of conversion
sequences will work in case there are multiple viable candidates.

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

12 years agoIf something already instantiated is reinstantiated as an explicit definition,
Nick Lewycky [Wed, 4 Apr 2012 02:38:36 +0000 (02:38 +0000)]
If something already instantiated is reinstantiated as an explicit definition,
keep the latter.

No test. This was noticed when poking around something else with GDB. I'm not
able to figure out a testcase that would break due to this bug. Sorry.

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

12 years agoErrorUnsupported on array cookies in the MS C++ ABI code;
John McCall [Wed, 4 Apr 2012 01:33:45 +0000 (01:33 +0000)]
ErrorUnsupported on array cookies in the MS C++ ABI code;
patch by Timur Iskhodzhanov.

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

12 years agoEnter an expression evaluation context when parsing
John McCall [Wed, 4 Apr 2012 01:27:53 +0000 (01:27 +0000)]
Enter an expression evaluation context when parsing
statement-expressions.  Prevents cleanups and such from being
claimed by the first full-expression in the block.

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

12 years agoFix dead store warning.
Ted Kremenek [Wed, 4 Apr 2012 00:55:33 +0000 (00:55 +0000)]
Fix dead store warning.

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

12 years agoChange BugReporter's usage of IsCachedDiagnostic to only impact pruning diagnostics...
Ted Kremenek [Wed, 4 Apr 2012 00:55:29 +0000 (00:55 +0000)]
Change BugReporter's usage of IsCachedDiagnostic to only impact pruning diagnostics emitted to the
console, and leave it up to PathDiagnosticConsumer to unique reports with the shortest path.

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

12 years agoSilence dead store warning, and fix indentation.
Ted Kremenek [Wed, 4 Apr 2012 00:55:25 +0000 (00:55 +0000)]
Silence dead store warning, and fix indentation.

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

12 years agoRemove dead assignment to local variable.
Ted Kremenek [Wed, 4 Apr 2012 00:55:21 +0000 (00:55 +0000)]
Remove dead assignment to local variable.

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

12 years agoAdd feature check "cxx_local_type_template_args" describing support
Douglas Gregor [Wed, 4 Apr 2012 00:48:39 +0000 (00:48 +0000)]
Add feature check "cxx_local_type_template_args" describing support
for templates with local template arguments, from Michel Morin! Fixes
PR12337.

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

12 years agoEliminate obvious use-after-free. Fixes PR12433 / <rdar://problem/11168333>.
Douglas Gregor [Wed, 4 Apr 2012 00:34:49 +0000 (00:34 +0000)]
Eliminate obvious use-after-free. Fixes PR12433 / <rdar://problem/11168333>.

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

12 years agoRemove more redundant lookups. Add a new "all_lookups_iterator" which provides
Nick Lewycky [Tue, 3 Apr 2012 21:44:08 +0000 (21:44 +0000)]
Remove more redundant lookups. Add a new "all_lookups_iterator" which provides
a view over the contents of a DeclContext without exposing the implementation
details of the StoredDeclsMap. Use this in LookupVisibleDecls to find the
visible declarations. Fixes PR12339!

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

12 years agoDon't treat synthesized ivars as being in the base class for the purpose of
Nick Lewycky [Tue, 3 Apr 2012 20:26:45 +0000 (20:26 +0000)]
Don't treat synthesized ivars as being in the base class for the purpose of
looking up visible decls.

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

12 years agoReplace the workaround from r153445 with a proper fix.
Kaelyn Uhrain [Tue, 3 Apr 2012 18:20:11 +0000 (18:20 +0000)]
Replace the workaround from r153445 with a proper fix.

Infinite recursion was happening when DiagnoseInvalidRedeclaration
called ActOnFunctionDeclarator to check if a typo correction works when
the correction was just to the nested-name-specifier because the wrong
DeclContext was being passed in. Unlike a number of functions
surrounding typo correction, the DeclContext passed in for a function is
the context of the function name after applying any nested name
specifiers, not the lexical DeclContext where the
function+nested-name-specifier appears.

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

12 years agomodern objective-c translator: rewriter linkage spec.
Fariborz Jahanian [Tue, 3 Apr 2012 17:35:38 +0000 (17:35 +0000)]
modern objective-c translator: rewriter linkage spec.
// rdar://11169733

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

12 years agoCorrect handling of _Pragma macro inside a macro argument.
Argyrios Kyrtzidis [Tue, 3 Apr 2012 16:47:40 +0000 (16:47 +0000)]
Correct handling of _Pragma macro inside a macro argument.

If we are pre-expanding a macro argument don't actually "activate"
the pragma at that point, activate the pragma whenever we encounter
it again in the token stream.
This ensures that we will activate it in the correct location
or that we will ignore it if it never enters the token stream, e.g:

     \#define EMPTY(x)
     \#define INACTIVE(x) EMPTY(x)
     INACTIVE(_Pragma("clang diagnostic ignored \"-Wconversion\""))

This also fixes the crash in rdar://11168596.

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

12 years agoRework ProgramPoint to bit-mangle the 'Kind' into both Data pointers and the Location...
Ted Kremenek [Tue, 3 Apr 2012 04:25:05 +0000 (04:25 +0000)]
Rework ProgramPoint to bit-mangle the 'Kind' into both Data pointers and the LocationContext.  After switching to PointerIntPair, it didn't look like a safe assumption to use the lower 3 bits of the LocationContext* field.  Thanks to Jordy Rose and Benjamin Kramer for their feedback.

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

12 years ago[analyzer] Record the basic blocks covered by the analyzes run.
Anna Zaks [Tue, 3 Apr 2012 02:05:47 +0000 (02:05 +0000)]
[analyzer] Record the basic blocks covered by the analyzes run.

Store this info inside the function summary generated for all analyzed
functions. This is useful for coverage stats and can be helpful for
analyzer state space search strategies.

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

12 years agoAdd more constraint registers for mips.
Eric Christopher [Tue, 3 Apr 2012 01:16:32 +0000 (01:16 +0000)]
Add more constraint registers for mips.

Patch by Jack Carter. Testcase cleanup by me.

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

12 years agoChange location information for synthesized properties to be at the
Eric Christopher [Tue, 3 Apr 2012 00:44:15 +0000 (00:44 +0000)]
Change location information for synthesized properties to be at the
property file/line rather than the @synthesize file/line. Avoids
some nasty confusing-ness with conflating the file from the scope
and the line from the original declaration. Use    the current scope
location as a separate parameter so that we can    match it up
better in the line table with the beginning of the scope.

Update a couple of testcases accordingly since I had to change
that we actually use the passed in location in EmitFunctionStart
and for the new metadata parameter and add a new testcase to
make sure we've got the right line numbers for synthesized
properties.

Part of rdar://11026482

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

12 years agoFix another false positive in RegionStore involving doing loads from symbolic offsets...
Ted Kremenek [Tue, 3 Apr 2012 00:03:34 +0000 (00:03 +0000)]
Fix another false positive in RegionStore involving doing loads from symbolic offsets.  We still don't
properly reason about such accesses, but we shouldn't emit bogus "uninitialized value" warnings
either.  Fixes <rdar://problem/11127008>.

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

12 years agoFix potential null dereference in the static analyzer when inlining a call that has...
Ted Kremenek [Mon, 2 Apr 2012 21:55:06 +0000 (21:55 +0000)]
Fix potential null dereference in the static analyzer when inlining a call that has already been inlined.  Unfortunately I have no test case.

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

12 years agoReduce static analyzer memory usage by about 4% by packing the ProgramPoing 'Kind...
Ted Kremenek [Mon, 2 Apr 2012 21:24:13 +0000 (21:24 +0000)]
Reduce static analyzer memory usage by about 4% by packing the ProgramPoing 'Kind' field into the spare bits of other fields.

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

12 years agoPR10217 diagnostic fix: don't say 'copy constructor' when we mean
Richard Smith [Mon, 2 Apr 2012 21:07:48 +0000 (21:07 +0000)]
PR10217 diagnostic fix: don't say 'copy constructor' when we mean
'copy assignment operator'.

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

12 years agoRemove windows line endings.
David Blaikie [Mon, 2 Apr 2012 20:59:49 +0000 (20:59 +0000)]
Remove windows line endings.

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

12 years agoFinish PR10217: Ensure we say that a special member was implicitly, not
Richard Smith [Mon, 2 Apr 2012 20:59:25 +0000 (20:59 +0000)]
Finish PR10217: Ensure we say that a special member was implicitly, not
explicitly, deleted in all relevant cases, and explain why.

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

12 years agoCorrect error recovery when missing 'class' in a template template parameter.
David Blaikie [Mon, 2 Apr 2012 19:15:28 +0000 (19:15 +0000)]
Correct error recovery when missing 'class' in a template template parameter.

The diagnostic message correctly informs the user that they have omitted the
'class' keyword, but neither suggests this insertion as a fixit, nor attempts
to recover as if they had provided the keyword.

This fixes the recovery, adds the fixit, and adds a separate diagnostic and
corresponding replacement fixit for cases where the user wrote 'struct' or
'typename' instead of 'class' (suggested by Richard Smith as a possible common
mistake).

I'm not sure the diagnostic message for either the original or new cases feel
very Clang-esque, so I'm open to suggestions there. The fixit hints make it
fairly easy to see what's required, though.

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

12 years agoSilence -Wunused-variable in -Asserts build
Matt Beaumont-Gay [Mon, 2 Apr 2012 19:05:35 +0000 (19:05 +0000)]
Silence -Wunused-variable in -Asserts build

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

12 years agoPR12438: Profile a reference to a type template parameter by depth and index,
Richard Smith [Mon, 2 Apr 2012 18:53:24 +0000 (18:53 +0000)]
PR12438: Profile a reference to a type template parameter by depth and index,
not by canonical decl. This only matters for sizeof...(Pack) expressions; in
all other cases, we'd profile it as a type instead.

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

12 years agoImplement DR1402: if a field or base class is not movable, the derived class's
Richard Smith [Mon, 2 Apr 2012 18:40:40 +0000 (18:40 +0000)]
Implement DR1402: if a field or base class is not movable, the derived class's
move constructor/move assignment operator are not declared, rather than being
defined as deleted, so move operations on the derived class fall back to
copying rather than moving.

If a move operation on the derived class is explicitly defaulted, the
unmovable subobject will be copied instead of being moved.

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

12 years agoUse -rewrite-legacy-objc as clang argument for translating
Fariborz Jahanian [Mon, 2 Apr 2012 15:59:19 +0000 (15:59 +0000)]
Use -rewrite-legacy-objc as clang argument for translating
objective-c's fragile abi, Use -rewrite-objc for translating
objective-c's modern abi.  // rdar://11143173

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

12 years agoFix build by passing in the needed variable after r153860.
Bill Wendling [Mon, 2 Apr 2012 06:17:37 +0000 (06:17 +0000)]
Fix build by passing in the needed variable after r153860.

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

12 years agoBasic semantic analysis support for inheriting constructor declarations in
Richard Smith [Mon, 2 Apr 2012 01:30:27 +0000 (01:30 +0000)]
Basic semantic analysis support for inheriting constructor declarations in
dependent contexts.

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

12 years agoIgnore unused --serialize-diagnostics option when using llvm-gcc.
Bob Wilson [Sun, 1 Apr 2012 23:03:29 +0000 (23:03 +0000)]
Ignore unused --serialize-diagnostics option when using llvm-gcc.

llvm-gcc doesn't handle --serialize-diagnostics so when compiling i386
kernel/kext code with -Werror, you get an error about that option being
unused.  Claim the argument to prevent this from breaking builds.
<rdar://problem/11161933>

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