]> granicus.if.org Git - clang/log
clang
14 years agoRename 'VoidPtrArg' to 'pArg' in printf/scanf checking.
Ted Kremenek [Tue, 20 Jul 2010 20:04:04 +0000 (20:04 +0000)]
Rename 'VoidPtrArg' to 'pArg' in printf/scanf checking.

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

14 years agoRename 'CStrArg' to 'sArg' for printf checking to match with the analagous enum for...
Ted Kremenek [Tue, 20 Jul 2010 20:03:58 +0000 (20:03 +0000)]
Rename 'CStrArg' to 'sArg' for printf checking to match with the analagous enum for scanf checking.

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

14 years agoRename analyze_printf::ConversionSpecifier::IntAsCharArg to 'cArg' to match
Ted Kremenek [Tue, 20 Jul 2010 20:03:49 +0000 (20:03 +0000)]
Rename analyze_printf::ConversionSpecifier::IntAsCharArg to 'cArg' to match
analagous enum in analyze_scanf.  This is prep for refactoring the logic for handling
ConversionSpecifiers for both scanf and printf.

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

14 years agoRename diagnostic so that it can be reused with scanf checking. No functionality...
Ted Kremenek [Tue, 20 Jul 2010 20:03:43 +0000 (20:03 +0000)]
Rename diagnostic so that it can be reused with scanf checking.  No functionality change.

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

14 years agodelete a loop that just generates dead code. In an example
Chris Lattner [Tue, 20 Jul 2010 18:49:33 +0000 (18:49 +0000)]
delete a loop that just generates dead code.  In an example
like this:

void *test(long N) {
  return new int[N][42][42];
}

the loop generates two dead mul instructions:

  %tmp = load i64* %N.addr                        ; <i64> [#uses=2]
  %0 = mul i64 %tmp, 7056                         ; <i64> [#uses=1]
  %1 = mul i64 %tmp, 42                           ; <i64> [#uses=1]
  %2 = mul i64 %1, 42                             ; <i64> [#uses=0]
  %call = call noalias i8* @_Znam(i64 %0)         ; <i8*> [#uses=1]

The scale of these multiplies is already handled by the typesize stuff.

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

14 years agoremove the special case for constant array sizes from
Chris Lattner [Tue, 20 Jul 2010 18:45:57 +0000 (18:45 +0000)]
remove the special case for constant array sizes from
EmitCXXNewAllocSize.  This code uses IRBuilder, which does
constant folding already.

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

14 years agoRe-apply fixed version of 108749, correctly conditionalizing the new sections on
Jim Grosbach [Tue, 20 Jul 2010 16:20:26 +0000 (16:20 +0000)]
Re-apply fixed version of 108749, correctly conditionalizing the new sections on
ObjC ABI version 2 this time.

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

14 years agoSlip up long string literal
Douglas Gregor [Tue, 20 Jul 2010 14:34:35 +0000 (14:34 +0000)]
Slip up long string literal

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

14 years agoComplain when string literals are too long for the active language
Douglas Gregor [Tue, 20 Jul 2010 14:33:20 +0000 (14:33 +0000)]
Complain when string literals are too long for the active language
standard's minimum requirements.

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

14 years agoHide FunctionTemplateDecl's specializations folding set as implementation detail...
Argyrios Kyrtzidis [Tue, 20 Jul 2010 13:59:58 +0000 (13:59 +0000)]
Hide FunctionTemplateDecl's specializations folding set as implementation detail and introduce
FunctionTemplateDecl::findSpecialization.

Redeclarations of specializations will not cause the previous decl to be removed from the set,
the set will keep the canonical decl. findSpecialization will return the most recent redeclaration.

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

14 years agoWhether the specialization should be added to template's folding set when read from...
Argyrios Kyrtzidis [Tue, 20 Jul 2010 13:59:40 +0000 (13:59 +0000)]
Whether the specialization should be added to template's folding set when read from PCH,
is determined by a isCanonicalDecl check.

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

14 years agoHide the specializations folding sets of ClassTemplateDecl as an implementation detai...
Argyrios Kyrtzidis [Tue, 20 Jul 2010 13:59:28 +0000 (13:59 +0000)]
Hide the specializations folding sets of ClassTemplateDecl as an implementation detail (InsertPos
leaks though) and add methods to its interface for adding/finding specializations.

Simplifies its users a bit and we no longer need to replace specializations in the folding set with
their redeclarations. We just return the most recent redeclarations.

As a bonus, it fixes http://llvm.org/PR7670.

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

14 years agoAdd -lstdc++ to DragonFly tools.
Rafael Espindola [Tue, 20 Jul 2010 12:59:03 +0000 (12:59 +0000)]
Add -lstdc++ to DragonFly tools.
Patch by Sascha Wildner.

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

14 years agoConstify all references to Stmt* and CFGBlock* in libChecker.
Zhongxing Xu [Tue, 20 Jul 2010 06:22:24 +0000 (06:22 +0000)]
Constify all references to Stmt* and CFGBlock* in libChecker.

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

14 years agoAdd const iterator to InitListExpr.
Zhongxing Xu [Tue, 20 Jul 2010 06:15:27 +0000 (06:15 +0000)]
Add const iterator to InitListExpr.

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

14 years agoUpdate ImplicitCastExpr to be able to represent an XValue.
Sebastian Redl [Tue, 20 Jul 2010 04:20:21 +0000 (04:20 +0000)]
Update ImplicitCastExpr to be able to represent an XValue.

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

14 years agoFix test for Win32.
Daniel Dunbar [Tue, 20 Jul 2010 04:06:54 +0000 (04:06 +0000)]
Fix test for Win32.

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

14 years agoConstify.
Zhongxing Xu [Tue, 20 Jul 2010 02:56:49 +0000 (02:56 +0000)]
Constify.

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

14 years agoremove const_cast.
Zhongxing Xu [Tue, 20 Jul 2010 02:53:15 +0000 (02:53 +0000)]
remove const_cast.

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

14 years agoDriver: Switch to using a SmallVector instead of std::vector, and stop
Daniel Dunbar [Tue, 20 Jul 2010 02:47:40 +0000 (02:47 +0000)]
Driver: Switch to using a SmallVector instead of std::vector, and stop
accessing outside the range of the vector (which always asserts on Win32).

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

14 years agoconstify.
Zhongxing Xu [Tue, 20 Jul 2010 02:46:11 +0000 (02:46 +0000)]
constify.

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

14 years agoConstify.
Zhongxing Xu [Tue, 20 Jul 2010 02:41:28 +0000 (02:41 +0000)]
Constify.

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

14 years agoAdd comments.
Zhongxing Xu [Tue, 20 Jul 2010 02:14:22 +0000 (02:14 +0000)]
Add comments.

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

14 years agoCorrect line info for declarations/definitions. Radar 8063111.
Stuart Hastings [Mon, 19 Jul 2010 23:56:31 +0000 (23:56 +0000)]
Correct line info for declarations/definitions.  Radar 8063111.

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

14 years agoand revert the related tests, too
Jim Grosbach [Mon, 19 Jul 2010 22:53:57 +0000 (22:53 +0000)]
and revert the related tests, too

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

14 years agoTemporarily revert. Some odd internal breakage is likely related.
Jim Grosbach [Mon, 19 Jul 2010 22:43:34 +0000 (22:43 +0000)]
Temporarily revert. Some odd internal breakage is likely related.

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

14 years agoRemove PCHReader::getStream(), it was unused. Inline PCHReader::getDelsCursor() into...
Sebastian Redl [Mon, 19 Jul 2010 22:38:35 +0000 (22:38 +0000)]
Remove PCHReader::getStream(), it was unused. Inline PCHReader::getDelsCursor() into its sole caller and remove it. This reduces the attack surface of multiple PCH files towards code outside the PCH implementation.

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

14 years agoPromote IdentifierOffsets to per-file data.
Sebastian Redl [Mon, 19 Jul 2010 22:28:42 +0000 (22:28 +0000)]
Promote IdentifierOffsets to per-file data.

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

14 years agoPromote DeclOffsets and TypeOffsets to per-file data.
Sebastian Redl [Mon, 19 Jul 2010 22:06:55 +0000 (22:06 +0000)]
Promote DeclOffsets and TypeOffsets to per-file data.

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

14 years agoPatch to type match comparing Objective-C Classes which implement
Fariborz Jahanian [Mon, 19 Jul 2010 22:02:22 +0000 (22:02 +0000)]
Patch to type match comparing Objective-C Classes which implement
protocols (Radar 8191774).

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

14 years agoDon't warn when a '%%' or '%*d' (scanf) is used in a format string with positional...
Ted Kremenek [Mon, 19 Jul 2010 22:01:06 +0000 (22:01 +0000)]
Don't warn when a '%%' or '%*d' (scanf) is used in a format string with positional arguments, since
these don't actually consume an argument.

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

14 years agoIntroduce a new libclang API, clang_reparseTranslationUnit(), which
Douglas Gregor [Mon, 19 Jul 2010 21:46:24 +0000 (21:46 +0000)]
Introduce a new libclang API, clang_reparseTranslationUnit(), which
reparses an already-parsed translation unit. At the moment it's just a
convenience function, but we hope to use it for performance
optimizations.

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

14 years agoUpdate tests for r108749
Jim Grosbach [Mon, 19 Jul 2010 21:39:14 +0000 (21:39 +0000)]
Update tests for r108749

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

14 years agoHook up 'invalid conversion' warning for scanf format strings.
Ted Kremenek [Mon, 19 Jul 2010 21:25:57 +0000 (21:25 +0000)]
Hook up 'invalid conversion' warning for scanf format strings.

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

14 years agoPut ObjC method names, method types and class names in separate string literal
Jim Grosbach [Mon, 19 Jul 2010 20:54:43 +0000 (20:54 +0000)]
Put ObjC method names, method types and class names in separate string literal
sections. rdar://8207705

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

14 years agoPromote the identifier table to per-file data. Also, if a CHAINED_METADATA record...
Sebastian Redl [Mon, 19 Jul 2010 20:52:06 +0000 (20:52 +0000)]
Promote the identifier table to per-file data. Also, if a CHAINED_METADATA record exists, it has to be the first thing in the PCH file.

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

14 years agoPut warnings in the 'Deprecated' group into a 'Deprecations' DiagCategory. Fixes...
Ted Kremenek [Mon, 19 Jul 2010 20:20:06 +0000 (20:20 +0000)]
Put warnings in the 'Deprecated' group into a 'Deprecations' DiagCategory.  Fixes <rdar://problem/8203182>.

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

14 years agoAdd missing conversion specifier parsing for 'u', 'x', 'o', and 's'. Fixes <rdar...
Ted Kremenek [Mon, 19 Jul 2010 19:47:40 +0000 (19:47 +0000)]
Add missing conversion specifier parsing for 'u', 'x', 'o', and 's'.  Fixes <rdar://problem/8204052>.

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

14 years agoDriver: Make -fnext-runtime the default when rewriting Objective-C.
Daniel Dunbar [Mon, 19 Jul 2010 19:44:22 +0000 (19:44 +0000)]
Driver: Make -fnext-runtime the default when rewriting Objective-C.

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

14 years agoIRgen: Add a test case I forgot to commit at some point.
Daniel Dunbar [Mon, 19 Jul 2010 17:11:38 +0000 (17:11 +0000)]
IRgen: Add a test case I forgot to commit at some point.

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

14 years agoDriver/Darwin: Add deployment target after doing argument translation, so that
Daniel Dunbar [Mon, 19 Jul 2010 17:11:36 +0000 (17:11 +0000)]
Driver/Darwin: Add deployment target after doing argument translation, so that
-mmacosx-version-min works inside a -Xarch_ flag.

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

14 years agoDriver: Factor out Darwin::AddDeploymentTarget.
Daniel Dunbar [Mon, 19 Jul 2010 17:11:33 +0000 (17:11 +0000)]
Driver: Factor out Darwin::AddDeploymentTarget.

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

14 years agoRemove unused location-to-AST-node resolver. libclang's implementation supercedes it
Douglas Gregor [Mon, 19 Jul 2010 16:18:30 +0000 (16:18 +0000)]
Remove unused location-to-AST-node resolver. libclang's implementation supercedes it

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

14 years agoCategories cannot synthesize property ivars,
Fariborz Jahanian [Mon, 19 Jul 2010 16:14:33 +0000 (16:14 +0000)]
Categories cannot synthesize property ivars,
and a minor cleanup.

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

14 years agoImplement support for reading arguments specified in a file with @file. If
Rafael Espindola [Mon, 19 Jul 2010 15:20:12 +0000 (15:20 +0000)]
Implement support for reading arguments specified in a file with @file. If
there is no file named "file", keep the @file option unchanged.

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

14 years agoFix construction of AnalysisContext. Thanks Daniel.
Zhongxing Xu [Mon, 19 Jul 2010 13:16:50 +0000 (13:16 +0000)]
Fix construction of AnalysisContext. Thanks Daniel.

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

14 years agoAdjust test for float printing differences. Windows uses three digits for the exponen...
Benjamin Kramer [Mon, 19 Jul 2010 11:48:10 +0000 (11:48 +0000)]
Adjust test for float printing differences. Windows uses three digits for the exponent, everyone else two.

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

14 years agoFix http://llvm.org/PR7660
Argyrios Kyrtzidis [Mon, 19 Jul 2010 10:14:41 +0000 (10:14 +0000)]
Fix http://llvm.org/PR7660

A ParmVarDecl instantiated from a FunctionProtoType may have Record as DeclContext,
in which case isStaticDataMember() will erroneously return true.

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

14 years agoRevert r108672, "Implement support for reading arguments specified in a file
Daniel Dunbar [Mon, 19 Jul 2010 07:21:12 +0000 (07:21 +0000)]
Revert r108672, "Implement support for reading arguments specified in a file
with @file.", it doesn't correctly handle cases where arguments starting with
'@' are passed to other command line arguments.

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

14 years agotidy up comment.
Chris Lattner [Mon, 19 Jul 2010 05:07:24 +0000 (05:07 +0000)]
tidy up comment.

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

14 years agoImplement support for reading arguments specified in a file with @file.
Rafael Espindola [Mon, 19 Jul 2010 03:08:01 +0000 (03:08 +0000)]
Implement support for reading arguments specified in a file with @file.

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

14 years agofix test case.
Zhongxing Xu [Mon, 19 Jul 2010 02:06:14 +0000 (02:06 +0000)]
fix test case.

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

14 years agoremove CallInliner.cpp.
Zhongxing Xu [Mon, 19 Jul 2010 01:55:38 +0000 (01:55 +0000)]
remove CallInliner.cpp.

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

14 years agoAdd double close check to StreamChecker. Patch by Lei Zhang.
Zhongxing Xu [Mon, 19 Jul 2010 01:52:29 +0000 (01:52 +0000)]
Add double close check to StreamChecker. Patch by Lei Zhang.

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

14 years agoReapply r108617.
Zhongxing Xu [Mon, 19 Jul 2010 01:31:21 +0000 (01:31 +0000)]
Reapply r108617.

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

14 years agoDriver: Change the driver to take the path to the main executable, instead of
Daniel Dunbar [Mon, 19 Jul 2010 00:44:04 +0000 (00:44 +0000)]
Driver: Change the driver to take the path to the main executable, instead of
taking it in pieces.
 - Fixes a problem where the Clang executable path was not initialized properly
   on Win32, because sys::Path::getBasename() doesn't do what I always think it
   does. Imagine that, a sys::Path interface that is confusing!

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

14 years agoUpdate for LLVM API change.
Daniel Dunbar [Mon, 19 Jul 2010 00:33:53 +0000 (00:33 +0000)]
Update for LLVM API change.

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

14 years agoRefactor the code a bit so that there is only one call to BuildCompilation. The
Rafael Espindola [Sun, 18 Jul 2010 22:03:55 +0000 (22:03 +0000)]
Refactor the code a bit so that there is only one call to BuildCompilation. The
StringPointers vector will also be used in the normal case to handle @file
arguments.

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

14 years agoDriver: Fix a possible use after free.
Daniel Dunbar [Sun, 18 Jul 2010 21:16:15 +0000 (21:16 +0000)]
Driver: Fix a possible use after free.

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

14 years agoFix a goof in my previous patch -- not all of the builtins return a value, some
Chandler Carruth [Sun, 18 Jul 2010 20:54:12 +0000 (20:54 +0000)]
Fix a goof in my previous patch -- not all of the builtins return a value, some
fixed return types.

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

14 years agoFix mangling for static member variables of classes inside an extern "C"
Eli Friedman [Sun, 18 Jul 2010 20:49:59 +0000 (20:49 +0000)]
Fix mangling for static member variables of classes inside an extern "C"
linkage specification.  Not sure if this is the ideal fix, but I'm reasonably
sure it's correct vs. gcc.

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

14 years agodaniel doesn't hate me, he hates macpython 2.5, which
Chris Lattner [Sun, 18 Jul 2010 18:42:35 +0000 (18:42 +0000)]
daniel doesn't hate me, he hates macpython 2.5, which
is a very reasonable position on life!

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

14 years agoWhen instantiating function definitions set parameter names to those used in template
Peter Collingbourne [Sun, 18 Jul 2010 16:45:46 +0000 (16:45 +0000)]
When instantiating function definitions set parameter names to those used in template

The rationale is that we are copying the entire definition including
parameter names which may differ between the declaration and the
definition.

This is particularly important if any parameters are unnamed in the
declaration, as a DeclRef to an unnamed ParmVarDecl would cause the
pretty printer to produce invalid output.

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

14 years agoRevert -Wdiscard-qual typo
Douglas Gregor [Sun, 18 Jul 2010 11:27:38 +0000 (11:27 +0000)]
Revert -Wdiscard-qual typo

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

14 years agoImprove the representation of the atomic builtins in a few ways. First, we make
Chandler Carruth [Sun, 18 Jul 2010 07:23:17 +0000 (07:23 +0000)]
Improve the representation of the atomic builtins in a few ways. First, we make
their call expressions synthetically have the "deduced" types based on their
first argument. We only insert conversions in the AST for arguments whose
values require conversion to match the value type expected. This keeps PR7600
closed by maintaining the return type, but avoids assertions due to unexpected
implicit casts making the type unsigned (test case added from Daniel).

The magic is moved into the codegen for the atomic builtin which inserts the
casts as needed at the IR level to raise the type to an integer suitable for
the LLVM intrinsic. This shouldn't cause any real change in functionality, but
now we can make the builtin be more truly polymorphic.

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

14 years agoBUILD_ARCHIVE is the default for libraries, no need to set it.
Chris Lattner [Sun, 18 Jul 2010 00:14:47 +0000 (00:14 +0000)]
BUILD_ARCHIVE is the default for libraries, no need to set it.

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

14 years agoFix crash initializing a bit-field with a non-constant in a place where we
Eli Friedman [Sat, 17 Jul 2010 23:55:01 +0000 (23:55 +0000)]
Fix crash initializing a bit-field with a non-constant in a place where we
try to evaluate the initializer as a constant.

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

14 years agoCheck for casts to an incomplete type in C. Improves diagnostics for cast to
Eli Friedman [Sat, 17 Jul 2010 20:43:49 +0000 (20:43 +0000)]
Check for casts to an incomplete type in C.  Improves diagnostics for cast to
incomplete union (PR5692) and incomplete enum, and fixes obscure
accepts-invalid on cast to incomplete struct.

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

14 years agoAdded PCH/ASTImporter code for ObjCIvarDecl's field.
Fariborz Jahanian [Sat, 17 Jul 2010 18:35:47 +0000 (18:35 +0000)]
Added PCH/ASTImporter code for ObjCIvarDecl's field.

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

14 years agoAdd another terrible VC++ compatibility hack: allow users to
Chris Lattner [Sat, 17 Jul 2010 16:24:30 +0000 (16:24 +0000)]
Add another terrible VC++ compatibility hack: allow users to
allow invalid token pastes (when in -fms-extensions mode)
with -Wno-invalid-token-paste

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

14 years agorename test
Chris Lattner [Sat, 17 Jul 2010 16:18:46 +0000 (16:18 +0000)]
rename test

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

14 years agorename test
Chris Lattner [Sat, 17 Jul 2010 16:17:41 +0000 (16:17 +0000)]
rename test

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

14 years agoRevert r108617, it broke the build.
Benjamin Kramer [Sat, 17 Jul 2010 13:51:58 +0000 (13:51 +0000)]
Revert r108617, it broke the build.

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

14 years agoFix cmake build.
Zhongxing Xu [Sat, 17 Jul 2010 11:59:16 +0000 (11:59 +0000)]
Fix cmake build.

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

14 years agoPrepare the analyzer for the callee in another translation unit:
Zhongxing Xu [Sat, 17 Jul 2010 11:12:42 +0000 (11:12 +0000)]
Prepare the analyzer for the callee in another translation unit:
  Let AnalysisContext contain a TranslationUnit.
  Let CallEnter refer to an AnalysisContext instead of a FunctionDecl.

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

14 years agoclang -cc1as: Switch to using AsmParser constructor function.
Daniel Dunbar [Sat, 17 Jul 2010 02:26:21 +0000 (02:26 +0000)]
clang -cc1as: Switch to using AsmParser constructor function.

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

14 years agoFix '<rdar://problem/8202272> __imag passed non-complex should not crash' by removing...
Ted Kremenek [Sat, 17 Jul 2010 01:28:55 +0000 (01:28 +0000)]
Fix '<rdar://problem/8202272> __imag passed non-complex should not crash' by removing a bogus assertion.

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

14 years agoAnother test case for on demand synthesis of ivars.
Fariborz Jahanian [Sat, 17 Jul 2010 01:16:59 +0000 (01:16 +0000)]
Another test case for on demand synthesis of ivars.

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

14 years agoPatch to synthesize property ivars on demand as
Fariborz Jahanian [Sat, 17 Jul 2010 00:59:30 +0000 (00:59 +0000)]
Patch to synthesize property ivars on demand as
part of the new property synthesis by default.
wip.

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

14 years agoThe GNU-runtime ObjC personality function doesn't let us rethrow with URR for
John McCall [Sat, 17 Jul 2010 00:43:08 +0000 (00:43 +0000)]
The GNU-runtime ObjC personality function doesn't let us rethrow with URR for
multiple reasons.  Rethrow with _objc_exception_throw instead.  Fixes PR7656.

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

14 years agoFix APFloat assertion failure in IdempotentOperationChecker resulting in having
Ted Kremenek [Sat, 17 Jul 2010 00:40:32 +0000 (00:40 +0000)]
Fix APFloat assertion failure in IdempotentOperationChecker resulting in having
an APFloat with different "float semantics" than the compared float literal.

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

14 years agoTeach the PCH reader to load the dependency when encountering a chain metadata record...
Sebastian Redl [Sat, 17 Jul 2010 00:12:06 +0000 (00:12 +0000)]
Teach the PCH reader to load the dependency when encountering a chain metadata record. WIP

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

14 years agoWhen checking whether to bind an expression to a temporary, don't bind Obj-C message...
Anders Carlsson [Fri, 16 Jul 2010 21:18:37 +0000 (21:18 +0000)]
When checking whether to bind an expression to a temporary, don't bind Obj-C message send expressions who call methods that return references.

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

14 years agoFix typeid the same way I fixed sizeof. Sad I had missed it before.
Craig Silverstein [Fri, 16 Jul 2010 21:15:34 +0000 (21:15 +0000)]
Fix typeid the same way I fixed sizeof.  Sad I had missed it before.

Reviewed by chandlerc

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

14 years agoRemove unicode quotes characters that somehow made it into a recent commit of mine.
Ted Kremenek [Fri, 16 Jul 2010 20:49:01 +0000 (20:49 +0000)]
Remove unicode quotes characters that somehow made it into a recent commit of mine.

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

14 years agoSeparate out the initial loading of a PCH so that loading chained PCHs can reuse it.
Sebastian Redl [Fri, 16 Jul 2010 20:41:52 +0000 (20:41 +0000)]
Separate out the initial loading of a PCH so that loading chained PCHs can reuse it.

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

14 years agoImproved false positive rate for the idempotent operations checker and moved it into...
Tom Care [Fri, 16 Jul 2010 20:41:41 +0000 (20:41 +0000)]
Improved false positive rate for the idempotent operations checker and moved it into the default path-sensitive analysis options.
- Added checks for static local variables, self assigned parameters, and truncating/extending self assignments
- Removed command line option (now default with --analyze)
- Updated test cases to pass with idempotent operation warnings

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

14 years agoGive the 'self/array-comparison is always true/false' warning a new flag,
Nick Lewycky [Fri, 16 Jul 2010 18:42:10 +0000 (18:42 +0000)]
Give the 'self/array-comparison is always true/false' warning a new flag,
"-Wtautological-compare".

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

14 years agoHook up warning for an incomplete scanlist in scanf format strings.
Ted Kremenek [Fri, 16 Jul 2010 18:28:03 +0000 (18:28 +0000)]
Hook up warning for an incomplete scanlist in scanf format strings.

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

14 years agoTweak zero-field width in scanf format string diagnostic.
Ted Kremenek [Fri, 16 Jul 2010 18:27:56 +0000 (18:27 +0000)]
Tweak zero-field width in scanf format string diagnostic.

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

14 years agoFirst baby steps towards PCHReader being able to keep track of multiple PCH files...
Sebastian Redl [Fri, 16 Jul 2010 17:50:48 +0000 (17:50 +0000)]
First baby steps towards PCHReader being able to keep track of multiple PCH files. WIP

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

14 years agoMake this destructor virtual to placate GCC's warnings.
Chandler Carruth [Fri, 16 Jul 2010 17:27:32 +0000 (17:27 +0000)]
Make this destructor virtual to placate GCC's warnings.

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

14 years agoFix up some of the visiting for array types -- we weren't good about
Craig Silverstein [Fri, 16 Jul 2010 17:06:12 +0000 (17:06 +0000)]
Fix up some of the visiting for array types -- we weren't good about
getting array indices before -- and for some of the builtin operators:
sizeof, offsetof, unaryops like __is_enum.

Also fix the function visitor to visit exception types in function
parameters.

Reviewed by wan and chandlerc.

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

14 years agoInitialize a couple of fields inherited for our private use.
John McCall [Fri, 16 Jul 2010 17:02:45 +0000 (17:02 +0000)]
Initialize a couple of fields inherited for our private use.

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

14 years agoWhen performing template name lookup for a dependent member access
Douglas Gregor [Fri, 16 Jul 2010 16:54:17 +0000 (16:54 +0000)]
When performing template name lookup for a dependent member access
expression such as the "foo" in "this->blah.foo<1, 2>", and we can't
look into the type of "this->blah" (e.g., because it is dependent),
look into the local scope of a template of the same name. Fixes
<rdar://problem/8198511>.

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

14 years agoAdd a little more data to chained PCHs. WIP
Sebastian Redl [Fri, 16 Jul 2010 16:36:56 +0000 (16:36 +0000)]
Add a little more data to chained PCHs. WIP

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

14 years agoRevert Microsoft-specific override of the "typedef requires a name"
Douglas Gregor [Fri, 16 Jul 2010 15:40:40 +0000 (15:40 +0000)]
Revert Microsoft-specific override of the "typedef requires a name"
diagnostic. Instead, put it and the "declaration does not declare
anything" warning into -Wmissing-declarations.

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

14 years agoSuppress the "typedef requires a name" warning in Microsoft-extensions mode
Douglas Gregor [Fri, 16 Jul 2010 15:18:19 +0000 (15:18 +0000)]
Suppress the "typedef requires a name" warning in Microsoft-extensions mode

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

14 years agoTreat template parameters as part of the declaration-specifiers for the
John McCall [Fri, 16 Jul 2010 08:13:16 +0000 (08:13 +0000)]
Treat template parameters as part of the declaration-specifiers for the
purpose of access control.  Fixes PR7644.

I can't actually find anything directly justifying this, but it seems obvious.

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

14 years agoMake this grossness default to the error it should always be.
Chandler Carruth [Fri, 16 Jul 2010 05:46:45 +0000 (05:46 +0000)]
Make this grossness default to the error it should always be.

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