]>
granicus.if.org Git - clang/log
John McCall [Wed, 21 Jul 2010 01:23:41 +0000 (01:23 +0000)]
Convert the EH cleanups for base and member destructors in a constructor into
lazy cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108978
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 21 Jul 2010 01:10:17 +0000 (01:10 +0000)]
Implement zero-initialization for array new when there is an
initializer of (). Make sure to use a simple memset() when we can, or
fall back to generating a loop when a simple memset will not
suffice. Fixes <rdar://problem/
8212208 >, a regression due to my work
in r107857.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108977
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Wed, 21 Jul 2010 00:52:03 +0000 (00:52 +0000)]
Convert the end-catch call for finally blocks to a lazy cleanup. This kills off
the last of the shared-code cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108975
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Wed, 21 Jul 2010 00:46:22 +0000 (00:46 +0000)]
Allow loading identifiers from any file in the chain. WIP
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108974
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Wed, 21 Jul 2010 00:41:47 +0000 (00:41 +0000)]
Convert the ObjC @synchronized cleanups to laziness. This is not actually
a big deal, except that I want to eliminate the shared-code EH cleanups
in preparation for a significant algorithmic fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108973
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Wed, 21 Jul 2010 00:40:03 +0000 (00:40 +0000)]
Add a little helper method which will be useful soon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108972
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Tue, 20 Jul 2010 22:55:31 +0000 (22:55 +0000)]
Apparently not every system thinks that references in pairs are as cool as I think.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108959
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Tue, 20 Jul 2010 22:46:15 +0000 (22:46 +0000)]
Allow loading declarations from any file in the chain. WIP
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108956
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Tue, 20 Jul 2010 22:37:49 +0000 (22:37 +0000)]
Allow loading types from any file in the chain. WIP
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108954
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 20 Jul 2010 22:32:37 +0000 (22:32 +0000)]
Remove unintended code that was checked in as part of r108916.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108951
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 20 Jul 2010 22:20:10 +0000 (22:20 +0000)]
Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108946
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 20 Jul 2010 22:17:55 +0000 (22:17 +0000)]
Fix the IR generation for catching pointers by references.
Fixes <rdar://problem/
8212123 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108944
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 20 Jul 2010 21:55:52 +0000 (21:55 +0000)]
in 'new int[4]', constant fold the 4*4=16 instead of
doing an overflow check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108943
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Tue, 20 Jul 2010 21:50:20 +0000 (21:50 +0000)]
Allow loading source locations from any file in the chain. WIP
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108942
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 20 Jul 2010 21:34:36 +0000 (21:34 +0000)]
don't demand names to be on IR.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108937
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 20 Jul 2010 21:32:10 +0000 (21:32 +0000)]
temporarily disable this to fix the build bot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108936
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Tue, 20 Jul 2010 21:20:32 +0000 (21:20 +0000)]
More work on getting PCHReader to handle multiple files. Promote SLocOffsets to per-file data. WIP
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108930
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 20 Jul 2010 21:07:09 +0000 (21:07 +0000)]
Follow the implementation approach suggested by PR6687,
which generates more efficient and more obviously conformant
code. We now test for overflow of the multiply then force
the result to -1 if so. On X86, this generates nice code
like this:
__Z4testl: ## @_Z4testl
## BB#0: ## %entry
subl $12, %esp
movl $4, %eax
mull 16(%esp)
testl %edx, %edx
movl $-1, %ecx
cmovel %eax, %ecx
movl %ecx, (%esp)
call __Znam
addl $12, %esp
ret
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108927
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 20 Jul 2010 20:30:03 +0000 (20:30 +0000)]
Adopt objc_assign_threadlocal() for __thread variables of GC types.
Implements radar
8203301 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108917
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 20 Jul 2010 20:24:18 +0000 (20:24 +0000)]
Print template argument names for template class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108916
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 20 Jul 2010 20:19:24 +0000 (20:19 +0000)]
implement rdar://
5739832 - operator new should check for overflow in multiply,
causing clang to compile this code into something that correctly throws a
length error, fixing a potential integer overflow security attack:
void *test(long N) {
return new int[N];
}
int main() {
test(1L << 62);
}
We do this even when exceptions are disabled, because it is better for the
code to abort than for the attack to succeed.
This is heavily based on a patch that Fariborz wrote.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108915
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 20 Jul 2010 20:18:03 +0000 (20:18 +0000)]
Introduce a new lexer function to compute the "preamble" of a file,
which is the part of the file that contains all of the initial
comments, includes, and preprocessor directives that occur before any
of the actual code. Added a new -print-preamble cc1 action that is
only used for testing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108913
91177308 -0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 20 Jul 2010 20:13:52 +0000 (20:13 +0000)]
Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,
avoiding MDNode overhead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108911
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 20 Jul 2010 20:04:47 +0000 (20:04 +0000)]
Hookup checking for invalid length modifiers in scanf format strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108907
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 20 Jul 2010 20:04:42 +0000 (20:04 +0000)]
Move 'hasValidLengthModifier' from PrintfFormatSpecifier to FormatSpecifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108906
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 20 Jul 2010 20:04:36 +0000 (20:04 +0000)]
Cleanup whitespace in switch statement. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108905
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 20 Jul 2010 20:04:32 +0000 (20:04 +0000)]
Refactor ScanfConversionSpecifier to subclass ConversionSpecifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108904
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 20 Jul 2010 20:04:27 +0000 (20:04 +0000)]
Add 'ConversionSpecifier' root class in 'analyze_format_string' namespace and
derived 'PrintfConversionSpecifier' from this class. We will do the same for
'ScanfConversionSpecifier'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108903
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 20 Jul 2010 20:04:20 +0000 (20:04 +0000)]
Tidy up analyze_printf::ConversionSpecifier::Kind declaration, prepping it to be merged
with analyze_scanf::ConversionSpecifier::Kind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108902
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 20 Jul 2010 20:04:15 +0000 (20:04 +0000)]
Rename 'UnicodeStrArg' to 'SArg'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108901
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 20 Jul 2010 20:04:10 +0000 (20:04 +0000)]
Rename 'ConsumedSoFarArg' -> 'nArg' and 'OutIntPtrArg' to 'nArg' (scanf and printf checking).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108900
91177308 -0d34-0410-b5e6-
96231b3b80d8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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