]> granicus.if.org Git - clang/log
clang
12 years agoAdd some caching here for the builtin types.
Eric Christopher [Thu, 16 Aug 2012 23:50:46 +0000 (23:50 +0000)]
Add some caching here for the builtin types.

rdar://12117935

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

12 years agoRemove FIXME, the constraints contain more options than the
Eric Christopher [Thu, 16 Aug 2012 23:50:43 +0000 (23:50 +0000)]
Remove FIXME, the constraints contain more options than the
current available documentation.

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

12 years agoAdd a missing 'break' to ensure that we reject inline assembly
Eric Christopher [Thu, 16 Aug 2012 23:50:41 +0000 (23:50 +0000)]
Add a missing 'break' to ensure that we reject inline assembly
constraints we don't recognize.

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

12 years agoRandom string removal.
Eric Christopher [Thu, 16 Aug 2012 23:50:37 +0000 (23:50 +0000)]
Random string removal.

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

12 years agoMake isa part of objc_object at metadata generation time.
Eric Christopher [Thu, 16 Aug 2012 23:50:35 +0000 (23:50 +0000)]
Make isa part of objc_object at metadata generation time.

Noticed on inspection.

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

12 years agoFix misaligned allocation of TemplateParameterList objects.
Richard Smith [Thu, 16 Aug 2012 22:51:34 +0000 (22:51 +0000)]
Fix misaligned allocation of TemplateParameterList objects.

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

12 years ago[ms-inline asm] Comment.
Chad Rosier [Thu, 16 Aug 2012 22:47:10 +0000 (22:47 +0000)]
[ms-inline asm] Comment.

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

12 years ago[ms-inline asm] Extract a helper function, getSpelling(). Also use this on
Chad Rosier [Thu, 16 Aug 2012 22:40:32 +0000 (22:40 +0000)]
[ms-inline asm] Extract a helper function, getSpelling().  Also use this on
tokens we don't know how to handle; this should aid when debugging.

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

12 years agoobjective-C++: issue diagnostic when ivar type is
Fariborz Jahanian [Thu, 16 Aug 2012 22:38:41 +0000 (22:38 +0000)]
objective-C++: issue diagnostic when ivar type is
an abstract c++ class. // rdar://12095239

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

12 years ago[ms-inline asm] If we don't know how to handle a token then assume this is not a
Chad Rosier [Thu, 16 Aug 2012 22:30:02 +0000 (22:30 +0000)]
[ms-inline asm] If we don't know how to handle a token then assume this is not a
simple asm.

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

12 years ago[ms-inline asm] Add a helper function, isMSAsmKeyword().
Chad Rosier [Thu, 16 Aug 2012 22:25:38 +0000 (22:25 +0000)]
[ms-inline asm] Add a helper function, isMSAsmKeyword().

These require special handling, which we don't currently handle.  This is being
put in place to ensure we don't do invalid symbol table lookups or try to parse
invalid assembly.  The test cases just makes sure the latter isn't happening.

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

12 years agoRemoved unused LParenLoc parameter to ActOnCXXForRangeStmt
Sam Panzer [Thu, 16 Aug 2012 21:47:25 +0000 (21:47 +0000)]
Removed unused LParenLoc parameter to ActOnCXXForRangeStmt

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

12 years agoobjective-C: make -Wcast-of-sel-type the default.
Fariborz Jahanian [Thu, 16 Aug 2012 20:16:46 +0000 (20:16 +0000)]
objective-C: make  -Wcast-of-sel-type the default.
// rdar://12107381

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

12 years agoCommentCommandTraits: rename BeginName -> StartName for consistency.
Dmitri Gribenko [Thu, 16 Aug 2012 20:16:11 +0000 (20:16 +0000)]
CommentCommandTraits: rename BeginName -> StartName for consistency.

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

12 years ago[ms-inline asm] Perform symbol table lookup on variables. The idea is to use
Chad Rosier [Thu, 16 Aug 2012 19:52:25 +0000 (19:52 +0000)]
[ms-inline asm] Perform symbol table lookup on variables.  The idea is to use
this information to determine valid MC operands.  This will also be used for
semantic analysis.

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

12 years agoFixup test case for Release builds.
Chad Rosier [Thu, 16 Aug 2012 18:47:29 +0000 (18:47 +0000)]
Fixup test case for Release builds.

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

12 years agoobjective-C: deprecate casts of ObjC's SEL
Fariborz Jahanian [Thu, 16 Aug 2012 18:33:47 +0000 (18:33 +0000)]
objective-C: deprecate casts of ObjC's SEL
expressions except to void, void * and their
qualified versions. // rdar://12107381

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

12 years agoAttaching comments to declarations: parse the comment in context of the
Dmitri Gribenko [Thu, 16 Aug 2012 18:19:43 +0000 (18:19 +0000)]
Attaching comments to declarations: parse the comment in context of the
declaration it was attached to.

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

12 years agoRemove #if 0 that has been around for a long time.
Ted Kremenek [Thu, 16 Aug 2012 17:45:32 +0000 (17:45 +0000)]
Remove #if 0 that has been around for a long time.

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

12 years agoRemove "range_iterator" from PathDiagnosticPiece and just use ArrayRef<SourceRange...
Ted Kremenek [Thu, 16 Aug 2012 17:45:29 +0000 (17:45 +0000)]
Remove "range_iterator" from PathDiagnosticPiece and just use ArrayRef<SourceRange> for ranges.  This
removes conceptual clutter, and can allow us to easy migrate to C++11 style for-range loops if we
ever move to using C++11 in Clang.

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

12 years agoAllow multiple PathDiagnosticConsumers to be used with a BugReporter at the same...
Ted Kremenek [Thu, 16 Aug 2012 17:45:23 +0000 (17:45 +0000)]
Allow multiple PathDiagnosticConsumers to be used with a BugReporter at the same time.

This fixes several issues:

- removes egregious hack where PlistDiagnosticConsumer would forward to HTMLDiagnosticConsumer,
but diagnostics wouldn't be generated consistently in the same way if PlistDiagnosticConsumer
was used by itself.

- emitting diagnostics to the terminal (using clang's diagnostic machinery) is no longer a special
case, just another PathDiagnosticConsumer.  This also magically resolved some duplicate warnings,
as we now use PathDiagnosticConsumer's diagnostic pruning, which has scope for the entire translation
unit, not just the scope of a BugReporter (which is limited to a particular ExprEngine).

As an interesting side-effect, diagnostics emitted to the terminal also have their trailing "." stripped,
just like with diagnostics emitted to plists and HTML.  This required some tests to be updated, but now
the tests have higher fidelity with what users will see.

There are some inefficiencies in this patch.  We currently generate the report graph (from the ExplodedGraph)
once per PathDiagnosticConsumer, which is a bit wasteful, but that could be pulled up higher in the
logic stack.  There is some intended duplication, however, as we now generate different PathDiagnostics (for the same issue)
for different PathDiagnosticConsumers.  This is necessary to produce the diagnostics that a particular
consumer expects.

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

12 years agoMatchers related to DeclStmt for matching the count of declarations, a particular...
Sam Panzer [Thu, 16 Aug 2012 17:20:59 +0000 (17:20 +0000)]
Matchers related to DeclStmt for matching the count of declarations, a particular declaration within the statement, and single-Decl DeclStmts.

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

12 years ago[ms-inline asm] Start tracking which tokens are registers and which are
Chad Rosier [Thu, 16 Aug 2012 17:10:59 +0000 (17:10 +0000)]
[ms-inline asm] Start tracking which tokens are registers and which are
variables, function or label references.  The former is a potential clobber.
The latter is either an input or an output.  Unfortunately, it's difficult to
test this patch at the moment, but the added test case will eventually do so.

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

12 years agoMatchers which correspond to CastExpr, IgnoreImpCasts, IgnoreParenCasts, and IgnorePa...
Sam Panzer [Thu, 16 Aug 2012 16:58:10 +0000 (16:58 +0000)]
Matchers which correspond to CastExpr, IgnoreImpCasts, IgnoreParenCasts, and IgnoreParenImpCasts

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

12 years agoStore SourceManager pointer on PrintingPolicy in the case where we're dumping,
Richard Smith [Thu, 16 Aug 2012 03:56:14 +0000 (03:56 +0000)]
Store SourceManager pointer on PrintingPolicy in the case where we're dumping,
and remove ASTContext reference (which was frequently bound to a dereferenced
null pointer) from the recursive lump of printPretty functions. In so doing,
fix (at least) one case where we intended to use the 'dump' mode, but that
failed because a null ASTContext reference had been passed in.

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

12 years agoDon't constant-fold when pretty-printing alignment attribute. This fixes a
Richard Smith [Thu, 16 Aug 2012 02:43:29 +0000 (02:43 +0000)]
Don't constant-fold when pretty-printing alignment attribute. This fixes a
potential crasher -- Context is sometimes a null reference (!!) here.

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

12 years agoTest commit: deleted whitespace on blank line
Sam Panzer [Thu, 16 Aug 2012 02:38:47 +0000 (02:38 +0000)]
Test commit: deleted whitespace on blank line

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

12 years agoFix misaligned allocation of QualifiedTempateName and DependentTemplateName.
Richard Smith [Thu, 16 Aug 2012 01:19:31 +0000 (01:19 +0000)]
Fix misaligned allocation of QualifiedTempateName and DependentTemplateName.

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

12 years agoRemove names from the CHECK lines.
Tanya Lattner [Thu, 16 Aug 2012 00:22:16 +0000 (00:22 +0000)]
Remove names from the CHECK lines.

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

12 years agoConvert loads and stores of vec3 to vec4 to achieve better code generation. Add test...
Tanya Lattner [Thu, 16 Aug 2012 00:10:13 +0000 (00:10 +0000)]
Convert loads and stores of vec3 to vec4 to achieve better code generation. Add test case.

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

12 years ago[ms-inline asm] Add inputs and outputs to AST. No functional change.
Chad Rosier [Thu, 16 Aug 2012 00:06:53 +0000 (00:06 +0000)]
[ms-inline asm] Add inputs and outputs to AST.  No functional change.

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

12 years ago[analyzer] Look through all casts when trying to track constraints.
Jordan Rose [Thu, 16 Aug 2012 00:03:33 +0000 (00:03 +0000)]
[analyzer] Look through all casts when trying to track constraints.

Previously, we were losing path notes (in both text and plist form)
because the interesting DeclRefExpr was buried in a cast.

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

12 years agoDevirtualize calls on glvalues produced by class member access expressions.
Richard Smith [Wed, 15 Aug 2012 22:59:28 +0000 (22:59 +0000)]
Devirtualize calls on glvalues produced by class member access expressions.
Based on a patch by Yin Ma!

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

12 years agoThread safety analysis: prevent a compiler error in cases where a
DeLesley Hutchins [Wed, 15 Aug 2012 22:41:04 +0000 (22:41 +0000)]
Thread safety analysis:  prevent a compiler error in cases where a
late-parsed attribute is attached to an invalid declaration.

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

12 years ago[analyzer] If we call a C++ method on an object, assume it's non-null.
Jordan Rose [Wed, 15 Aug 2012 21:56:23 +0000 (21:56 +0000)]
[analyzer] If we call a C++ method on an object, assume it's non-null.

This is analogous to our handling of pointer dereferences: if we
dereference a pointer that may or may not be null, we assume it's non-null
from then on.

While some implementations of C++ (including ours) allow you to call a
non-virtual method through a null pointer of object type, it is technically
disallowed by the C++ standard, and should not prune out any real paths in
practice.

  [class.mfct.non-static]p1: A non-static member function may be called
    for an object of its class type, or for an object of a class derived
    from its class type...
  (a null pointer value does not refer to an object)

We can also make the same assumption about function pointers.

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

12 years ago[ms-inline asm] Use a set container to remove redundant clobbers.
Chad Rosier [Wed, 15 Aug 2012 21:55:19 +0000 (21:55 +0000)]
[ms-inline asm] Use a set container to remove redundant clobbers.

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

12 years ago[ms-inline asm] Address a FIXME by computing the number of asm statements when
Chad Rosier [Wed, 15 Aug 2012 21:08:52 +0000 (21:08 +0000)]
[ms-inline asm] Address a FIXME by computing the number of asm statements when
building the AsmString.

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

12 years ago[analyzer] Even if we are not inlining a virtual call, still invalidate!
Jordan Rose [Wed, 15 Aug 2012 21:05:15 +0000 (21:05 +0000)]
[analyzer] Even if we are not inlining a virtual call, still invalidate!

Fixes a mistake introduced in r161916.

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

12 years ago[ms-inline asm] MSVC parses multiple __asm statements on a single line as one
Chad Rosier [Wed, 15 Aug 2012 21:03:27 +0000 (21:03 +0000)]
[ms-inline asm] MSVC parses multiple __asm statements on a single line as one
statement.  For example,

  if (x)
    __asm out dx, ax  __asm out dx, ax

results in a single inline asm statement (i.e., both "out dx, ax" statements are
predicated on if(x)).

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

12 years ago[analyzer] Correctly devirtualize virtual method calls in constructors.
Jordan Rose [Wed, 15 Aug 2012 20:07:17 +0000 (20:07 +0000)]
[analyzer] Correctly devirtualize virtual method calls in constructors.

This is the other half of C++11 [class.cdtor]p4 (the destructor side
was added in r161915). This also fixes an issue with post-call checks
where the 'this' value was already being cleaned out of the state, thus
being omitted from a reconstructed CXXConstructorCall.

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

12 years agoAllow 'static' and type qualifiers in K&R parameter type lists.
Matt Beaumont-Gay [Wed, 15 Aug 2012 19:53:19 +0000 (19:53 +0000)]
Allow 'static' and type qualifiers in K&R parameter type lists.

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

12 years ago[ms-inline asm] Don't emit newlines as these are ignored by the AsmParser
Chad Rosier [Wed, 15 Aug 2012 19:12:42 +0000 (19:12 +0000)]
[ms-inline asm] Don't emit newlines as these are ignored by the AsmParser
anyways.  Also, simplify some conditional logic.

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

12 years agoAdd ASTMatcher for matching extern "C" function declarations.
Daniel Jasper [Wed, 15 Aug 2012 18:52:19 +0000 (18:52 +0000)]
Add ASTMatcher for matching extern "C" function declarations.

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

12 years agoPatch to warn about __private_extern__ on tentative definitions
Fariborz Jahanian [Wed, 15 Aug 2012 18:42:26 +0000 (18:42 +0000)]
Patch to warn about __private_extern__ on tentative definitions
as it does something unexpected (but gcc compatible).
Suggest use of __attribute__((visibility("hidden")))
on declaration instead. // rdar://7703982

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

12 years agoFix for PR#13606: http://llvm.org/bugs/show_bug.cgi?id=13606
John Criswell [Wed, 15 Aug 2012 18:40:30 +0000 (18:40 +0000)]
Fix for PR#13606: http://llvm.org/bugs/show_bug.cgi?id=13606
Changed the alignment of an LValue to be 64 bits so that we can handle
alignment values up to half of a 64-bit address space.

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

12 years ago[ms-inline asm] Add support for clobbers in CodeGen.
Chad Rosier [Wed, 15 Aug 2012 18:12:36 +0000 (18:12 +0000)]
[ms-inline asm]  Add support for clobbers in CodeGen.

This is a reapplication of r161914 now that the scoping issue has been resolved
in r161966.

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

12 years ago[ms-inline asm] Capturing loop-scoped (std::string)Reg with a StringRef is bad.
Chad Rosier [Wed, 15 Aug 2012 18:09:18 +0000 (18:09 +0000)]
[ms-inline asm] Capturing loop-scoped (std::string)Reg with a StringRef is bad.

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

12 years agoFix base type of ASTDeclNodeLister.
Michael Han [Wed, 15 Aug 2012 17:56:58 +0000 (17:56 +0000)]
Fix base type of ASTDeclNodeLister.

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

12 years ago[analyzer] Don't try to devirtualize if the class is incomplete.
Jordan Rose [Wed, 15 Aug 2012 17:33:37 +0000 (17:33 +0000)]
[analyzer] Don't try to devirtualize if the class is incomplete.

A similar issue to the previous commit, introduced by r161915.

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

12 years ago[analyzer] Only adjust the type of 'this' when we devirtualize a method call.
Jordan Rose [Wed, 15 Aug 2012 17:33:34 +0000 (17:33 +0000)]
[analyzer] Only adjust the type of 'this' when we devirtualize a method call.

With reinterpret_cast, we can get completely unrelated types in a region
hierarchy together; this was resulting in CXXBaseObjectRegions being layered
directly on an (untyped) SymbolicRegion, whose symbol was from a completely
different type hierarchy. This was what was causing the internal buildbot to
fail.

Reverts r161911, which merely masked the problem.

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

12 years ago[ms-inline asm] Add the left brace source location and improve the pretty
Chad Rosier [Wed, 15 Aug 2012 16:53:30 +0000 (16:53 +0000)]
[ms-inline asm] Add the left brace source location and improve the pretty
printer.  Patch by Enea Zaffanella <zaffanella@cs.unipr.it>.

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

12 years agoCheck for improper use of 'static' and type qualifiers in array
Hans Wennborg [Wed, 15 Aug 2012 07:42:30 +0000 (07:42 +0000)]
Check for improper use of 'static' and type qualifiers in array
declarators.

They are only allowed for function parameters, and then only on the
outermost array type derivation.

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

12 years agoRevert this to try to bring the i386 bots back.
Eric Christopher [Wed, 15 Aug 2012 06:31:06 +0000 (06:31 +0000)]
Revert this to try to bring the i386 bots back.

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

12 years agoclang/lib/Sema/SemaStmt.cpp: Include MCAsmLexer.h to appease msvc to define llvm...
NAKAMURA Takumi [Wed, 15 Aug 2012 04:19:08 +0000 (04:19 +0000)]
clang/lib/Sema/SemaStmt.cpp: Include MCAsmLexer.h to appease msvc to define llvm::AsmToken.

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

12 years agoUse the right alignment when allocating NestedNameSpecifier objects.
Richard Smith [Wed, 15 Aug 2012 01:41:43 +0000 (01:41 +0000)]
Use the right alignment when allocating NestedNameSpecifier objects.

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

12 years agoFix overallocation and underalignment of ASTTemplateArgumentListInfo objects.
Richard Smith [Wed, 15 Aug 2012 01:22:58 +0000 (01:22 +0000)]
Fix overallocation and underalignment of ASTTemplateArgumentListInfo objects.

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

12 years ago[analyzer] Doxygen comments in ObjCMethodCall.
Jordan Rose [Wed, 15 Aug 2012 00:52:03 +0000 (00:52 +0000)]
[analyzer] Doxygen comments in ObjCMethodCall.

No functionality change.

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

12 years ago[analyzer] Don't inline dynamic-dispatch methods unless -analyzer-ipa=dynamic.
Jordan Rose [Wed, 15 Aug 2012 00:52:00 +0000 (00:52 +0000)]
[analyzer] Don't inline dynamic-dispatch methods unless -analyzer-ipa=dynamic.

Previously we were checking -analyzer-ipa=dynamic-bifurcate only, and
unconditionally inlining everything else that had an available definition,
even under -analyzer-ipa=inlining (but not under -analyzer-ipa=none).

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

12 years ago[analyzer] Correctly devirtualize virtual method calls in destructors.
Jordan Rose [Wed, 15 Aug 2012 00:51:56 +0000 (00:51 +0000)]
[analyzer] Correctly devirtualize virtual method calls in destructors.

C++11 [class.cdtor]p4: When a virtual function is called directly or
  indirectly from a constructor or from a destructor, including during
  the construction or destruction of the class’s non-static data members,
  and the object to which the call applies is the object under
  construction or destruction, the function called is the final overrider
  in the constructor's or destructor's class and not one overriding it in
  a more-derived class.

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

12 years ago[ms-inline asm] Add support for clobbers in CodeGen.
Chad Rosier [Wed, 15 Aug 2012 00:43:09 +0000 (00:43 +0000)]
[ms-inline asm] Add support for clobbers in CodeGen.

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

12 years ago[ms-inline asm] Have MC start parsing the asms.
Chad Rosier [Wed, 15 Aug 2012 00:42:47 +0000 (00:42 +0000)]
[ms-inline asm] Have MC start parsing the asms.

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

12 years ago[ms-inline asm] Mark getClobber() const.
Chad Rosier [Wed, 15 Aug 2012 00:41:20 +0000 (00:41 +0000)]
[ms-inline asm] Mark getClobber() const.

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

12 years ago[analyzer] A base class needs a complete definition to provide offsets.
Jordan Rose [Wed, 15 Aug 2012 00:36:44 +0000 (00:36 +0000)]
[analyzer] A base class needs a complete definition to provide offsets.

No test case yet; trying to reduce one from a failing internal buildbot.

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

12 years agoCheck local static variables for self reference on initialization.
Richard Trieu [Tue, 14 Aug 2012 23:50:52 +0000 (23:50 +0000)]
Check local static variables for self reference on initialization.

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

12 years ago[ms-inline asm] More test cases to make sure buildMSAsmString() doesn't regress.
Chad Rosier [Tue, 14 Aug 2012 23:48:41 +0000 (23:48 +0000)]
[ms-inline asm] More test cases to make sure buildMSAsmString() doesn't regress.

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

12 years ago[ms-inline asm] Remove the last bits of LineEnds.
Chad Rosier [Tue, 14 Aug 2012 23:14:45 +0000 (23:14 +0000)]
[ms-inline asm] Remove the last bits of LineEnds.

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

12 years agoRemove trailing return flag from FunctionTypeLoc, since we now carry that
Richard Smith [Tue, 14 Aug 2012 22:51:13 +0000 (22:51 +0000)]
Remove trailing return flag from FunctionTypeLoc, since we now carry that
information on FunctionProtoType. (This also fixes one of *many* misalignment
problems in the TypeLoc hierarchy...)

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

12 years agoFix undefined behavior: reference bound to dereferenced null pointer.
Richard Smith [Tue, 14 Aug 2012 22:37:22 +0000 (22:37 +0000)]
Fix undefined behavior: reference bound to dereferenced null pointer.

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

12 years ago[ms-inline asm] Simplify more logic by using the Token::hasLeadingSpace() and
Chad Rosier [Tue, 14 Aug 2012 22:11:17 +0000 (22:11 +0000)]
[ms-inline asm] Simplify more logic by using the Token::hasLeadingSpace() and
Token::isAtStartOfLine() APIs.

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

12 years agoSmall change to avoid confusion on what "used by" means for a compiler.
Rafael Espindola [Tue, 14 Aug 2012 21:58:29 +0000 (21:58 +0000)]
Small change to avoid confusion on what "used by" means for a compiler.
Patch by Jonathan Sauer.

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

12 years ago[ms-inline asm] Address a potential buffer overflow.
Chad Rosier [Tue, 14 Aug 2012 21:48:01 +0000 (21:48 +0000)]
[ms-inline asm] Address a potential buffer overflow.

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

12 years ago[ms-inline asm] Simplify the logic in patchMSAsmString. We no longer need to
Chad Rosier [Tue, 14 Aug 2012 20:58:21 +0000 (20:58 +0000)]
[ms-inline asm] Simplify the logic in patchMSAsmString.  We no longer need to
track the LineEnds now that single line asm statments aren't merged.

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

12 years agoirgen: inline code for several of complex builtin
Fariborz Jahanian [Tue, 14 Aug 2012 20:09:28 +0000 (20:09 +0000)]
irgen: inline code for several of complex builtin
calls. // rdar://8315199

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

12 years ago[ms-inline asm] Add a helpful assert.
Chad Rosier [Tue, 14 Aug 2012 19:22:06 +0000 (19:22 +0000)]
[ms-inline asm] Add a helpful assert.

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

12 years ago[analyzer]Assume that the properties cannot be overridden when dot
Anna Zaks [Tue, 14 Aug 2012 19:19:18 +0000 (19:19 +0000)]
[analyzer]Assume that the properties cannot be overridden when dot
syntax is used.

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

12 years ago[analyzer] Address Jordan's comments for r161822, r161683.
Anna Zaks [Tue, 14 Aug 2012 18:35:06 +0000 (18:35 +0000)]
[analyzer] Address Jordan's comments for r161822, r161683.

Add a TODO test case for r161822 - calling self from a class method.

Remove a TODO comment for r161683 - value2 is not a property - we just
have method names that look like they are getters/setters for a
property.

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

12 years agoAvoid using i64 types for vld1q_lane/vst1q_lane intrinsics.
Bob Wilson [Tue, 14 Aug 2012 17:27:04 +0000 (17:27 +0000)]
Avoid using i64 types for vld1q_lane/vst1q_lane intrinsics.

The backend has to legalize i64 types by splitting them into two 32-bit pieces,
which leads to poor quality code.  If we produce code for these intrinsics that
uses one-element vector types, which can live in Neon vector registers without
getting split up, then the generated code is much better.  Radar 11998303.

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

12 years agoAttaching comments to redeclarations: fix wrong assumptions
Dmitri Gribenko [Tue, 14 Aug 2012 17:17:18 +0000 (17:17 +0000)]
Attaching comments to redeclarations: fix wrong assumptions

The reason for the recent fallout for "attaching comments to any redeclaration"
change are two false assumptions:
(1) a RawComment is attached to a single decl (not true for 'typedef struct X *Y'
    where we want the comment to be attached to both X and Y);
(2) the whole redeclaration chain has only a single comment (obviously false, the
    user can put a separate comment for each redeclaration).

To fix (1) I revert the part of the recent change where a 'Decl*' member was
introduced to RawComment.  Now ASTContext has a separate DenseMap for mapping
'Decl*' to 'FullComment*'.

To fix (2) I just removed the test with this assumption.  We might not parse
every comment in redecl chain if we already parsed at least one.

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

12 years agoChanging an enumeration to a const int to fix MSVC compiler warnings.
Aaron Ballman [Tue, 14 Aug 2012 16:46:35 +0000 (16:46 +0000)]
Changing an enumeration to a const int to fix MSVC compiler warnings.

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

12 years ago[analyzer] Remove other #if 0 from Retain Count checker.
Anna Zaks [Tue, 14 Aug 2012 15:39:13 +0000 (15:39 +0000)]
[analyzer] Remove other #if 0 from Retain Count checker.

These date back to 2009, 2011.

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

12 years ago[analyzer] Remove autorelease pools code from the Retain Count checker.
Anna Zaks [Tue, 14 Aug 2012 15:39:09 +0000 (15:39 +0000)]
[analyzer] Remove autorelease pools code from the Retain Count checker.

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

12 years agoDo NOT use inline functions with LLVM_ATTRIBUTE_USED.
Benjamin Kramer [Tue, 14 Aug 2012 14:50:32 +0000 (14:50 +0000)]
Do NOT use inline functions with LLVM_ATTRIBUTE_USED.

The function will be emitted into every single TU including the header!

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

12 years agoRemove and simplify unused checking code.
Benjamin Kramer [Tue, 14 Aug 2012 13:24:39 +0000 (13:24 +0000)]
Remove and simplify unused checking code.

This is already handled by CheckCallingConvAttr.

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

12 years agoFix horribly broken sema of __attribute__((pcs())).
Benjamin Kramer [Tue, 14 Aug 2012 13:13:47 +0000 (13:13 +0000)]
Fix horribly broken sema of __attribute__((pcs())).

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

12 years agoAdded description of clang-check -ast-dump* options.
Alexander Kornienko [Tue, 14 Aug 2012 08:31:51 +0000 (08:31 +0000)]
Added description of clang-check -ast-dump* options.

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

12 years agoEmphasize that clang-fixit is planned but not yet contributed. I should
Chandler Carruth [Tue, 14 Aug 2012 07:36:05 +0000 (07:36 +0000)]
Emphasize that clang-fixit is planned but not yet contributed. I should
really just push the initial version....

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

12 years agoFix some of my terrible spelling.
Chandler Carruth [Tue, 14 Aug 2012 07:21:00 +0000 (07:21 +0000)]
Fix some of my terrible spelling.

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

12 years agoAdd initial documentation about the new tools repository and the
Chandler Carruth [Tue, 14 Aug 2012 07:19:09 +0000 (07:19 +0000)]
Add initial documentation about the new tools repository and the
structure of how we're building concrete tools as well as tooling
infrastructure as part of the Clang project.

This documentation is definitely still rough. If anyone can improve it,
flesh it out, or help structure it in a more natural way, please, help!
=] This is not my forte, and patches here are more than welcome!

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

12 years ago[analyzer] Fixup to r161821
Anna Zaks [Tue, 14 Aug 2012 05:31:46 +0000 (05:31 +0000)]
[analyzer] Fixup to r161821

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

12 years agoFix undefined behavior: don't bind a dereferenced null pointer to a reference.
Richard Smith [Tue, 14 Aug 2012 04:19:29 +0000 (04:19 +0000)]
Fix undefined behavior: don't bind a dereferenced null pointer to a reference.
No functionality change.

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

12 years agoPlacate the mingw32 buildbot by suffixing 64-bit constants with ULL.
Richard Smith [Tue, 14 Aug 2012 03:55:16 +0000 (03:55 +0000)]
Placate the mingw32 buildbot by suffixing 64-bit constants with ULL.

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

12 years agoFix undefined behavior in code completion, caught by
Richard Smith [Tue, 14 Aug 2012 03:13:00 +0000 (03:13 +0000)]
Fix undefined behavior in code completion, caught by
-fcatch-undefined-behavior. Don't try to fit 34 different flags
into 32 bits. Also, don't use 32-bit signed left shifts for this.

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

12 years agoMake __is_convertible_to handle abstract types correctly. PR13591.
Eli Friedman [Tue, 14 Aug 2012 02:06:07 +0000 (02:06 +0000)]
Make __is_convertible_to handle abstract types correctly.  PR13591.

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

12 years agoFix undefined behavior (and wrong code, as far as I can tell) in NEON builtin
Richard Smith [Tue, 14 Aug 2012 01:28:02 +0000 (01:28 +0000)]
Fix undefined behavior (and wrong code, as far as I can tell) in NEON builtin
tablegen code, found by -fcatch-undefined-behavior. I would appreciate if
someone more familiar with the NEON code could point me in the direction of how
to write a test for this. We appear to have essentially no test coverage
whatsoever for these builtins.

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

12 years agoClean up the basic instructions for getting started with clang to always
Chandler Carruth [Tue, 14 Aug 2012 00:41:30 +0000 (00:41 +0000)]
Clean up the basic instructions for getting started with clang to always
return to the same directory.

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

12 years ago[analyzer] Teach live variable analyzes that super uses self pointer.
Anna Zaks [Tue, 14 Aug 2012 00:36:20 +0000 (00:36 +0000)]
[analyzer] Teach live variable analyzes that super uses self pointer.

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

12 years ago[analyzer] Disable autorelease pool tracking.
Anna Zaks [Tue, 14 Aug 2012 00:36:17 +0000 (00:36 +0000)]
[analyzer] Disable autorelease pool tracking.

The autorelease pool has not been implemented completely: we were adding
the autoreleased symbols to the state, but never looking at them. Until
we have a complete implementation, remove the overhead and comment out
the unused code.

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

12 years ago[analyzer] Refactor RetainReleaseChecker to go through a function call
Anna Zaks [Tue, 14 Aug 2012 00:36:15 +0000 (00:36 +0000)]
[analyzer] Refactor RetainReleaseChecker to go through a function call
to set/get/remove the RefBinding.

No functional change here. Having these setter and getter methods will
make it much easier when replacing the underlining representation of
RefBindings (I just went through the exercise). It makes the code more
readable as well.

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

12 years ago[analyzer] Add getStackFrame() to CheckerContext and ExplodedNode.
Anna Zaks [Tue, 14 Aug 2012 00:36:12 +0000 (00:36 +0000)]
[analyzer] Add getStackFrame() to CheckerContext and ExplodedNode.

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

12 years ago[analyzer] Look up DynamicTypeInfo by region instead of symbol.
Jordan Rose [Mon, 13 Aug 2012 23:59:07 +0000 (23:59 +0000)]
[analyzer] Look up DynamicTypeInfo by region instead of symbol.

This allows us to store type info for non-symbolic regions.

No functionality change.

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