]> granicus.if.org Git - clang/log
clang
11 years agoMove information about the "original file" from the ASTReader into the
Douglas Gregor [Thu, 18 Oct 2012 21:18:25 +0000 (21:18 +0000)]
Move information about the "original file" from the ASTReader into the
module files.

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

11 years agoRemove check which incorrectly suppressed printing an identifier in type printing...
Eli Friedman [Thu, 18 Oct 2012 20:58:58 +0000 (20:58 +0000)]
Remove check which incorrectly suppressed printing an identifier in type printing.  Patch by Benoit Perrot.

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

11 years agoFix AST pretty-printing for C++ new expressions with placement arguments with default...
Eli Friedman [Thu, 18 Oct 2012 20:54:37 +0000 (20:54 +0000)]
Fix AST pretty-printing for C++ new expressions with placement arguments with default values.

Based on patch by Grzegorz Jablonski.

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

11 years ago[Options] make Option a value type.
Michael J. Spencer [Thu, 18 Oct 2012 20:33:42 +0000 (20:33 +0000)]
[Options] make Option a value type.

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

11 years ago[ms-inline asm] Add a size argument to the LookupInlineAsmIdentifier() callback,
Chad Rosier [Thu, 18 Oct 2012 20:27:06 +0000 (20:27 +0000)]
[ms-inline asm] Add a size argument to the LookupInlineAsmIdentifier() callback,
which will be used by the asm matcher in the near future.

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

11 years agoFix Objective-C implicit property synthesis for C++ classes so we use valid
Eli Friedman [Thu, 18 Oct 2012 20:14:08 +0000 (20:14 +0000)]
Fix Objective-C implicit property synthesis for C++ classes so we use valid
source locations in places where it is necessary for diagnostics.  By itself,
this causes assertions, so while I'm here, also fix property synthesis
for properties of C++ class type so we use so we properly set up a scope
and mark variable declarations.

<rdar://problem/12514189>.

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

11 years agoEmit diagnostics in chunks even when we're trying to print colored template diffs.
Benjamin Kramer [Thu, 18 Oct 2012 20:09:54 +0000 (20:09 +0000)]
Emit diagnostics in chunks even when we're trying to print colored template diffs.

char-by-char is really slow on an unbuffered stream.

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

11 years ago[ms-inline asm] Have the LookupInlineAsmIdentifier() callback function return a
Chad Rosier [Thu, 18 Oct 2012 19:39:37 +0000 (19:39 +0000)]
[ms-inline asm] Have the LookupInlineAsmIdentifier() callback function return a
*NamedDecl.  In turn, build the expressions after we're finished parsing the
asm.  This avoids a crasher if the lookup fails.

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

11 years ago[analyzer] Ivar invalidation: identify properties declared in protocols.
Anna Zaks [Thu, 18 Oct 2012 19:17:57 +0000 (19:17 +0000)]
[analyzer] Ivar invalidation: identify properties declared in protocols.

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

11 years agoFactor CollectClassPropertyImplementations out of Sema into AST
Anna Zaks [Thu, 18 Oct 2012 19:17:53 +0000 (19:17 +0000)]
Factor CollectClassPropertyImplementations out of Sema into AST

This would make it possible for the analyzer to use the function.

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

11 years agoPatch for decl printer test of objective-c methods.
Fariborz Jahanian [Thu, 18 Oct 2012 19:12:17 +0000 (19:12 +0000)]
Patch for decl printer test of objective-c methods.
Patch by Dmitri Gribenko.

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

11 years agoFrom Vassil Vassilev: enable Sema to deal with multiple ExternalSemaSources.
Axel Naumann [Thu, 18 Oct 2012 19:05:02 +0000 (19:05 +0000)]
From Vassil Vassilev: enable Sema to deal with multiple ExternalSemaSources.

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

11 years agoCollapse the original file name and original file ID records into a
Douglas Gregor [Thu, 18 Oct 2012 18:36:53 +0000 (18:36 +0000)]
Collapse the original file name and original file ID records into a
single record.

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

11 years agoCollapse the "version control revision/tag" AST file record into the
Douglas Gregor [Thu, 18 Oct 2012 18:27:37 +0000 (18:27 +0000)]
Collapse the "version control revision/tag" AST file record into the
metadata record, which already had other version information. Clean up
the block info block along the way.

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

11 years agoFix more documentation comments in Comment.h
Dmitri Gribenko [Thu, 18 Oct 2012 18:21:40 +0000 (18:21 +0000)]
Fix more documentation comments in Comment.h

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

11 years agoExpand the comment for DeclInfo::CurrentDecl.
Dmitri Gribenko [Thu, 18 Oct 2012 18:18:26 +0000 (18:18 +0000)]
Expand the comment for DeclInfo::CurrentDecl.

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

11 years agoSplit the target options out into their own record within the AST
Douglas Gregor [Thu, 18 Oct 2012 17:58:09 +0000 (17:58 +0000)]
Split the target options out into their own record within the AST
file's control block.

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

11 years agoDR1442: In a range-based for statement, namespace 'std' is not an associated
Richard Smith [Thu, 18 Oct 2012 17:56:02 +0000 (17:56 +0000)]
DR1442: In a range-based for statement, namespace 'std' is not an associated
namespace.

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

11 years ago[ms-inline asm] Remove accidental commit.
Chad Rosier [Thu, 18 Oct 2012 17:51:43 +0000 (17:51 +0000)]
[ms-inline asm] Remove accidental commit.

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

11 years agoImprove comment in couple of fields of DeclInfo.
Fariborz Jahanian [Thu, 18 Oct 2012 17:32:05 +0000 (17:32 +0000)]
Improve comment in couple of fields of DeclInfo.

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

11 years agoFix this test to match recent addition of declaration tag.
Fariborz Jahanian [Thu, 18 Oct 2012 17:19:41 +0000 (17:19 +0000)]
Fix this test to match recent addition of declaration tag.

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

11 years agoPR14021: Copy lookup results to ensure safe iteration.
David Blaikie [Thu, 18 Oct 2012 16:57:32 +0000 (16:57 +0000)]
PR14021: Copy lookup results to ensure safe iteration.

Within the body of the loop the underlying map may be modified via

  Sema::AddOverloadCandidate
    -> Sema::CompareReferenceRelationship
    -> Sema::RequireCompleteType

to avoid the use of invalid iterators the sequence is copied first.

A reliable, though large, test case is available - it will be reduced and
committed shortly.

Patch by Robert Muth. Review by myself, Nico Weber, and Rafael Espindola.

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

11 years ago[ms-inline asm] Move most of the AsmParsing logic in clang back into the MC
Chad Rosier [Thu, 18 Oct 2012 15:49:40 +0000 (15:49 +0000)]
[ms-inline asm] Move most of the AsmParsing logic in clang back into the MC
layer.  Use the new ParseMSInlineAsm() API and add an implementation of the
MCAsmParserSemaCallback interface.

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

11 years agoFix typo (test commit)
Andy Gibbs [Thu, 18 Oct 2012 15:24:46 +0000 (15:24 +0000)]
Fix typo (test commit)

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

11 years agoUn-XFAIL some tests for comment to XML conversion. This reverts r166151 and
Dmitri Gribenko [Thu, 18 Oct 2012 14:33:01 +0000 (14:33 +0000)]
Un-XFAIL some tests for comment to XML conversion.  This reverts r166151 and
fixes the tests for builds without libxml2.

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

11 years agoFixed some corner cases due to implicit int TypeLoc and simplified the logic.
Abramo Bagnara [Thu, 18 Oct 2012 08:29:37 +0000 (08:29 +0000)]
Fixed some corner cases due to implicit int TypeLoc and simplified the logic.

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

11 years agoPut used="1" on all used declarations in the XML dumper. This allows us to
Nick Lewycky [Thu, 18 Oct 2012 07:55:46 +0000 (07:55 +0000)]
Put used="1" on all used declarations in the XML dumper. This allows us to
start seeing the bit so that we can find bugs and write tests for it.

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

11 years agoStart factoring the on-disk records for an AST file into a control
Douglas Gregor [Thu, 18 Oct 2012 05:31:06 +0000 (05:31 +0000)]
Start factoring the on-disk records for an AST file into a control
block, which stores information about how the AST file to generated,
from the AST block, which stores the actual serialized AST. The
information in the control block should be enough to determine whether
the AST file is up-to-date and compatible with the current translation
unit, and reading it should not cause any side effects that aren't
easy to undo. That way, we can back out from an attempt to read an
incompatible or out-of-date AST file.

Note that there is still more factoring to do. In particular,
information about the source files used to generate the AST file
(along with their time stamps, sizes, etc.) still resides in the
source manager block.

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

11 years agoRevert svn r165741 "Add TargetTransformInfo to the clang driver."
Bob Wilson [Thu, 18 Oct 2012 05:23:42 +0000 (05:23 +0000)]
Revert svn r165741 "Add TargetTransformInfo to the clang driver."

Nadav's llvm change r165665 caused problems with an LTO bootstrap of clang,
so I'm reverting it for now, along with follow-on patches like this one.

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

11 years agolibclang/CXComment.cpp: Fix abuse of StringRef.
NAKAMURA Takumi [Thu, 18 Oct 2012 01:38:53 +0000 (01:38 +0000)]
libclang/CXComment.cpp: Fix abuse of StringRef.

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

11 years agoTests for DR1507.
Richard Smith [Thu, 18 Oct 2012 00:44:17 +0000 (00:44 +0000)]
Tests for DR1507.

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

11 years ago[libclang] Invoke a ppIncludedFile callback when indexing implicit module imports.
Argyrios Kyrtzidis [Thu, 18 Oct 2012 00:17:05 +0000 (00:17 +0000)]
[libclang] Invoke a ppIncludedFile callback when indexing implicit module imports.

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

11 years ago[libclang] Add a test for annotation of module headers
Argyrios Kyrtzidis [Thu, 18 Oct 2012 00:16:56 +0000 (00:16 +0000)]
[libclang] Add a test for annotation of module headers

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

11 years agoUpdate comment to match DR1502.
Richard Smith [Wed, 17 Oct 2012 23:55:38 +0000 (23:55 +0000)]
Update comment to match DR1502.

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

11 years agoDR1535: only potentially-evaluated typeid expressions are disallowed in constant
Richard Smith [Wed, 17 Oct 2012 23:52:07 +0000 (23:52 +0000)]
DR1535: only potentially-evaluated typeid expressions are disallowed in constant
expressions, not *any* typeid on a polymorphic class type.

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

11 years agoFix -Woverloaded-virtual when the using statement refers to a base declaration of...
David Blaikie [Wed, 17 Oct 2012 23:45:39 +0000 (23:45 +0000)]
Fix -Woverloaded-virtual when the using statement refers to a base declaration of a virtual function.

GCC and Clang both do not warn on:

  struct a { virtual void func(); };
  struct b: a { virtual void func(); void func(int); };
  struct c: b { void func(int); using b::func; };

but if the "using" was using a::func GCC would still remain silent where Clang
would warn. This change makes Clang consistent with GCC's existing behavior.

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

11 years agoDR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.
Richard Smith [Wed, 17 Oct 2012 23:31:46 +0000 (23:31 +0000)]
DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.

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

11 years agoXFAIL these tests until I can figure out what is going on on
Fariborz Jahanian [Wed, 17 Oct 2012 23:25:40 +0000 (23:25 +0000)]
XFAIL these tests until I can figure out what is going on on
other platforms.

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

11 years agoAdds couple of missing warning flags so warnings can be turned
Fariborz Jahanian [Wed, 17 Oct 2012 23:19:22 +0000 (23:19 +0000)]
Adds couple of missing warning flags so warnings can be turned
off. // rdar://12501960

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

11 years agoAdd -std=c++1y argument, for *highly* experimental C++14 support.
Richard Smith [Wed, 17 Oct 2012 23:07:52 +0000 (23:07 +0000)]
Add -std=c++1y argument, for *highly* experimental C++14 support.

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

11 years ago[Doc parsing]: This patch adds <Declaration> tag to
Fariborz Jahanian [Wed, 17 Oct 2012 21:58:03 +0000 (21:58 +0000)]
[Doc parsing]: This patch adds <Declaration> tag to
XML comment for declarations which pretty-prints
declaration. I had to XFAIL one test annotate-comments.cpp.
This test is currently unmaintainable as written.
Dmitri G., can you see what we can do about this test.
We should change this test such that adding a new tag does not wreck
havoc to the test.

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

11 years ago[analyzer] CmpRuns: cleanup APIs, allow processing of plists with no
Anna Zaks [Wed, 17 Oct 2012 21:09:26 +0000 (21:09 +0000)]
[analyzer] CmpRuns: cleanup APIs, allow processing of plists with no
clang_version, fix the compare routine.

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

11 years ago[analyzer] When binding to a ParenExpr, bind to its inner expression instead.
Jordan Rose [Wed, 17 Oct 2012 19:35:44 +0000 (19:35 +0000)]
[analyzer] When binding to a ParenExpr, bind to its inner expression instead.

This actually looks through several kinds of expression, such as
OpaqueValueExpr and ExprWithCleanups. The idea is that binding and lookup
should be consistent, and so if the environment needs to be modified later,
the code doing the modification will not have to manually look through these
"transparent" expressions to find the real binding to change.

This is necessary for proper updating of struct rvalues as described in
the previous commit.

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

11 years ago[analyzer] Create a temporary region when accessing a struct rvalue.
Jordan Rose [Wed, 17 Oct 2012 19:35:37 +0000 (19:35 +0000)]
[analyzer] Create a temporary region when accessing a struct rvalue.

In C++, rvalues that need to have their address taken (for example, to be
passed to a function by const reference) will be wrapped in a
MaterializeTemporaryExpr, which lets CodeGen know to create a temporary
region to store this value. However, MaterializeTemporaryExprs are /not/
created when a method is called on an rvalue struct, even though the 'this'
pointer needs a valid value. CodeGen works around this by creating a
temporary region anyway; now, so does the analyzer.

The analyzer also does this when accessing a field of a struct rvalue.
This is a little unfortunate, since the rest of the struct will soon be
thrown away, but it does make things consistent with the rest of the
analyzer.

This allows us to bring back the assumption that all known 'this' values
are Locs. This is a revised version of r164828-9, reverted in r164876-7.

<rdar://problem/12137950>

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

11 years agoMove -Wint-to-pointer-cast from -Wall to -Wmost to group it with more things.
David Blaikie [Wed, 17 Oct 2012 18:47:30 +0000 (18:47 +0000)]
Move -Wint-to-pointer-cast from -Wall to -Wmost to group it with more things.

Addressing feedback on r166039 given by Matt Beaumont-Gay.

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

11 years agoRevert r158009 since there are some uses of artificial functions in
Eric Christopher [Wed, 17 Oct 2012 17:37:17 +0000 (17:37 +0000)]
Revert r158009 since there are some uses of artificial functions in
debug info.

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

11 years agoFix tests, which accidentally matched implicit code on specific
Daniel Jasper [Wed, 17 Oct 2012 13:35:36 +0000 (13:35 +0000)]
Fix tests, which accidentally matched implicit code on specific
platforms to make buildbots happy.

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

11 years agoRemove an unneeded flag from the bitrig driver tests.
Chandler Carruth [Wed, 17 Oct 2012 09:40:16 +0000 (09:40 +0000)]
Remove an unneeded flag from the bitrig driver tests.

Based loosely on a patch from David Hill.

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

11 years agoFirst version of matchers for Types and TypeLocs.
Daniel Jasper [Wed, 17 Oct 2012 08:52:59 +0000 (08:52 +0000)]
First version of matchers for Types and TypeLocs.

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

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

11 years agoUpdate test FIXME: The '[]' in 'delete []' is never part of a lambda.
Richard Smith [Wed, 17 Oct 2012 06:45:09 +0000 (06:45 +0000)]
Update test FIXME: The '[]' in 'delete []' is never part of a lambda.

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

11 years agoSet a special flag in class metadata when an Objective-C class
John McCall [Wed, 17 Oct 2012 04:53:31 +0000 (04:53 +0000)]
Set a special flag in class metadata when an Objective-C class
has ivars that require destruction, but none that require anything
except zero-initialization.  This is common in ARC and (when true
throughout a class hierarchy) permits the elimination of an
unnecessary message-send during allocation.

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

11 years agoOrganize and rename the magic constants for class flags.
John McCall [Wed, 17 Oct 2012 04:53:23 +0000 (04:53 +0000)]
Organize and rename the magic constants for class flags.
No functionality change.

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

11 years agoAt -O0, prefer objc_storeStrong with a null new value to the
John McCall [Wed, 17 Oct 2012 02:28:37 +0000 (02:28 +0000)]
At -O0, prefer objc_storeStrong with a null new value to the
combination of a load+objc_release;  this is generally better
for tools that try to track why values are retained and
released.  Also use objc_storeStrong when copying a block
(again, only at -O0), which requires us to do a preliminary
store of null in order to compensate for objc_storeStrong's
assign semantics.

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

11 years agoImplement C++ 10.3p16 - overrides involving deleted functions must match.
David Blaikie [Wed, 17 Oct 2012 00:47:58 +0000 (00:47 +0000)]
Implement C++ 10.3p16 - overrides involving deleted functions must match.

Only deleted functions may override deleted functions and non-deleted functions
may only override non-deleted functions.

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

11 years ago"'Might as well make it static const.' -- John McCall" -- Michael Scott
Nico Weber [Wed, 17 Oct 2012 00:34:34 +0000 (00:34 +0000)]
"'Might as well make it static const.' -- John McCall" -- Michael Scott

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

11 years agoFix the handling of target options in our unit tests.
Douglas Gregor [Wed, 17 Oct 2012 00:11:35 +0000 (00:11 +0000)]
Fix the handling of target options in our unit tests.

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

11 years agoMove test to a more appropriate place.
Eli Friedman [Tue, 16 Oct 2012 23:55:06 +0000 (23:55 +0000)]
Move test to a more appropriate place.

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

11 years agoFix pretty-printing for variables declared in a condition. Patch by Grzegorz Jablonski.
Eli Friedman [Tue, 16 Oct 2012 23:45:15 +0000 (23:45 +0000)]
Fix pretty-printing for variables declared in a condition.  Patch by Grzegorz Jablonski.

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

11 years agoSerialize TargetOptions into an AST file, and make sure that we keep
Douglas Gregor [Tue, 16 Oct 2012 23:40:58 +0000 (23:40 +0000)]
Serialize TargetOptions into an AST file, and make sure that we keep
target options around so they can be accessed at any point (rather
than keeping them transient).

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

11 years agoDR1492: In a definition of a destructor, the exception specification must be
Richard Smith [Tue, 16 Oct 2012 23:30:16 +0000 (23:30 +0000)]
DR1492: In a definition of a destructor, the exception specification must be
explicitly specified iff it was specified in the declaration.

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

11 years agoPR13684: Emit vtable entries for deleted functions as __cxa_deleted_function.
David Blaikie [Tue, 16 Oct 2012 22:56:05 +0000 (22:56 +0000)]
PR13684: Emit vtable entries for deleted functions as __cxa_deleted_function.

This is consistent/interoperable with GCC 4.7 (& __cxa_deleted_function isn't
present in 4.4 - not sure when it got added, but you'll need something with
that function available for this to work).

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

11 years agoARM ABI: fix testing case arm-abi-vector.c by using [[VAR]]
Manman Ren [Tue, 16 Oct 2012 22:40:48 +0000 (22:40 +0000)]
ARM ABI: fix testing case arm-abi-vector.c by using [[VAR]]

rdar://12439123

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

11 years agoAdd pnaclcall convention to Native Client targets.
Derek Schuff [Tue, 16 Oct 2012 22:30:41 +0000 (22:30 +0000)]
Add pnaclcall convention to Native Client targets.

Because PNaCl bitcode must be target-independent, it uses some
different bitcode representations from other targets (e.g. byval and
sret for structures). This means that without additional type
information, it cannot meet some native ABI requirements for some
targets (e.g. passing structures containing unions by value on
x86-64). To allow generation of code which uses the correct native
ABIs, we also support triples such as x86_64-nacl, which uses
target-dependent IR (as opposed to le32-nacl, which uses byval and
sret).

To allow interoperation between the two types of code, this patch adds
a calling convention attribute to be used in code compiled with the
target-dependent triple, which will generate code using the le32-style
bitcode. This calling convention does not need to be explicitly
supported in the backend because it determines bitcode representation
rather than native conventions (the backend just needs to undersand
how to handle byval and sret for the Native Client OS).

This patch implements __attribute__((pnaclcall)) to generate calls in
bitcode according to the le32 bitcode conventions, an attribute which
is accepted by any Native Client target, but issues a warning
otherwise.

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

11 years agoXFAIL this testing case to recover buildbot
Manman Ren [Tue, 16 Oct 2012 22:02:26 +0000 (22:02 +0000)]
XFAIL this testing case to recover buildbot

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

11 years ago[ms-inline asm] Move some logic around to simplify the interface between the
Chad Rosier [Tue, 16 Oct 2012 21:55:39 +0000 (21:55 +0000)]
[ms-inline asm] Move some logic around to simplify the interface between the
front-end and the AsmParser.  No functional change intended.

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

11 years agoTest pure virtual vtable entries in the Itanium ABI.
David Blaikie [Tue, 16 Oct 2012 21:03:19 +0000 (21:03 +0000)]
Test pure virtual vtable entries in the Itanium ABI.

(original functionality committed in r99807, refactored in r160373)

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

11 years agoNote deleted functions when dumping vtables.
David Blaikie [Tue, 16 Oct 2012 20:25:33 +0000 (20:25 +0000)]
Note deleted functions when dumping vtables.

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

11 years agoARM ABI: fix ABI alignment issues in varargs.
Manman Ren [Tue, 16 Oct 2012 19:51:48 +0000 (19:51 +0000)]
ARM ABI: fix ABI alignment issues in varargs.

We generalize r166040 to handle ABI alignment issues for all types.

rdar://12439123

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

11 years ago[analyzer] Expose clang_version in CmpRuns
Anna Zaks [Tue, 16 Oct 2012 19:36:39 +0000 (19:36 +0000)]
[analyzer] Expose clang_version in CmpRuns

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

11 years ago[analyzer] Ivar Invalidation: track ivars in continuations and
Anna Zaks [Tue, 16 Oct 2012 19:36:37 +0000 (19:36 +0000)]
[analyzer] Ivar Invalidation: track ivars in continuations and
@implementation.

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

11 years agoARM ABI: passing illegal vector types as varargs.
Manman Ren [Tue, 16 Oct 2012 19:18:39 +0000 (19:18 +0000)]
ARM ABI: passing illegal vector types as varargs.

We expand varargs in clang and the call site is handled in the back end, it is
hard to match exactly how illegal vectors are handled in the backend. Therefore,
we legalize the illegal vector types in clang:
if (Size <= 32), legalize to i32.
if (Size == 64), legalize to v2i32.
if (Size == 128), legalize to v4i32.
if (Size > 128), use indirect.

rdar://12439123

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

11 years agoARM ABI: fix ABI alignment issues when passing legal vector types as varargs.
Manman Ren [Tue, 16 Oct 2012 19:01:37 +0000 (19:01 +0000)]
ARM ABI: fix ABI alignment issues when passing legal vector types as varargs.

We create an aligned temporary space and copy the content over from ap.cur to
the temporary space. This is necessary if the natural alignment of the type is
greater than the ABI alignment.

rdar://12439123

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

11 years agoImplement GCC's -Wint-to-pointer-cast.
David Blaikie [Tue, 16 Oct 2012 18:53:14 +0000 (18:53 +0000)]
Implement GCC's -Wint-to-pointer-cast.

This implementation doesn't warn on anything that GCC doesn't warn on with the
exception of templates specializations (GCC doesn't warn, Clang does). The
specific skipped cases (boolean, constant expressions, enums) are open for
debate/adjustment if anyone wants to demonstrate that GCC is being overly
conservative here. The only really obvious false positive I found was in the
Clang regression suite's MPI test - apparently MPI uses specific flag values in
pointer constants. (eg: #define FOO (void*)~0)

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

11 years agoWhen using a symbol with attribute weakref, search for it first and
Joerg Sonnenberger [Tue, 16 Oct 2012 17:45:27 +0000 (17:45 +0000)]
When using a symbol with attribute weakref, search for it first and
don't try the normal GetOrCreateLLVM. The latter could drop the weak
atrtibute on the second reference, if there is no explicit declaration
of the aliasee.

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

11 years agoMinor tweak to last patch along with a test case.
Fariborz Jahanian [Tue, 16 Oct 2012 17:08:11 +0000 (17:08 +0000)]
Minor tweak to last patch along with a test case.
// rdar://12491143

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

11 years agofixes an objc crash involving objc bool literal on
Fariborz Jahanian [Tue, 16 Oct 2012 16:21:20 +0000 (16:21 +0000)]
fixes an objc crash involving objc bool literal on
hopelessly poorly written code after spewing several
errors. // rdar://12491143

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

11 years agoGNUstep runtime version default to 1.6, generate correct property attribute
David Chisnall [Tue, 16 Oct 2012 15:11:55 +0000 (15:11 +0000)]
GNUstep runtime version default to 1.6, generate correct property attribute
metadata.

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

11 years agoTransform pattern:
Alexey Samsonov [Tue, 16 Oct 2012 07:22:28 +0000 (07:22 +0000)]
Transform pattern:
  if (CGM.getModuleDebugInfo())
    DebugInfo = CGM.getModuleDebugInfo()
into a call:
  maybeInitializeDebugInfo();

This is a simplification for a possible future fix of PR13942.

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

11 years agoUse the Attributes::get method which takes an AttrVal value directly to simplify...
Bill Wendling [Tue, 16 Oct 2012 05:23:44 +0000 (05:23 +0000)]
Use the Attributes::get method which takes an AttrVal value directly to simplify the code a bit. No functionality change.

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

11 years ago[analyzer] ObjCContainersASTChecker: minor cleanup and an extra test case.
Jordan Rose [Tue, 16 Oct 2012 00:47:25 +0000 (00:47 +0000)]
[analyzer] ObjCContainersASTChecker: minor cleanup and an extra test case.

Follow-up to r165838, which fixed a potential crash.

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

11 years ago[analyzer] CmpRuns - cleaned up the API, added relative path getter
Anna Zaks [Mon, 15 Oct 2012 22:48:21 +0000 (22:48 +0000)]
[analyzer] CmpRuns - cleaned up the API, added relative path getter

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

11 years ago[analyzer] Embed the analyzer version into the plist output.
Anna Zaks [Mon, 15 Oct 2012 22:48:19 +0000 (22:48 +0000)]
[analyzer] Embed the analyzer version into the plist output.

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

11 years ago[analyzer] Enhance the error message.
Anna Zaks [Mon, 15 Oct 2012 22:48:17 +0000 (22:48 +0000)]
[analyzer] Enhance the error message.

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

11 years ago[analyzer] Do not warn on direct ivar assignments within copy methods.
Anna Zaks [Mon, 15 Oct 2012 22:48:14 +0000 (22:48 +0000)]
[analyzer] Do not warn on direct ivar assignments within copy methods.

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

11 years agoUn-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.
Daniel Dunbar [Mon, 15 Oct 2012 22:23:53 +0000 (22:23 +0000)]
Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.

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

11 years agoFixed CXXNamedCast right paren location propagation to instantiations.
Abramo Bagnara [Mon, 15 Oct 2012 21:08:58 +0000 (21:08 +0000)]
Fixed CXXNamedCast right paren location propagation to instantiations.

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

11 years agoFixed LabelDecl source range.
Abramo Bagnara [Mon, 15 Oct 2012 21:07:44 +0000 (21:07 +0000)]
Fixed LabelDecl source range.

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

11 years agoFixed ClassTemplateSpecializationDecl source range.
Abramo Bagnara [Mon, 15 Oct 2012 21:06:42 +0000 (21:06 +0000)]
Fixed ClassTemplateSpecializationDecl source range.

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

11 years agoFixed FunctionTypeLoc range for trailing return type.
Abramo Bagnara [Mon, 15 Oct 2012 21:05:46 +0000 (21:05 +0000)]
Fixed FunctionTypeLoc range for trailing return type.

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

11 years agoFixes location of overriding declaration with no comment
Fariborz Jahanian [Mon, 15 Oct 2012 20:57:52 +0000 (20:57 +0000)]
Fixes location of overriding declaration with no comment
of their own.

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

11 years agoRevert r164907 and r164902 (+ follow-ups). They broke building on 10.6.
Nico Weber [Mon, 15 Oct 2012 20:37:01 +0000 (20:37 +0000)]
Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.

See PR14013.

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

11 years agoMove the Attributes::Builder outside of the Attributes class and into its own class...
Bill Wendling [Mon, 15 Oct 2012 20:36:26 +0000 (20:36 +0000)]
Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.

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

11 years ago[ms-inline asm] Rework the front-end to use the API introduced in r165946.
Chad Rosier [Mon, 15 Oct 2012 19:56:10 +0000 (19:56 +0000)]
[ms-inline asm]  Rework the front-end to use the API introduced in r165946.

-The front-end now builds a single assembly string and feeds it to the
 AsmParser.  The front-end iterates on a per statement basis by calling the
 ParseStatement() function.  Please note, the calling of ParseStatement() and
 and any notion of MCAsmParsedOperands will be sunk into the MC layer in the
 near future.  I plan to expose more basic APIs such as getClobbers, etc.

-The enumeration of the AsmString expressions have been reworked to use SMLocs
 rather than assembly Pieces, which were being parsed in the front-end.

-The test case, t8(), was modified due to r129223.  I'll have to find a way to
 work around things such as these.

Sorry for the large commit, but breaking this in multiple smaller commits proved
too irritating.

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

11 years agostructured document comment: patch to provide comment for overriding function
Fariborz Jahanian [Mon, 15 Oct 2012 18:58:50 +0000 (18:58 +0000)]
structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration.
// rdar://12378793

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

11 years agoTeach TargetInfo to hold on to the TargetOptions with which it was
Douglas Gregor [Mon, 15 Oct 2012 16:45:32 +0000 (16:45 +0000)]
Teach TargetInfo to hold on to the TargetOptions with which it was
created.

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

11 years ago[asan] make AddressSanitizer to be a FunctionPass instead of ModulePass. clang part...
Kostya Serebryany [Mon, 15 Oct 2012 14:22:56 +0000 (14:22 +0000)]
[asan] make AddressSanitizer to be a FunctionPass instead of ModulePass. clang part: for FunctionPass we need to run asan at a different point, otherwise it will run before inlining

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

11 years agoOnly report first error when no compilation database is found.
Daniel Jasper [Mon, 15 Oct 2012 13:12:24 +0000 (13:12 +0000)]
Only report first error when no compilation database is found.

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

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

11 years agoUse enum values instead of magic numbers for indexing into the attribute list.
Bill Wendling [Mon, 15 Oct 2012 07:31:59 +0000 (07:31 +0000)]
Use enum values instead of magic numbers for indexing into the attribute list.

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

11 years agoIntroduce the notion of excluded headers into the module map
Douglas Gregor [Mon, 15 Oct 2012 06:28:11 +0000 (06:28 +0000)]
Introduce the notion of excluded headers into the module map
description. Previously, one could emulate this behavior by placing
the header in an always-unavailable submodule, but Argyrios guilted me
into expressing this idea properly.

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

11 years agoAttributes Rewrite
Bill Wendling [Mon, 15 Oct 2012 04:47:45 +0000 (04:47 +0000)]
Attributes Rewrite

Convert the uses of the Attributes class over to the new format. The
Attributes::get method call now takes an LLVM context so that the attributes
object can be uniquified and stored.

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