]> granicus.if.org Git - clang/log
clang
13 years agoPull the pseudo-object stuff into its own file.
John McCall [Tue, 25 Oct 2011 08:42:34 +0000 (08:42 +0000)]
Pull the pseudo-object stuff into its own file.
Tidy up some marginally related code just to annoy
single-purpose-commit lovers.  No functionality change.

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

13 years agoIntroduce a placeholder type for "pseudo object"
John McCall [Tue, 25 Oct 2011 07:27:56 +0000 (07:27 +0000)]
Introduce a placeholder type for "pseudo object"
expressions: expressions which refer to a logical rather
than a physical l-value, where the logical object is
actually accessed via custom getter/setter code.
A subsequent patch will generalize the AST for these
so that arbitrary "implementing" sub-expressions can
be provided.

Right now the only client is ObjC properties, but
this should be generalizable to similar language
features, e.g. Managed C++'s __property methods.

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

13 years agoAllow the -fno-operator-names option to be passed down to the rest
Eric Christopher [Tue, 25 Oct 2011 07:13:06 +0000 (07:13 +0000)]
Allow the -fno-operator-names option to be passed down to the rest
of the compiler.

Fixes PR10198
Patch by Brian Foley!

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

13 years agoDon't forget the lvalue-to-rvalue conversion on the LHS when instantiating a
Richard Smith [Tue, 25 Oct 2011 06:33:21 +0000 (06:33 +0000)]
Don't forget the lvalue-to-rvalue conversion on the LHS when instantiating a
dependent ->, where the member being referred to is an anonymous struct or
union. This path was missed by the fix in r142890.

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

13 years agoRelax restriction of assigning to 'self' in ARC when a method is attributed with...
Ted Kremenek [Tue, 25 Oct 2011 04:52:20 +0000 (04:52 +0000)]
Relax restriction of assigning to 'self' in ARC when a method is attributed with ns_consumes_self.  Fixes <rdar://problem/10274056>.

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

13 years agoTweak printf format string parsing to accept 'hh' conversion specifier to accept...
Ted Kremenek [Tue, 25 Oct 2011 04:20:41 +0000 (04:20 +0000)]
Tweak printf format string parsing to accept 'hh' conversion specifier to accept any char, not just signed char.  Fixes <rdar://problem/10303638>.

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

13 years agoUndo unnecessary change
Douglas Gregor [Tue, 25 Oct 2011 03:47:25 +0000 (03:47 +0000)]
Undo unnecessary change

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

13 years agoCheck for unexpanded parameter packs in the name that guards a
Douglas Gregor [Tue, 25 Oct 2011 03:44:56 +0000 (03:44 +0000)]
Check for unexpanded parameter packs in the name that guards a
Microsoft __if_exists/__if_not_exists statement. Also note that we
weren't traversing DeclarationNameInfo *at all* within the
RecursiveASTVisitor, which would be rather fatal for variadic
templates.

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

13 years agoRemove extra copy of contents of header file resulting in a patch being applied twice...
Ted Kremenek [Tue, 25 Oct 2011 03:37:17 +0000 (03:37 +0000)]
Remove extra copy of contents of header file resulting in a patch being applied twice.  Aren't include guards great?

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

13 years agoMake the -Wc++11-compat warnings ignored by default, so we don't break
Douglas Gregor [Tue, 25 Oct 2011 03:07:45 +0000 (03:07 +0000)]
Make the -Wc++11-compat warnings ignored by default, so we don't break
valid C++98/03 code. However, add these warnings to -Wall, for those
who obviously already like clean code.

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

13 years agoImplement support for dependent Microsoft __if_exists/__if_not_exists
Douglas Gregor [Tue, 25 Oct 2011 01:33:02 +0000 (01:33 +0000)]
Implement support for dependent Microsoft __if_exists/__if_not_exists
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".

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

13 years agoTidy up testcase from r142890, spotted by Chandler.
Richard Smith [Tue, 25 Oct 2011 01:05:41 +0000 (01:05 +0000)]
Tidy up testcase from r142890, spotted by Chandler.

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

13 years agoRemove another Blackfin test.
Dan Gohman [Tue, 25 Oct 2011 01:02:36 +0000 (01:02 +0000)]
Remove another Blackfin test.

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

13 years agoDon't forget the lvalue-to-rvalue conversion on the LHS of an -> when rebuilding
Richard Smith [Tue, 25 Oct 2011 00:41:24 +0000 (00:41 +0000)]
Don't forget the lvalue-to-rvalue conversion on the LHS of an -> when rebuilding
it during template instantiation, for a known RHS decl.

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

13 years ago[PCH] When visiting preprocessed entities, make it possible to avoid deserializing
Argyrios Kyrtzidis [Tue, 25 Oct 2011 00:29:50 +0000 (00:29 +0000)]
[PCH] When visiting preprocessed entities, make it possible to avoid deserializing
preprocessed entities that are #included in the range that we are interested.

This is useful when we are interested in preprocessed entities of a specific file, e.g
when we are annotating tokens. There is also an optimization where we cache the last
result of PreprocessingRecord::getPreprocessedEntitiesInRange and we re-use it if
there is a call with the same range as before.

rdar://10313365

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

13 years agoUse assert(0) instead of duplicating the check, suggestion by Anna.
Argyrios Kyrtzidis [Tue, 25 Oct 2011 00:29:44 +0000 (00:29 +0000)]
Use assert(0) instead of duplicating the check, suggestion by Anna.

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

13 years agoAdd source-level dominators analysis. Patch by Guoping Long!
Ted Kremenek [Tue, 25 Oct 2011 00:25:24 +0000 (00:25 +0000)]
Add source-level dominators analysis.  Patch by Guoping Long!

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

13 years agoClean up, as suggested by John.
Richard Smith [Tue, 25 Oct 2011 00:21:54 +0000 (00:21 +0000)]
Clean up, as suggested by John.

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

13 years agoRemove more SystemZ (s390) tests.
Dan Gohman [Tue, 25 Oct 2011 00:15:21 +0000 (00:15 +0000)]
Remove more SystemZ (s390) tests.

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

13 years agoRemove the Blackfin backend.
Dan Gohman [Tue, 25 Oct 2011 00:06:12 +0000 (00:06 +0000)]
Remove the Blackfin backend.

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

13 years agoRemove the SystemZ backend.
Dan Gohman [Mon, 24 Oct 2011 23:48:52 +0000 (23:48 +0000)]
Remove the SystemZ backend.

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

13 years agoDo not drop type qualifiers in -flimit-debug-info mode.
Devang Patel [Mon, 24 Oct 2011 23:15:17 +0000 (23:15 +0000)]
Do not drop type qualifiers in -flimit-debug-info mode.

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

13 years agoRevert r142844, it broke selfhost. The problem appears to be a missing
Richard Smith [Mon, 24 Oct 2011 23:14:33 +0000 (23:14 +0000)]
Revert r142844, it broke selfhost. The problem appears to be a missing
lvalue-to-rvalue conversion on the LHS operand of '->'.

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

13 years agoAdd explanatory comments for ICE checking in C99 mode.
Richard Smith [Mon, 24 Oct 2011 22:35:48 +0000 (22:35 +0000)]
Add explanatory comments for ICE checking in C99 mode.

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

13 years agoRework Microsoft __if_exists/__if_not_exists parsing and semantic
Douglas Gregor [Mon, 24 Oct 2011 22:31:10 +0000 (22:31 +0000)]
Rework Microsoft __if_exists/__if_not_exists parsing and semantic
analysis to separate dependent names from non-dependent names. For
dependent names, we'll behave differently from Visual C++:

  - For __if_exists/__if_not_exists at class scope, we'll just warn
    and then ignore them.
  - For __if_exists/__if_not_exists in statements, we'll treat the
    inner statement as a compound statement, which we only instantiate
    in templates where the dependent name (after instantiation)
    exists. This behavior is different from VC++, but it's as close as
    we can get without encroaching ridiculousness.

The latter part (dependent statements) is not yet implemented.

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

13 years agoDon't try to emit CK_LValueBitCast casts as constants. PR9558.
Eli Friedman [Mon, 24 Oct 2011 22:25:55 +0000 (22:25 +0000)]
Don't try to emit CK_LValueBitCast casts as constants.  PR9558.

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

13 years agoWhen we perform a lookup for a dependent name that is a member of an
Douglas Gregor [Mon, 24 Oct 2011 22:24:50 +0000 (22:24 +0000)]
When we perform a lookup for a dependent name that is a member of an
unknown specialization, treat this the same way as if the name were
not found in the current instantiation. No actual functionality
change, since apparently nothing depends on this.

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

13 years ago[analyzer] Node builders cleanup + comments
Anna Zaks [Mon, 24 Oct 2011 21:19:59 +0000 (21:19 +0000)]
[analyzer] Node builders cleanup + comments
Renamed PureNodeBuilder->StmtNodeBuilder.

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

13 years ago[analyzer] Remove the old StmtNodeBuilder.
Anna Zaks [Mon, 24 Oct 2011 21:19:53 +0000 (21:19 +0000)]
[analyzer] Remove the old StmtNodeBuilder.

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

13 years ago[analyzer] Completely remove the global Builder object.
Anna Zaks [Mon, 24 Oct 2011 21:19:48 +0000 (21:19 +0000)]
[analyzer] Completely remove the global Builder object.

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

13 years ago[analyzer] Remove more dependencies from global Builder
Anna Zaks [Mon, 24 Oct 2011 21:19:43 +0000 (21:19 +0000)]
[analyzer] Remove more dependencies from global Builder
- OSAtomicChecker
- ExprEngine::processStmt

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

13 years agoConstant expression evaluation: evaluate lvalues as lvalues, and rvalues as
Richard Smith [Mon, 24 Oct 2011 21:07:08 +0000 (21:07 +0000)]
Constant expression evaluation: evaluate lvalues as lvalues, and rvalues as
rvalues, as C++11 constant evaluation semantics require. DeclRefs referring to
references can now use the normal initialization-caching codepath, which
incidentally fixes a crash in cyclic initialization of references.

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

13 years agoSwitch to a more natural formatting of the macro name printing.
Chandler Carruth [Mon, 24 Oct 2011 18:51:08 +0000 (18:51 +0000)]
Switch to a more natural formatting of the macro name printing.
Suggested by John McCall.

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

13 years agoConstant expression evaluation: factor out handling of ignored values.
Richard Smith [Mon, 24 Oct 2011 18:44:57 +0000 (18:44 +0000)]
Constant expression evaluation: factor out handling of ignored values.

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

13 years agoIn accordance with the C89, C99 and C++98 standards, ICEs can only contain
Richard Smith [Mon, 24 Oct 2011 18:26:35 +0000 (18:26 +0000)]
In accordance with the C89, C99 and C++98 standards, ICEs can only contain
floating-point literals if they are the immediate operands of casts.
ImplicitCastExpr is not a cast in the language-standards sense.

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

13 years ago[analyzer] Convert ExprEngine::visit() to use short lived builders.
Anna Zaks [Mon, 24 Oct 2011 18:26:19 +0000 (18:26 +0000)]
[analyzer] Convert ExprEngine::visit() to use short lived builders.

This commit removes the major functional dependency on the ExprEngine::Builder
member variable.

In some cases the code became more verbose. Particularly, we call takeNodes()
and addNodes() to move responsibility for the nodes from one builder to another.
This will get simplified later on.

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

13 years ago[analyzer] Convert VisitDeclStmt to use local node builder.
Anna Zaks [Mon, 24 Oct 2011 18:26:12 +0000 (18:26 +0000)]
[analyzer] Convert VisitDeclStmt to use local node builder.

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

13 years ago[analyzer] Convert more functions (ex:evalBind()) to iterative builders
Anna Zaks [Mon, 24 Oct 2011 18:26:08 +0000 (18:26 +0000)]
[analyzer] Convert more functions (ex:evalBind()) to iterative builders

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

13 years ago[analyzer] Convert VisitUnaryOperator to use short lived Node builders
Anna Zaks [Mon, 24 Oct 2011 18:26:03 +0000 (18:26 +0000)]
[analyzer] Convert VisitUnaryOperator to use short lived Node builders

To convert iteratively, we take the nodes the local builder will
process from the from the global builder and add the generated nodes
after the short lived builder is done. PureStmtNodeBuilder is the
one we should eventually use everywhere. Added Stmt index and Builder
context as ExprEngine globals. To avoid passing them around.

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

13 years ago[analyzer] Use a temporary builder in CheckerContext.
Anna Zaks [Mon, 24 Oct 2011 18:25:58 +0000 (18:25 +0000)]
[analyzer] Use a temporary builder in CheckerContext.

First step toward removing the global Stmt builder. Added several transitional methods (like takeNodes/addNodes).
+ Stop early if the set of exploded nodes for the next iteration is empty.

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

13 years ago[analyzer] Pass external Dst set to NodeBuilder
Anna Zaks [Mon, 24 Oct 2011 18:25:53 +0000 (18:25 +0000)]
[analyzer] Pass external Dst set to NodeBuilder

This moves the responsibility for storing the output node set from the
builder to the clients. The builder is just responsible for transforming
an input set into the output set: {SrcSet/SrcNode} -> {Frontier}.

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

13 years agoSimplify parsing ellipsis in Parser::ParseAlignArgument, spotted by Doug.
Peter Collingbourne [Mon, 24 Oct 2011 17:56:00 +0000 (17:56 +0000)]
Simplify parsing ellipsis in Parser::ParseAlignArgument, spotted by Doug.

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

13 years agoConstant expression evaluation: factor out VarDecl initializer evaluation and
Richard Smith [Mon, 24 Oct 2011 17:54:18 +0000 (17:54 +0000)]
Constant expression evaluation: factor out VarDecl initializer evaluation and
caching.

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

13 years agoMinor refactoring of my last patch. Per Doug's suggestion.
Fariborz Jahanian [Mon, 24 Oct 2011 17:30:45 +0000 (17:30 +0000)]
Minor refactoring of my last patch. Per Doug's suggestion.

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

13 years ago[libclang] Make sure we don't try to erase past the StoredDiagnostics vector.
Argyrios Kyrtzidis [Mon, 24 Oct 2011 17:25:20 +0000 (17:25 +0000)]
[libclang] Make sure we don't try to erase past the StoredDiagnostics vector.

Ted came upon the bug but I couldn't make a test out of it.

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

13 years agoFix mismatched new[]/delete[].
Benjamin Kramer [Mon, 24 Oct 2011 17:22:36 +0000 (17:22 +0000)]
Fix mismatched new[]/delete[].

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

13 years agoHave -fms-no-extensions turn off -fms-compatibility
Douglas Gregor [Mon, 24 Oct 2011 15:49:38 +0000 (15:49 +0000)]
Have -fms-no-extensions turn off -fms-compatibility

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

13 years agoMake -fms-compatibility imply -fms-extensions. Fixes PR11204.
Douglas Gregor [Mon, 24 Oct 2011 15:27:23 +0000 (15:27 +0000)]
Make -fms-compatibility imply -fms-extensions. Fixes PR11204.

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

13 years agoRemove debugging printfs that some idiot left in.
David Chisnall [Mon, 24 Oct 2011 14:11:46 +0000 (14:11 +0000)]
Remove debugging printfs that some idiot left in.

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

13 years agoEnable experimental support for objc_msgSend with GNUstep ObjC runtime.
David Chisnall [Mon, 24 Oct 2011 14:07:03 +0000 (14:07 +0000)]
Enable experimental support for objc_msgSend with GNUstep ObjC runtime.

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

13 years agoRevert "Test commit"
NAKAMURA Takumi [Mon, 24 Oct 2011 10:03:25 +0000 (10:03 +0000)]
Revert "Test commit"

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

13 years agoTest commit
NAKAMURA Takumi [Mon, 24 Oct 2011 10:02:59 +0000 (10:02 +0000)]
Test commit

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

13 years agoActually rename the file AnalysisContext.cpp -> AnalysisDeclContext.cpp
Chandler Carruth [Mon, 24 Oct 2011 01:47:37 +0000 (01:47 +0000)]
Actually rename the file AnalysisContext.cpp -> AnalysisDeclContext.cpp
to match the CMakeLists.txt change in r142782; this should fix the CMake
build.

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

13 years agoRename AnalysisContext to AnalysisDeclContext. Not only is this name more accurate...
Ted Kremenek [Mon, 24 Oct 2011 01:32:45 +0000 (01:32 +0000)]
Rename AnalysisContext to AnalysisDeclContext.  Not only is this name more accurate, but it frees up the name AnalysisContext for other uses.

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

13 years agoFix grammar for C++11 alignment specifiers, and add a few FIXMEs.
Peter Collingbourne [Sun, 23 Oct 2011 20:07:52 +0000 (20:07 +0000)]
Fix grammar for C++11 alignment specifiers, and add a few FIXMEs.

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

13 years agoFix typo (C++1 -> C++11).
Peter Collingbourne [Sun, 23 Oct 2011 20:07:42 +0000 (20:07 +0000)]
Fix typo (C++1 -> C++11).

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

13 years agoDiagnose unexpanded parameter packs in member initialisers (including
Peter Collingbourne [Sun, 23 Oct 2011 18:59:44 +0000 (18:59 +0000)]
Diagnose unexpanded parameter packs in member initialisers (including
in-class member initialisers).

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

13 years agoClean up duplicated code in Sema::BuildMemInitializer.
Peter Collingbourne [Sun, 23 Oct 2011 18:59:37 +0000 (18:59 +0000)]
Clean up duplicated code in Sema::BuildMemInitializer.

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

13 years agoImprove unexpanded parameter pack diagnostics by using UPPC_Initializer here.
Peter Collingbourne [Sun, 23 Oct 2011 18:59:33 +0000 (18:59 +0000)]
Improve unexpanded parameter pack diagnostics by using UPPC_Initializer here.

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

13 years agoAttach class template attributes to the templated CXXRecordDecl,
Peter Collingbourne [Sun, 23 Oct 2011 17:07:16 +0000 (17:07 +0000)]
Attach class template attributes to the templated CXXRecordDecl,
instead of silently discarding them.

As a side effect, this improves diagnostics for constexpr class
templates slightly.

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

13 years agoReduce dependencies.
Benjamin Kramer [Sun, 23 Oct 2011 08:38:37 +0000 (08:38 +0000)]
Reduce dependencies.

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

13 years ago[analyzer] Remove LocationContext creation methods from AnalysisManager, and change...
Ted Kremenek [Sun, 23 Oct 2011 02:31:52 +0000 (02:31 +0000)]
[analyzer] Remove LocationContext creation methods from AnalysisManager, and change clients to use AnalysisContext instead.

WIP to remove/reduce ExprEngine's usage of AnalysisManager.

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

13 years agoFix a typo that completely broke the expansion of complex arguments.
Bob Wilson [Sat, 22 Oct 2011 21:42:34 +0000 (21:42 +0000)]
Fix a typo that completely broke the expansion of complex arguments.

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

13 years agoRefactor vector constant expression evaluation to return bool like all the other
Richard Smith [Sat, 22 Oct 2011 21:10:00 +0000 (21:10 +0000)]
Refactor vector constant expression evaluation to return bool like all the other
const expression evaluation subclasses, and remove some APValue copying and
malloc traffic in the process.

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

13 years agoRemove obsolete debugging macro, make helper static.
Benjamin Kramer [Sat, 22 Oct 2011 19:16:39 +0000 (19:16 +0000)]
Remove obsolete debugging macro, make helper static.

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

13 years agoPack struct better.
Benjamin Kramer [Sat, 22 Oct 2011 15:40:28 +0000 (15:40 +0000)]
Pack struct better.

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

13 years agotest/Driver/debug.c: Mark this as "REQUIRES: shell".
NAKAMURA Takumi [Sat, 22 Oct 2011 11:28:32 +0000 (11:28 +0000)]
test/Driver/debug.c: Mark this as "REQUIRES: shell".

Former RUN line does not make sense on Win32 hosts.
Win32 hosts would not be expected to set appropriate $PWD.

Latter RUN line might be made valid if PathV2::is_absolute("/foo") would be true. Unfortunately, "/foo" should not be treated as absolute path on Win32.

FYI, on mingw32 with MSYS bash (it has 'shell' feature);
Former) $PWD is set as "X:/hogehoge/test/Driver"
Latter) PWD=/foo sets "X:/root/to/msys/foo" to $PWD.

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

13 years agolib/Driver/Tools.cpp: Use PathV2::is_absolute() to add -fdebug-compilation-dir. pwd...
NAKAMURA Takumi [Sat, 22 Oct 2011 10:25:25 +0000 (10:25 +0000)]
lib/Driver/Tools.cpp: Use PathV2::is_absolute() to add -fdebug-compilation-dir. pwd[0] might not be '/' on Win32 hosts.

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

13 years agoOnly emit implicit constant conversion truncation warnings in reachable code. Appare...
Ted Kremenek [Sat, 22 Oct 2011 02:37:33 +0000 (02:37 +0000)]
Only emit implicit constant conversion truncation warnings in reachable code.  Apparently this is what GCC does, and some code depends on this.  Fixes <rdar://problem/10321089>.

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

13 years agoRefactor ThreadSafety to use PostOrderCFGView instead of its own copy (of Topological...
Ted Kremenek [Sat, 22 Oct 2011 02:14:27 +0000 (02:14 +0000)]
Refactor ThreadSafety to use PostOrderCFGView instead of its own copy (of TopologicallySortedCFG).

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

13 years agoPull TopologicallySortedCFG out of LiveVariables into its own analysis: PostOrderCFGView.
Ted Kremenek [Sat, 22 Oct 2011 02:14:23 +0000 (02:14 +0000)]
Pull TopologicallySortedCFG out of LiveVariables into its own analysis: PostOrderCFGView.

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

13 years agoFixes a minor hick up to my last patch.
Fariborz Jahanian [Sat, 22 Oct 2011 01:56:45 +0000 (01:56 +0000)]
Fixes a minor hick up to my last patch.

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

13 years agoobjc: private methods can have their attributes, no diagnostic is required.
Fariborz Jahanian [Sat, 22 Oct 2011 01:21:15 +0000 (01:21 +0000)]
objc: private methods can have their attributes, no diagnostic is required.
None private methods if their implementation have attribute, they must exactly
match those in their declarations. // rdar://10271563

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

13 years agoMake changes necessary for N32/64 ABI conformance.
Akira Hatanaka [Sat, 22 Oct 2011 00:07:27 +0000 (00:07 +0000)]
Make changes necessary for N32/64 ABI conformance.

- Size of long double is 16 bytes for both N32 and N64.
- Size of pointers and long is 8 bytes for N64.

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

13 years agoXFAIL test on Windows
Douglas Gregor [Fri, 21 Oct 2011 23:57:02 +0000 (23:57 +0000)]
XFAIL test on Windows

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

13 years agoMore speculative test tweaking
Douglas Gregor [Fri, 21 Oct 2011 23:37:41 +0000 (23:37 +0000)]
More speculative test tweaking

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

13 years agoFix PR11073 by adding the argument type information to the decl we construct
Eric Christopher [Fri, 21 Oct 2011 23:30:10 +0000 (23:30 +0000)]
Fix PR11073 by adding the argument type information to the decl we construct
for the function type. Update a testcase accordingly.

Patch initially by Anders Waldenborg!

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

13 years agoSwitch tests from grep to FileCheck
Douglas Gregor [Fri, 21 Oct 2011 23:20:41 +0000 (23:20 +0000)]
Switch tests from grep to FileCheck

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

13 years agoAdd tests for CodeGen types in MS ABI. Based on patch by r4start.
Eli Friedman [Fri, 21 Oct 2011 23:03:08 +0000 (23:03 +0000)]
Add tests for CodeGen types in MS ABI.  Based on patch by r4start.

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

13 years ago[PCH] When serializing Stmts, keep track of when sub statements are referenced again and
Argyrios Kyrtzidis [Fri, 21 Oct 2011 23:02:28 +0000 (23:02 +0000)]
[PCH] When serializing Stmts, keep track of when sub statements are referenced again and
in such a case just write out a reference of a previously serialized Stmt, instead
of serializing it all over again.

This saves memory + space + [de]serializing time, and avoids blowing up memory
with pathological cases. rdar://10293911

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

13 years agoDon't try to set the "array filler" in a InitListExpr twice.
Argyrios Kyrtzidis [Fri, 21 Oct 2011 23:02:22 +0000 (23:02 +0000)]
Don't try to set the "array filler" in a InitListExpr twice.

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

13 years agoMore ASTRecordLayout changes for MS ABI; based on patch by r4start.
Eli Friedman [Fri, 21 Oct 2011 22:49:56 +0000 (22:49 +0000)]
More ASTRecordLayout changes for MS ABI; based on patch by r4start.

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

13 years agoc++: support gcc's application of weak attribute on
Fariborz Jahanian [Fri, 21 Oct 2011 22:27:12 +0000 (22:27 +0000)]
c++: support gcc's application of weak attribute on
class declaration which forces any such class and any
class that inherits from such a class to have their
typeinfo symbols be marked as weak.
// rdar://10246395
A    test/CodeGenCXX/weak-extern-typeinfo.cpp
M    lib/Sema/SemaDeclCXX.cpp
M    lib/Sema/SemaDeclAttr.cpp
M    lib/CodeGen/CGRTTI.cpp

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

13 years agoDoug reports that this test is still failing. Try applying Benjamin Kramer's
Nick Lewycky [Fri, 21 Oct 2011 22:21:24 +0000 (22:21 +0000)]
Doug reports that this test is still failing. Try applying Benjamin Kramer's
suggestion!

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

13 years agoAdded support for thread safety attributes on destructors.
DeLesley Hutchins [Fri, 21 Oct 2011 20:51:27 +0000 (20:51 +0000)]
Added support for thread safety attributes on destructors.

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

13 years agoThread safety analysis refactoring: invalid lock expressions.
DeLesley Hutchins [Fri, 21 Oct 2011 18:10:14 +0000 (18:10 +0000)]
Thread safety analysis refactoring: invalid lock expressions.

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

13 years agoThread safety analysis: add support for attributes on constructors.
DeLesley Hutchins [Fri, 21 Oct 2011 18:06:53 +0000 (18:06 +0000)]
Thread safety analysis: add support for attributes on constructors.

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

13 years agoobjective-c: Diagnose redeclaration of private
Fariborz Jahanian [Fri, 21 Oct 2011 18:03:52 +0000 (18:03 +0000)]
objective-c: Diagnose redeclaration of private
ivars in class extensions. // rdar://10309454

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

13 years agoAdded documentation for the recently-added
Sean Callanan [Fri, 21 Oct 2011 16:15:18 +0000 (16:15 +0000)]
Added documentation for the recently-added
addDecl() and makeDeclVisibleInContextInternal()
functions, and made the latter private since it
does not and should not have external clients.

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

13 years agoRefactoring and code cleanup.
DeLesley Hutchins [Fri, 21 Oct 2011 16:14:33 +0000 (16:14 +0000)]
Refactoring and code cleanup.

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

13 years agoWhen performing name lookup for the previous declaration of a field,
Douglas Gregor [Fri, 21 Oct 2011 15:47:52 +0000 (15:47 +0000)]
When performing name lookup for the previous declaration of a field,
be sure to consider all of the possible lookup results. We were
assert()'ing (but behaving correctly) for unresolved values. Fixes
PR11134 / <rdar://problem/10290422>.

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

13 years agoPermit auto SCS on parameter declarations, C++03 [dcl.stc]p2
Peter Collingbourne [Fri, 21 Oct 2011 11:55:09 +0000 (11:55 +0000)]
Permit auto SCS on parameter declarations, C++03 [dcl.stc]p2

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

13 years agoTry to be exceedingly clever and make this test work properly whether it's run
Nick Lewycky [Fri, 21 Oct 2011 04:04:49 +0000 (04:04 +0000)]
Try to be exceedingly clever and make this test work properly whether it's run
under bash or under cmd.exe.

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

13 years agoTreat the Microsoft/Borland keyword "__except" as a context-sensitive
Douglas Gregor [Fri, 21 Oct 2011 03:57:52 +0000 (03:57 +0000)]
Treat the Microsoft/Borland keyword "__except" as a context-sensitive
keyword, because both libstdc++ and libc++ use "__except" as an
identifier. Fixes <rdar://problem/10322555>.

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

13 years agoMassage this test a little so it works when run inside the Google environment.
Nick Lewycky [Fri, 21 Oct 2011 03:07:40 +0000 (03:07 +0000)]
Massage this test a little so it works when run inside the Google environment.

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

13 years agoI added a new function to DeclContext called
Sean Callanan [Fri, 21 Oct 2011 02:57:43 +0000 (02:57 +0000)]
I added a new function to DeclContext called
addDeclInternal().  This function suppresses any
calls to FindExternalVisibleDeclsByName() while
a Decl is added to a DeclContext.  This behavior
is required for the ASTImporter, because in the
case of the LLDB client the ASTImporter would be
called recursively to import the visible decls,
which leads to assertions because the recursive
call is seeing partially-formed types.

I also modified the ASTImporter to use
addDeclInternal() in all places where it would
otherwise use addDecl().  This fix should not
affect the rest of Clang, passes Clang's
testsuite, and fixes several serious LLDB bugs.

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

13 years agoTake DW_AT_comp_dir from $PWD when it's present and starts with a '/'. This is
Nick Lewycky [Fri, 21 Oct 2011 02:32:14 +0000 (02:32 +0000)]
Take DW_AT_comp_dir from $PWD when it's present and starts with a '/'. This is
closer to what GCC does, except that GCC also checks that the inodes for $PWD
and '.' match.

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

13 years agoAdd -Wc++98-compat diagnostics for jumps which bypass initialization of non-POD
Richard Smith [Thu, 20 Oct 2011 21:42:12 +0000 (21:42 +0000)]
Add -Wc++98-compat diagnostics for jumps which bypass initialization of non-POD
but trivially constructible and destructible variables in C++11 mode. Also
incidentally improve the precision of the wording for jump diagnostics in C++98
mode.

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

13 years agoWhen fixing up the storage class for an anonymous union, don't mark
Douglas Gregor [Thu, 20 Oct 2011 20:40:00 +0000 (20:40 +0000)]
When fixing up the storage class for an anonymous union, don't mark
the anonymous union as valid: our fixes have Fix-Its.

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

13 years agoAdd test case for analyzer crash reported in <rdar://problem/10308201> (which is...
Ted Kremenek [Thu, 20 Oct 2011 19:33:06 +0000 (19:33 +0000)]
Add test case for analyzer crash reported in <rdar://problem/10308201> (which is already fixed in mainline).

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