]> granicus.if.org Git - clang/log
clang
13 years agoAdd proper doxyments to the entry point routine, and remove a dead parameter.
Chandler Carruth [Sun, 16 Oct 2011 06:24:58 +0000 (06:24 +0000)]
Add proper doxyments to the entry point routine, and remove a dead parameter.

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

13 years agoPersist the TextDiagnostic object across multiple diagnostics as long as
Chandler Carruth [Sun, 16 Oct 2011 02:57:39 +0000 (02:57 +0000)]
Persist the TextDiagnostic object across multiple diagnostics as long as
the SourceManager doesn't change, and the source files don't change.
This greatly simplifies the interfaces and interactions. The lifetime of
the TextDiagnostic object forms the 'session' over which we attempt to
condense and deduplicate information in diagnostics.

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

13 years agoClean up the names of all the TextDiagnostic methods (and even a static
Chandler Carruth [Sat, 15 Oct 2011 23:54:09 +0000 (23:54 +0000)]
Clean up the names of all the TextDiagnostic methods (and even a static
function) to agree with the coding conventions, and in one case have
a bit more information in it.

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

13 years agoMove two functions out of the public interface that shouldn't have ever
Chandler Carruth [Sat, 15 Oct 2011 23:48:02 +0000 (23:48 +0000)]
Move two functions out of the public interface that shouldn't have ever
been there. Also delete their redundant doxyments in favor of those in
the source file. I'm putting the doxyments for private and static
helpers into the implementation file, and only the public interface
doxyments into the header. If folks have strong opinions about this type
of split, feel free to chime in, I'm happy to re-organize.

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

13 years agoGraduate the TextDiagnostic interface to its own header and source file,
Chandler Carruth [Sat, 15 Oct 2011 23:43:53 +0000 (23:43 +0000)]
Graduate the TextDiagnostic interface to its own header and source file,
making it accessible to anyone from the Frontend library. Still a good
bit of cleanup to do here, but its a good milestone. This ensures that
*all* of the functionality needed to implement the DiagnosticConsumer is
exposed via the generic interface in some form. No sneaky re-use of
static functions.

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

13 years agoMove the message printing to a class-static function so that it can be
Chandler Carruth [Sat, 15 Oct 2011 22:57:29 +0000 (22:57 +0000)]
Move the message printing to a class-static function so that it can be
part of the TextDiagnostic interface without requiring a full instance.

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

13 years agoMove the diagnostic level printing into a class static helper. This will
Chandler Carruth [Sat, 15 Oct 2011 22:49:21 +0000 (22:49 +0000)]
Move the diagnostic level printing into a class static helper. This will
allow the TextDiagnosticPrinter to continue using it even if
TextDiagnostic is implemented in a separate file.

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

13 years agoRationalize the last bit of "arbitrary" state that is carried between
Chandler Carruth [Sat, 15 Oct 2011 22:39:16 +0000 (22:39 +0000)]
Rationalize the last bit of "arbitrary" state that is carried between
diagnostics to control suppression of redundant information. It now
follows the same model as all the other state, and has a bit more clear
semantics.

This is making the duality of the state a bit annoying, and I've added
a FIXME to resolve it. The problem is that I need to lift the
TextDiagnostic up into an externally visible layer before that can
happen.

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

13 years agoAvoid duplicate unavailbility diagnostics in objc++.
Fariborz Jahanian [Sat, 15 Oct 2011 19:18:36 +0000 (19:18 +0000)]
Avoid duplicate unavailbility diagnostics in objc++.
// rdar://10268422

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

13 years agoPlace static initializers on linux into the ".text.startup" section, so the linker...
Benjamin Kramer [Sat, 15 Oct 2011 17:53:33 +0000 (17:53 +0000)]
Place static initializers on linux into the ".text.startup" section, so the linker can group them together for performance.

This only has an effect with fairly new binutils (2.21.51 or later). Other ELF targets probably want this as well, but on BSDs binutils is usually old so it doesn't matter.

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

13 years agoobj-c++: allow the getter/setter to return/take parameters
Fariborz Jahanian [Sat, 15 Oct 2011 17:36:49 +0000 (17:36 +0000)]
obj-c++: allow the getter/setter to return/take parameters
by reference. // rdar://10188258

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

13 years agoInternals manual: eliminate mention of System library
Peter Collingbourne [Sat, 15 Oct 2011 16:59:24 +0000 (16:59 +0000)]
Internals manual: eliminate mention of System library

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

13 years agoReplace vectors with arrays.
Benjamin Kramer [Sat, 15 Oct 2011 12:20:02 +0000 (12:20 +0000)]
Replace vectors with arrays.

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

13 years agoNeither 'Warning' nor 'NonNote' was a good name for this location...
Chandler Carruth [Sat, 15 Oct 2011 12:12:44 +0000 (12:12 +0000)]
Neither 'Warning' nor 'NonNote' was a good name for this location...
It's the last include-stack-root we tried to walk up. Use a better name
and better doxyments for it.

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

13 years agoNuke a bunch of FIXMEs that are now fixed. =] Also, remove the now-dead
Chandler Carruth [Sat, 15 Oct 2011 12:07:49 +0000 (12:07 +0000)]
Nuke a bunch of FIXMEs that are now fixed. =] Also, remove the now-dead
TextDiagnosticPrinter argument to the TextDiagnostic helper class. This
cements the proper ordering of things: TextDiagnostic is now a viable
stand-alone class for emitting pretty-printed textual diagnostics to
a terminal.

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

13 years agoSink the include stack printing into the generic text diagnostic
Chandler Carruth [Sat, 15 Oct 2011 12:07:47 +0000 (12:07 +0000)]
Sink the include stack printing into the generic text diagnostic
utility. This is a particularly nice win because it removes a pile of
parameters from these routines. Also name them a bit better. I'm trying
to follow the pattern of 'emit' routines writing directly to what is
expected to be the final output, while 'print' routines take a output
stream argument and can be used to build up intermediate buffers, etc.

Also, fix a bug I spotted by inspection from my last commit where
'LastLoc' and 'LastNonNoteLoc' were reversed. It's really scary that
this didn't trigger a single test failure. Will be working on tests for
more of this functionality now.

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

13 years agoRationalize some of how the locations of prior diagnostics are tracked
Chandler Carruth [Sat, 15 Oct 2011 11:44:27 +0000 (11:44 +0000)]
Rationalize some of how the locations of prior diagnostics are tracked
across emissions.

1) The include stack printing is conditioned on non-note diagnostics,
   not just on warning diagnostics.
2) Those should be full source locations as they're tied to a source
   manager.
3) We should pass in the prior state to the TextDiagnostic constructor,
   allow it to mutate as diagnostics are emitted, and then cache the
   final state before tearing it down.

Some of this remains incomplete, specifically #3 isn't finished for the
non-note location. That'll come when the include stack printing sinks
down a level.

This also highlights how *completely* bug-ridden this code is. For
example, we currently do all these comparisons of a FullSourceLoc and
a SourceLocation... which silently does a SourceLocation to
SourceLocation comparison, completely disregarding the source manager
from whence one of the arguments came. Oops! Good thing in practice this
wasn't important, but it could in theory be suppressing caret
diagnostics in a second TU on a single clang invocation. I'm hoping to
hammer these bugs out as the refactorings occur, although for so many of
them it's really unlikely I can dream up a test case that would show the
potentially buggy behavior.

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

13 years agoSink the EmitDiagnosticLoc method down to the generic TextDiagnostic
Chandler Carruth [Sat, 15 Oct 2011 11:09:23 +0000 (11:09 +0000)]
Sink the EmitDiagnosticLoc method down to the generic TextDiagnostic
interface now that its only caller is there.

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

13 years agoSink the non-caret diagnostic logic down and out of the diagnostic
Chandler Carruth [Sat, 15 Oct 2011 11:09:19 +0000 (11:09 +0000)]
Sink the non-caret diagnostic logic down and out of the diagnostic
consumer. The TextDiagnostic interface now has a generic entry point for
emitting a diagnostic which uses a minimal interface that should be
compatible with StoredDiagnostics such as are available in libclang etc.

Some unfortunate shuffling of static functions as things get relocated.
Also some unfortunate public interface points added to
TextDiagnosticPrinter, but those are the next bits to get moved so they
won't last long.

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

13 years agoSimplify the interface of a helper method in the TextDiagnosticPrinter
Chandler Carruth [Sat, 15 Oct 2011 10:48:19 +0000 (10:48 +0000)]
Simplify the interface of a helper method in the TextDiagnosticPrinter
to operate directly on the source location and ranges associated with
a diagnostic rather than digging them out of the diagnostic. This had
a side benefit of cleaning up its code a tiny bit by using the ArrayRef
interface.

No functionality changed.

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

13 years agoAdd an accessor for all of the ranges in a diagnostic as an ArrayRef.
Chandler Carruth [Sat, 15 Oct 2011 10:48:13 +0000 (10:48 +0000)]
Add an accessor for all of the ranges in a diagnostic as an ArrayRef.
This will simplify a number of calls in the diagnostic printing going
forward.

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

13 years agoAdd -Wc++98-compat warning for deduced 'auto' type specifier.
Richard Smith [Sat, 15 Oct 2011 05:42:01 +0000 (05:42 +0000)]
Add -Wc++98-compat warning for deduced 'auto' type specifier.

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

13 years agoImplement -Wc++98-compat warnings for the parser.
Richard Smith [Sat, 15 Oct 2011 05:09:34 +0000 (05:09 +0000)]
Implement -Wc++98-compat warnings for the parser.

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

13 years agoRefactor: remove redundant check for 'final' specifier when parsing class/struct...
Richard Smith [Sat, 15 Oct 2011 04:21:46 +0000 (04:21 +0000)]
Refactor: remove redundant check for 'final' specifier when parsing class/struct definition.

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

13 years agoTestcase for half of r142048.
Richard Smith [Sat, 15 Oct 2011 04:11:50 +0000 (04:11 +0000)]
Testcase for half of r142048.

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

13 years agoConvert stray doxygen comments to regular comments. They logically represent the...
Ted Kremenek [Sat, 15 Oct 2011 04:06:55 +0000 (04:06 +0000)]
Convert stray doxygen comments to regular comments.  They logically represent the fields in FunctionProtoType.

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

13 years agoRevert "Move doxygen comments to pair with the actual values."
Ted Kremenek [Sat, 15 Oct 2011 04:06:52 +0000 (04:06 +0000)]
Revert "Move doxygen comments to pair with the actual values."

John convinced me this wasn't the right thing to do.  I'll follow up with a second
commit to make these non-doxygen comments.

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

13 years agoUse of override keywords in C++98 should produce a warning by default.
Richard Smith [Sat, 15 Oct 2011 04:01:16 +0000 (04:01 +0000)]
Use of override keywords in C++98 should produce a warning by default.

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

13 years agoRename an ExtWarn to ext_ for consistency.
Richard Smith [Sat, 15 Oct 2011 03:55:17 +0000 (03:55 +0000)]
Rename an ExtWarn to ext_ for consistency.

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

13 years agoDon't warn about use of 'final' in ill-formed C++98 code which didn't use
Richard Smith [Sat, 15 Oct 2011 03:38:41 +0000 (03:38 +0000)]
Don't warn about use of 'final' in ill-formed C++98 code which didn't use
'final', and don't accept (then silently discard) braced init lists in C++98
new-expressions.

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

13 years agoHandle an edge case involving the conditional operator and throw expressions. PR10582.
Eli Friedman [Sat, 15 Oct 2011 02:10:40 +0000 (02:10 +0000)]
Handle an edge case involving the conditional operator and throw expressions.  PR10582.

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

13 years agoChange 'Emit' to 'EmitCaret' which sums up what it *should* be doing.
Chandler Carruth [Sat, 15 Oct 2011 01:21:55 +0000 (01:21 +0000)]
Change 'Emit' to 'EmitCaret' which sums up what it *should* be doing.
Also note that it is actually doing much more than it should. This paves
the way for building a more generic 'Emit' routine that is the real
entry point here.

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

13 years ago-Wc++98-compat warnings for the lexer.
Richard Smith [Sat, 15 Oct 2011 01:18:56 +0000 (01:18 +0000)]
-Wc++98-compat warnings for the lexer.

This also adds a -Wc++98-compat-pedantic for warning on constructs which would
be diagnosed by -std=c++98 -pedantic (that is, it warns even on C++11 features
which we enable by default, with no warning, in C++98 mode).

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

13 years agoTeach the ASTImporter to perform DeclContext lookups in a way that
Douglas Gregor [Sat, 15 Oct 2011 00:10:27 +0000 (00:10 +0000)]
Teach the ASTImporter to perform DeclContext lookups in a way that
avoids loading data from an external source, since those lookups were
causing some "interesting" recursion in LLDB.

This code is not efficient. I plan to remedy this inefficiency in a
follow-up commit.

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

13 years agoAdd c_alignas and cxx_alignas features
Peter Collingbourne [Fri, 14 Oct 2011 23:44:46 +0000 (23:44 +0000)]
Add c_alignas and cxx_alignas features

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

13 years agoTweak the C++11 status prose a bit. We still need better user guidance on the standar...
Douglas Gregor [Fri, 14 Oct 2011 23:35:48 +0000 (23:35 +0000)]
Tweak the C++11 status prose a bit. We still need better user guidance on the standard library issue

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

13 years agoMissed tests for half FP support
Anton Korobeynikov [Fri, 14 Oct 2011 23:32:50 +0000 (23:32 +0000)]
Missed tests for half FP support

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

13 years agoProvide half floating point support as a storage only type.
Anton Korobeynikov [Fri, 14 Oct 2011 23:23:15 +0000 (23:23 +0000)]
Provide half floating point support as a storage only type.
Lack of half FP was a regression compared to llvm-gcc.

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

13 years agoSwitch the C++11 status table from a developer-centric list to a
Douglas Gregor [Fri, 14 Oct 2011 23:21:49 +0000 (23:21 +0000)]
Switch the C++11 status table from a developer-centric list to a
user-centric list, with Clang version numbers, following GCC's lead
(and user requests).

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

13 years agoAttempt to fix Windows buildbot, round 2.
Eli Friedman [Fri, 14 Oct 2011 23:10:30 +0000 (23:10 +0000)]
Attempt to fix Windows buildbot, round 2.

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

13 years agoAdd template instantiation support for AtomicExpr.
Eli Friedman [Fri, 14 Oct 2011 22:48:56 +0000 (22:48 +0000)]
Add template instantiation support for AtomicExpr.

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

13 years agoTeach the ASTImporter not to import redundant fields.
Douglas Gregor [Fri, 14 Oct 2011 21:54:42 +0000 (21:54 +0000)]
Teach the ASTImporter not to import redundant fields.

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

13 years agoAttempt to fix buildbot failure on Windows.
Eli Friedman [Fri, 14 Oct 2011 21:52:24 +0000 (21:52 +0000)]
Attempt to fix buildbot failure on Windows.

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

13 years agovfork comes from unistd.h
Joerg Sonnenberger [Fri, 14 Oct 2011 21:47:27 +0000 (21:47 +0000)]
vfork comes from unistd.h

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

13 years agoAllow calling ASTUnit::LoadFromCompilerInvocationAction with a previously created...
Argyrios Kyrtzidis [Fri, 14 Oct 2011 21:22:05 +0000 (21:22 +0000)]
Allow calling ASTUnit::LoadFromCompilerInvocationAction with a previously created ASTUnit.

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

13 years agoMisc fixes for atomics. Biggest fix is doing alignment correctly for _Atomic types.
Eli Friedman [Fri, 14 Oct 2011 20:59:01 +0000 (20:59 +0000)]
Misc fixes for atomics.  Biggest fix is doing alignment correctly for _Atomic types.

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

13 years ago-Wc++98-compat: warn on C++11 attributes and alignas.
Richard Smith [Fri, 14 Oct 2011 20:48:27 +0000 (20:48 +0000)]
-Wc++98-compat: warn on C++11 attributes and alignas.

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

13 years agoTest for r141985.
Richard Smith [Fri, 14 Oct 2011 20:41:13 +0000 (20:41 +0000)]
Test for r141985.

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

13 years agoDon't try to diagnose anything when we're passing incomplete types
Douglas Gregor [Fri, 14 Oct 2011 20:34:19 +0000 (20:34 +0000)]
Don't try to diagnose anything when we're passing incomplete types
through varargs. This only happens when we're in an unevaluated
context, where we don't want to trigger an error anyway. Fixes PR11131
/ <rdar://problem/10288375>.

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

13 years agoReinstate r141898 (reverted in r141921), without the -Wc++98-compat-variadic-template...
Richard Smith [Fri, 14 Oct 2011 20:31:37 +0000 (20:31 +0000)]
Reinstate r141898 (reverted in r141921), without the -Wc++98-compat-variadic-templates flag. Consensus is that -Wc++98-compat is a useful addition to clang, but per-C++11-feature warnings may not be.
Original patch by Jeffrey Yasskin.

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

13 years agoRefactor static analyzer to use simpler interface to constant expression evaluation.
Richard Smith [Fri, 14 Oct 2011 20:22:00 +0000 (20:22 +0000)]
Refactor static analyzer to use simpler interface to constant expression evaluation.

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

13 years ago[temp.explicit]p1: constexpr cannot be specified in explicit instantiations.
Richard Smith [Fri, 14 Oct 2011 19:58:02 +0000 (19:58 +0000)]
[temp.explicit]p1: constexpr cannot be specified in explicit instantiations.

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

13 years agoFix the CXX_INCLUDE_ROOT case that was out of date with ScanLibDirForGCCTriple.
Rafael Espindola [Fri, 14 Oct 2011 19:50:08 +0000 (19:50 +0000)]
Fix the CXX_INCLUDE_ROOT case that was out of date with ScanLibDirForGCCTriple.

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

13 years agoHarden test for windows paths.
Benjamin Kramer [Fri, 14 Oct 2011 19:03:46 +0000 (19:03 +0000)]
Harden test for windows paths.

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

13 years agoChange operator<< for raw_ostream and NamedDecl to take a reference instead of a...
Benjamin Kramer [Fri, 14 Oct 2011 18:45:37 +0000 (18:45 +0000)]
Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.

Passing a pointer was a bad idea as it collides with the overload for void*.

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

13 years agoSimplify code to avoid a useless string copy.
Benjamin Kramer [Fri, 14 Oct 2011 18:45:16 +0000 (18:45 +0000)]
Simplify code to avoid a useless string copy.

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

13 years agoUpgrade to PathV2.
Benjamin Kramer [Fri, 14 Oct 2011 18:45:11 +0000 (18:45 +0000)]
Upgrade to PathV2.

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

13 years agoAdd parens to pacify GCC.
Benjamin Kramer [Fri, 14 Oct 2011 18:45:06 +0000 (18:45 +0000)]
Add parens to pacify GCC.

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

13 years agoFix misplaced comment.
Fariborz Jahanian [Fri, 14 Oct 2011 18:35:31 +0000 (18:35 +0000)]
Fix misplaced comment.

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

13 years agoMake value kind based on the return type of the getter, not
Fariborz Jahanian [Fri, 14 Oct 2011 18:31:36 +0000 (18:31 +0000)]
Make value kind based on the return type of the getter, not
property type, for when getter may be a reference type.
// rdar://10188258 revised.

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

13 years ago[PCH] Serialize info about redeclared objc methods.
Argyrios Kyrtzidis [Fri, 14 Oct 2011 17:41:52 +0000 (17:41 +0000)]
[PCH] Serialize info about redeclared objc methods.

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

13 years agoAdd flags for the remaining shift related warnings
Joerg Sonnenberger [Fri, 14 Oct 2011 17:34:53 +0000 (17:34 +0000)]
Add flags for the remaining shift related warnings
(-Wshift-count-negative, -Wshift-count-overflow).

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

13 years agoobjc-arc: Improve arc diagnostic when method is not
Fariborz Jahanian [Fri, 14 Oct 2011 17:34:08 +0000 (17:34 +0000)]
objc-arc: Improve arc diagnostic when method is not
found in receiver's class. // rdar://9970739

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

13 years agoAdd __nodebug__ attribute to functions in arm_neon.h
Bob Wilson [Fri, 14 Oct 2011 16:55:33 +0000 (16:55 +0000)]
Add __nodebug__ attribute to functions in arm_neon.h

This matches what we do for Intel vector intrinsics. <rdar://problem/10280207>

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

13 years agoUnder ARC, merge the bit corresponding to the ns_returns_retained
Douglas Gregor [Fri, 14 Oct 2011 15:55:40 +0000 (15:55 +0000)]
Under ARC, merge the bit corresponding to the ns_returns_retained
attribute from the first declaration to later declarations. Fixes
<rdar://problem/10142572>.

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

13 years agoOnly warn in -Wliteral-conversion if the conversion loses information
Matt Beaumont-Gay [Fri, 14 Oct 2011 15:36:25 +0000 (15:36 +0000)]
Only warn in -Wliteral-conversion if the conversion loses information

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

13 years agoWhen declaring an out-of-line template, attempt to rebuild any types
Douglas Gregor [Fri, 14 Oct 2011 15:31:12 +0000 (15:31 +0000)]
When declaring an out-of-line template, attempt to rebuild any types
within the template parameter list that may have changed now that we
know the current instantiation. Fixes <rdar://problem/10194295>.

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

13 years agoAdded clang_getCompletionAnnotation and clang_getCompletionNumAnnotations to
Erik Verbruggen [Fri, 14 Oct 2011 15:31:08 +0000 (15:31 +0000)]
Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations to
retrieve annotations from completion string.

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

13 years agoReally protect from infinite loop when there are objc method redeclarations.
Argyrios Kyrtzidis [Fri, 14 Oct 2011 08:02:31 +0000 (08:02 +0000)]
Really protect from infinite loop when there are objc method redeclarations.

Serialization part will come later.

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

13 years agoUpdating the Clang website to refer to C++'11 instead of C++'0x
David Blaikie [Fri, 14 Oct 2011 07:58:10 +0000 (07:58 +0000)]
Updating the Clang website to refer to C++'11 instead of C++'0x

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

13 years agoKeep track of objc method redeclarations in the same interface.
Argyrios Kyrtzidis [Fri, 14 Oct 2011 06:48:06 +0000 (06:48 +0000)]
Keep track of objc method redeclarations in the same interface.

Avoid possible infinite loop when iterating over an ObjCMethod's redeclarations.

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

13 years agoUse Triple.isOSDarwin() instead of comparing against Triple::Darwin.
Bob Wilson [Fri, 14 Oct 2011 05:03:44 +0000 (05:03 +0000)]
Use Triple.isOSDarwin() instead of comparing against Triple::Darwin.

There are now separate Triple::MacOSX and Triple::IOS values for the OS
so comparing against Triple::Darwin will fail to match those.  Note that
I changed the expected output for the Driver/rewrite-objc.m test, which had
previously not been passing Darwin-specific options with the macosx triple.

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

13 years agoUpdate open source static analyzer build.
Ted Kremenek [Fri, 14 Oct 2011 04:15:19 +0000 (04:15 +0000)]
Update open source static analyzer build.

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

13 years agoMove doxygen comments to pair with the actual values.
Ted Kremenek [Fri, 14 Oct 2011 04:15:15 +0000 (04:15 +0000)]
Move doxygen comments to pair with the actual values.

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

13 years agoPR11124: Don't overwrite memory outside of a base class when performing zero-initiali...
Eli Friedman [Fri, 14 Oct 2011 02:27:24 +0000 (02:27 +0000)]
PR11124: Don't overwrite memory outside of a base class when performing zero-initialization before running its constructor.

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

13 years agoFix grammaro
Douglas Gregor [Fri, 14 Oct 2011 00:54:15 +0000 (00:54 +0000)]
Fix grammaro

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

13 years agoAdd a preprocessor callback that is invoked every time the 'defined'
Douglas Gregor [Fri, 14 Oct 2011 00:49:43 +0000 (00:49 +0000)]
Add a preprocessor callback that is invoked every time the 'defined'
operator is seen, from Jason Haslam!

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

13 years agoAdd support for -std=gnu90 and -std=c++03, for compatibility with modern gcc.
Richard Smith [Fri, 14 Oct 2011 00:34:28 +0000 (00:34 +0000)]
Add support for -std=gnu90 and -std=c++03, for compatibility with modern gcc.

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

13 years agoRevert the -Wc++98-compat flag because dgregor doesn't like it.
Jeffrey Yasskin [Fri, 14 Oct 2011 00:04:00 +0000 (00:04 +0000)]
Revert the -Wc++98-compat flag because dgregor doesn't like it.

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

13 years agoobjc-arc: 'Class' property is implicitly __unsafe_unretained.
Fariborz Jahanian [Thu, 13 Oct 2011 23:45:45 +0000 (23:45 +0000)]
objc-arc: 'Class' property is implicitly __unsafe_unretained.
// rdar://10239594

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

13 years agoRename -Wc++0x-compat, -Wc++0x-extensions and -Wc++0x-narrowing from c++0x to
Richard Smith [Thu, 13 Oct 2011 23:32:09 +0000 (23:32 +0000)]
Rename -Wc++0x-compat, -Wc++0x-extensions and -Wc++0x-narrowing from c++0x to
c++11. The old names are kept for backwards-compatibility. Patch by Ahmed
Charles! Names for backwards-compatible DiagGroups removed by me.

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

13 years agoFix a test case where FileCheck is used to test code corrected by -fixit.
Richard Trieu [Thu, 13 Oct 2011 23:26:59 +0000 (23:26 +0000)]
Fix a test case where FileCheck is used to test code corrected by -fixit.
If the code file is not run through the preproccessor to remove comments,
then FileCheck will match the strings within the CHECK commands rendering
the test useless.

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

13 years agoConvert newly-added test from -std=c++0x to -std=c++11.
Richard Smith [Thu, 13 Oct 2011 22:45:21 +0000 (22:45 +0000)]
Convert newly-added test from -std=c++0x to -std=c++11.

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

13 years agoExtend -Wno-sizeof-array-argument to strncpy and friends.
Nico Weber [Thu, 13 Oct 2011 22:30:23 +0000 (22:30 +0000)]
Extend -Wno-sizeof-array-argument to strncpy and friends.

This finds 2 bugs in chromium and 1 in hunspell, with 0 false positives.

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

13 years agoUpdate all tests other than Driver/std.cpp to use -std=c++11 rather than
Richard Smith [Thu, 13 Oct 2011 22:29:44 +0000 (22:29 +0000)]
Update all tests other than Driver/std.cpp to use -std=c++11 rather than
-std=c++0x. Patch by Ahmed Charles!

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

13 years agoImplement the first piece of a -Wc++98-compat flag so that people can build in
Jeffrey Yasskin [Thu, 13 Oct 2011 22:18:05 +0000 (22:18 +0000)]
Implement the first piece of a -Wc++98-compat flag so that people can build in
C++11 mode but keep their sources compatible with C++98.  This patch implements
the -Wc++98-compat-variadic-templates sub-flag and -Wc++98-compat to include
it.

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

13 years agoRecommit:
Eric Christopher [Thu, 13 Oct 2011 21:45:18 +0000 (21:45 +0000)]
Recommit:

    Start handling debug line and scope information better:

    Migrate most of the location setting within the larger API in CGDebugInfo and
    update a lot of callers.
    Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
    and replace it with DILexicalBlockFile usage.

    Finishes off the rest of rdar://10246360

after fixing a few bugs that were exposed in gdb testsuite testing.

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

13 years agoAdd test for new -std=c++11 and -std=gnu++11 command-line arguments.
Richard Smith [Thu, 13 Oct 2011 21:32:47 +0000 (21:32 +0000)]
Add test for new -std=c++11 and -std=gnu++11 command-line arguments.

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

13 years agoAdd triple for RHEL 5 to the libpath collecting logic.
Benjamin Kramer [Thu, 13 Oct 2011 20:45:37 +0000 (20:45 +0000)]
Add triple for RHEL 5 to the libpath collecting logic.

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

13 years agoTweak -Wuninitialized's handling of 'int x = x' to report that as the root cause...
Ted Kremenek [Thu, 13 Oct 2011 18:50:06 +0000 (18:50 +0000)]
Tweak -Wuninitialized's handling of 'int x = x' to report that as the root cause of an uninitialized variable IFF there are other uses of that uninitialized variable.  Fixes <rdar://problem/9259237>.

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

13 years agoHasFormOfMemberPointer implies IsAddressOfOperand for an overload set. Simplify
Douglas Gregor [Thu, 13 Oct 2011 18:26:27 +0000 (18:26 +0000)]
HasFormOfMemberPointer implies IsAddressOfOperand for an overload set. Simplify

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

13 years agoAllow calling an overloaded function set by taking the address of the
Douglas Gregor [Thu, 13 Oct 2011 18:10:35 +0000 (18:10 +0000)]
Allow calling an overloaded function set by taking the address of the
functions, e.g., (&f)(0). Fixes <rdar://problem/9803316>.

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

13 years agoTCE target: conversion of OpenCL reqd_work_group_size attr to metadata
Peter Collingbourne [Thu, 13 Oct 2011 16:24:41 +0000 (16:24 +0000)]
TCE target: conversion of OpenCL reqd_work_group_size attr to metadata

Patch by Pekka Jääskeläinen!

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

13 years agoAllow for annotate attributes after access specifiers. When such
Erik Verbruggen [Thu, 13 Oct 2011 09:41:32 +0000 (09:41 +0000)]
Allow for annotate attributes after access specifiers. When such
attributes are found, propagate them to subsequent declarations.

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

13 years agoFix crash-on-invalid, improve error recovery, and test coverage for missing colon...
David Blaikie [Thu, 13 Oct 2011 06:08:43 +0000 (06:08 +0000)]
Fix crash-on-invalid, improve error recovery, and test coverage for missing colon after access specifiers in C++

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

13 years agoFix MSVC build.
Rafael Espindola [Wed, 12 Oct 2011 23:56:54 +0000 (23:56 +0000)]
Fix MSVC build.

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

13 years agoWhen we determine that a function template specialization produced as
Douglas Gregor [Wed, 12 Oct 2011 20:35:48 +0000 (20:35 +0000)]
When we determine that a function template specialization produced as
part of template argument deduction is ill-formed, we mark it as
invalid and treat it as a deduction failure. If we happen to find that
specialization again, treat it as a deduction failure rather than
silently building a call to the declaration.

Fixes PR11117, a marvelous bug where deduction failed after creating
an invalid specialization, causing overload resolution to pick a
different candidate. Then we performed a similar overload resolution
later, and happily picked the invalid specialization to
call... resulting in a silent link failure.

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

13 years agoAdd test case for __has_warning.
Ted Kremenek [Wed, 12 Oct 2011 20:06:09 +0000 (20:06 +0000)]
Add test case for __has_warning.

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

13 years agoChange __extension__ to disable only diagnostics controlled by -pedantic.
Bob Wilson [Wed, 12 Oct 2011 19:55:31 +0000 (19:55 +0000)]
Change __extension__ to disable only diagnostics controlled by -pedantic.

This changes clang to match GCC's behavior for __extension__, which temporarily
disables the -pedantic flag.  Warnings that are enabled without -pedantic
are not affected.  Besides the general goodness of matching GCC's precedent,
my motivation for this is that macros in the arm_neon.h header need to use
__extension__ to avoid pedantic complaints about their use of statement
expressions, yet we still want to warn about incompatible pointer arguments
for those macros.

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

13 years agoAdd returns_twice to functions that are known to return twice. This implements
Rafael Espindola [Wed, 12 Oct 2011 19:51:18 +0000 (19:51 +0000)]
Add returns_twice to functions that are known to return twice. This implements
the same behavior of gcc by keeping the attribute out of the function type.

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