Fariborz Jahanian
b59625ecea
Test for selector-warning PCH patch.
...
radar 6507158.
llvm-svn: 109261
2010-07-23 20:32:57 +00:00
Eli Friedman
d4c75cddde
Fix for PR7694: make sure to pass in a RecordType to CheckBaseClassAccess;
...
fixes crashes on both valid and invalid code. The diagnostic here could
potentially be improved, but it's good enough as-is.
llvm-svn: 109257
2010-07-23 19:25:41 +00:00
Fariborz Jahanian
c51609a0b5
PCH read/write for selector reference pool.
...
Finishes off radar 6507158.
llvm-svn: 109256
2010-07-23 19:11:11 +00:00
Ted Kremenek
ac9ca01a80
Dataflow solver: Don't overrwite the initial value of a block with top unless new values are available. Patch by Simone Pellegrini!
...
llvm-svn: 109243
2010-07-23 18:15:17 +00:00
Douglas Gregor
5cc2c8b9c3
Vectors are not integer types, so the type system should not classify
...
them as such. Type::is(Signed|Unsigned|)IntegerType() now return false
for vector types, and new functions
has(Signed|Unsigned|)IntegerRepresentation() cover integer types and
vector-of-integer types. This fixes a bunch of latent bugs.
Patch from Anton Yartsev!
llvm-svn: 109229
2010-07-23 15:58:24 +00:00
Zhongxing Xu
5e6ef6d957
Add FILE* leak check to StreamChecker. Patch by Lei Zhang.
...
llvm-svn: 109225
2010-07-23 14:14:59 +00:00
Bill Wendling
8abd1ca8d2
Remove unneeded iostream include.
...
llvm-svn: 109219
2010-07-23 07:19:31 +00:00
Zhongxing Xu
73ede01cad
Change arg type.
...
llvm-svn: 109218
2010-07-23 05:55:01 +00:00
Zhongxing Xu
692ac46a70
Delete unnecessary const_cast.
...
llvm-svn: 109211
2010-07-23 02:54:53 +00:00
Zhongxing Xu
cabfb72654
AnalysisContext is not const.
...
llvm-svn: 109210
2010-07-23 02:49:07 +00:00
Zhongxing Xu
318e40360d
Fix build on Ubuntu 10.04.
...
llvm-svn: 109208
2010-07-23 02:15:08 +00:00
Douglas Gregor
be2d8c6096
Basic plumbing for generating a precompiled preamble for an
...
ASTUnit/CXTranslationUnit. We can't actually use this preamble yet,
however.
llvm-svn: 109202
2010-07-23 00:33:23 +00:00
Fariborz Jahanian
86151343b4
Warn when property ivar lookup finds a global variable
...
of same name. In nonfragile-abi2, lookup accesses a synthesized
ivar. This is a transition warning. Radar 8225011.
llvm-svn: 109197
2010-07-22 23:33:21 +00:00
John McCall
7b5f0fe686
Ted pointed out that this test case could be using access control instead of
...
__attribute__((unavailable)). I've done so, but unfortunately there's still a case
of redundant diagnostics.
llvm-svn: 109192
2010-07-22 22:44:38 +00:00
Sebastian Redl
c67764eb4b
Thread bitstream cursors all the way through the AST reading stuff. This way, reading a trivial 2-element chained file actually works.
...
llvm-svn: 109191
2010-07-22 22:43:28 +00:00
Devang Patel
0884a60eb5
Keep track of artificial scopes introduced by line directives. For example,
...
#line 41 "bar.c"
dummy (1, i);
#line 24 "bar.h"
i = f2 (i);
#line 44 "bar.c"
This is tested by step-line.exp in gdb testsuite.
llvm-svn: 109189
2010-07-22 22:29:16 +00:00
John McCall
775f9f9919
Turn off EH cleanups for __block variables; they caused some internal buildbot
...
failures. There's a radar tracking this.
llvm-svn: 109170
2010-07-22 21:25:44 +00:00
Douglas Gregor
cd8bdd025f
Improve performance during cursor traversal when a region of interest
...
is present.
Rather than using clang_getCursorExtent(), which requires
us to lex the token at the ending position to determine its
length. Then, we'd be comparing [a, b) source ranges that cover the
characters in the range rather than the normal behavior for Clang's
source ranges, which covers the tokens in the range. However, relexing
causes us to read the source file (which may come from a precompiled
header), which is rather unfortunate and affects performance.
In the new scheme, we only use Clang-style source ranges that cover
the tokens in the range. At the entry points where this matters
(clang_annotateTokens, clang_getCursor), we make sure to move source
locations to the start of the token.
Addresses most of <rdar://problem/8049381>.
llvm-svn: 109134
2010-07-22 20:22:31 +00:00
Fariborz Jahanian
6e7e8cc19d
atch for implementation of objective-c's -Wselector
...
warning flag in clang. Little more to do
for a PCH issue. Radar 6507158.
llvm-svn: 109129
2010-07-22 18:24:20 +00:00
Nick Lewycky
a11b4bfcbe
Don't crash when an explicit template instantiation has no user-written
...
arguments. This happens in clang itself where template:
template <typename T> T const *getAs();
gets specialized with:
template<> inline clang::TypedefType const *getAs() { ... }
and there's no TemplateArgumentList.
llvm-svn: 109127
2010-07-22 17:56:53 +00:00
Argyrios Kyrtzidis
7609bca74c
Serialization is implemented, fix comments.
...
llvm-svn: 109124
2010-07-22 17:28:27 +00:00
Argyrios Kyrtzidis
2d8891cd5d
Read/write C++0x static_assert for PCH.
...
llvm-svn: 109123
2010-07-22 17:28:12 +00:00
Sebastian Redl
5c415f3e32
Allow loading declcontext information from any file in the chain. Properly write source locations to dependent files. WIP
...
llvm-svn: 109119
2010-07-22 17:01:13 +00:00
Argyrios Kyrtzidis
165b58181f
Read/write FriendTemplateDecl for PCH.
...
llvm-svn: 109113
2010-07-22 16:04:10 +00:00
Argyrios Kyrtzidis
47cd7a91f4
Support C++ try/catch statements for PCH.
...
llvm-svn: 109112
2010-07-22 16:03:56 +00:00
Zhongxing Xu
f0c133fe88
This patch adds support for tmpfile in StreamChecker. Patch by Lei Zhang.
...
llvm-svn: 109106
2010-07-22 14:01:01 +00:00
Zhongxing Xu
adf644d05e
Make a bunch of new data structures for the new analysis
...
engine of the new translation unit. State marshal is there but no real
work is done. End nodes are passed back.
llvm-svn: 109105
2010-07-22 13:52:13 +00:00
Ted Kremenek
60fe71a9e3
Fix '<rdar://problem/8214263> MakeCXCursor null dereference when body of block is invalid' by checking that the body of a BlockDecl is null before constructing a CXCursor.
...
llvm-svn: 109097
2010-07-22 11:30:19 +00:00
Ted Kremenek
2238bc156e
Update test case to include USRs containing offsets instead of line/columns.
...
llvm-svn: 109096
2010-07-22 11:30:17 +00:00
Ted Kremenek
1eb888e9c3
Switch USR generation to use file offsets instead of line/columns for anonymous symbols. Fixes <rdar://problem/8221557>.
...
llvm-svn: 109095
2010-07-22 11:14:15 +00:00
Chandler Carruth
3c31aa3a44
Fix PR7673 by allowing an empty clobbers section in an ASM statement.
...
llvm-svn: 109087
2010-07-22 07:11:21 +00:00
Chandler Carruth
96f2e9e418
Add alternate names for x86 SIMD intrinsics. These aren't as common, but show
...
up enough to be worth supporting properly. Fixes PR7674.
llvm-svn: 109086
2010-07-22 06:47:28 +00:00
Chandler Carruth
718df592f7
This was still complaining about the length of the string. I've broken it here
...
to try to keep as much logical grouping as possible.
llvm-svn: 109085
2010-07-22 06:29:13 +00:00
Daniel Dunbar
15d8830ea6
tests: Make FileCheck version check that preamble isn't longer than we expected.
...
llvm-svn: 109077
2010-07-22 02:22:24 +00:00
Daniel Dunbar
6d48476446
Driver/Darwin: Set -force_cpusubtype_ALL only by default on x86.
...
llvm-svn: 109074
2010-07-22 01:47:22 +00:00
Daniel Dunbar
43d74a3b02
build: Make sure arm_neon.h gets installed.
...
llvm-svn: 109073
2010-07-22 01:19:36 +00:00
Daniel Dunbar
a66a4d10ae
Driver/Darwin: Always allow blocks on Darwin, so that users can conditionally
...
use blocks even when targetting older systems (using runtime checks and weak
linking).
llvm-svn: 109072
2010-07-22 00:40:31 +00:00
Devang Patel
222f4be834
ObjCId is special "struct objc_object". Make this explicit in debug info.
...
This is tested by objc-rbreak.exp in gdb testsuite.
llvm-svn: 109050
2010-07-21 22:41:25 +00:00
Sebastian Redl
4e6c567653
Allow loading macros from any file in the chain. WIP
...
llvm-svn: 109048
2010-07-21 22:31:37 +00:00
Daniel Dunbar
26d0aa19d4
tests: XFAIL this test on win32, someone else can hunt this one down.
...
llvm-svn: 109044
2010-07-21 22:09:09 +00:00
Ted Kremenek
1ddd6d2b6b
Upgrade "'X' is unavailable" from a warning to an error. This matches GCC's behavior. Note that
...
GCC emits a warning instead of an error when using an unavailable Objective-C protocol, so now
Clang's behavior is more strict in this case, but more consistent. We will need to see how much
this fires on real code and determine whether this case should be downgraded to a warning.
Fixes <rdar://problem/8213093>.
llvm-svn: 109033
2010-07-21 20:43:11 +00:00
Sebastian Redl
fa0614458a
Promote some macro-related stuff to per-file data. Fix a cache-inefficient nested loop by inverting the nesting. Store the size of each file in the chain; will need this later for statement offsets.
...
llvm-svn: 109030
2010-07-21 20:07:32 +00:00
Daniel Dunbar
cb08212fd5
tests: Use FileCheck instead of external input; I think this test was failing on
...
Win32 because of line ending differences.
llvm-svn: 109029
2010-07-21 19:40:01 +00:00
Douglas Gregor
99d2cf4838
Introduce a new C API function, clang_parseTranslationUnit(), which
...
will eventually replace
clang_createTranslationUnitFromSourceFile(). The only addition in
clang_parseTranslationUnit() is a set of flags that can control how
the translation unit is loaded. More interesting flags will be coming.
llvm-svn: 109027
2010-07-21 18:52:53 +00:00
Fariborz Jahanian
da2da9c93e
Added extra check when looking for location of '=' in
...
a copy initialization.
llvm-svn: 109025
2010-07-21 18:40:47 +00:00
Fariborz Jahanian
3fd2a555d3
Fix source location of the initializer in
...
a copy initialization. Back out hack in objc rewriter.
fixes radar 8213998.
llvm-svn: 109024
2010-07-21 18:31:47 +00:00
Nate Begeman
45595cf99f
Catch thinko that Daniel Dunbar found.
...
llvm-svn: 109023
2010-07-21 18:11:42 +00:00
Devang Patel
65497583b5
Fix regression caused by r108911.
...
Do not override known debug loc with unknown debug loc.
This is tested by sections.exp in gdb testsuite.
llvm-svn: 109022
2010-07-21 18:08:50 +00:00
Fariborz Jahanian
34c85987fe
Fix a rewriter bug which originates in SemaInit involving
...
Constructor Initialization which computes Source Location
differently now. Fixes radar 8213998.
llvm-svn: 109018
2010-07-21 17:36:39 +00:00
David Chisnall
4715d161c0
Don't crash when sending a message inside a block with the non-fragile ABI (GNU runtime).
...
llvm-svn: 109012
2010-07-21 15:28:28 +00:00
David Chisnall
7fa204edc7
Mark the load after calling objc_msg_lookup_sender() so that it doesn't get optimised away (GNU runtime).
...
llvm-svn: 109010
2010-07-21 12:55:25 +00:00
John McCall
cda666ccd8
Rename LazyCleanup -> Cleanup. No functionality change for these last three
...
commits.
llvm-svn: 109000
2010-07-21 07:22:38 +00:00
John McCall
20141f2d8c
Rip out EHCleanupScope.
...
llvm-svn: 108999
2010-07-21 07:11:21 +00:00
John McCall
7535ee0352
Kill the CleanupBlock API.
...
llvm-svn: 108998
2010-07-21 07:04:01 +00:00
John McCall
65bea08879
Switch the fragile-ABI @finally/@synchronized cleanup over to using a lazy
...
cleanup.
llvm-svn: 108997
2010-07-21 06:59:36 +00:00
John McCall
0d42a41a63
Code simplification.
...
llvm-svn: 108996
2010-07-21 06:45:54 +00:00
John McCall
fb442ae7b9
Switch the main possibly-conditional temporary cleanup over to being lazy.
...
llvm-svn: 108995
2010-07-21 06:44:28 +00:00
John McCall
8680f87d99
Switch the destructor for a temporary arising from a reference binding over to
...
using a lazy cleanup.
llvm-svn: 108994
2010-07-21 06:29:51 +00:00
John McCall
da650e091f
Switch the __cxa_guard_abort cleanup to being a lazy cleanup.
...
llvm-svn: 108993
2010-07-21 06:20:50 +00:00
John McCall
a464ff9d15
Switch some random local-decl cleanups over to using lazy cleanups. Turn on
...
the block-release unwind cleanup: we're never going to test it if we don't turn
it on.
llvm-svn: 108992
2010-07-21 06:13:08 +00:00
John McCall
906da4bb52
Switch finally cleanups over to being lazy cleanups. We get basically nothing
...
from the laziness features here except better block ordering, but it removes yet
another CleanupBlock use.
llvm-svn: 108990
2010-07-21 05:47:49 +00:00
John McCall
f99a631e4e
Implement proper base/member destructor EH chaining.
...
llvm-svn: 108989
2010-07-21 05:30:47 +00:00
Zhongxing Xu
2e01b80356
Move some methods inline.
...
llvm-svn: 108988
2010-07-21 05:21:41 +00:00
Nate Begeman
6e8865a150
Fix win64 compilation of constants like 0xFFFFFFFFFFFFFFFFULL
...
intmax_t is __int64 (long long to clang), per VS 2010 stdint.h
llvm-svn: 108980
2010-07-21 02:02:56 +00:00
John McCall
53cad2ef04
Change PushDestructorCleanup to use lazy cleanups.
...
llvm-svn: 108979
2010-07-21 01:41:18 +00:00
John McCall
1d9875654f
Convert the EH cleanups for base and member destructors in a constructor into
...
lazy cleanups.
llvm-svn: 108978
2010-07-21 01:23:41 +00:00
Douglas Gregor
05fc5be32f
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.
llvm-svn: 108977
2010-07-21 01:10:17 +00:00
John McCall
1e67040fb7
Convert the end-catch call for finally blocks to a lazy cleanup. This kills off
...
the last of the shared-code cleanups.
llvm-svn: 108975
2010-07-21 00:52:03 +00:00
Sebastian Redl
c713b9665b
Allow loading identifiers from any file in the chain. WIP
...
llvm-svn: 108974
2010-07-21 00:46:22 +00:00
John McCall
c20acd31f7
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.
llvm-svn: 108973
2010-07-21 00:41:47 +00:00
John McCall
8f51041184
Add a little helper method which will be useful soon.
...
llvm-svn: 108972
2010-07-21 00:40:03 +00:00
Sebastian Redl
b2831dbff7
Apparently not every system thinks that references in pairs are as cool as I think.
...
llvm-svn: 108959
2010-07-20 22:55:31 +00:00
Sebastian Redl
3462779369
Allow loading declarations from any file in the chain. WIP
...
llvm-svn: 108956
2010-07-20 22:46:15 +00:00
Sebastian Redl
837a6cbe03
Allow loading types from any file in the chain. WIP
...
llvm-svn: 108954
2010-07-20 22:37:49 +00:00
Devang Patel
0043977f09
Remove unintended code that was checked in as part of r108916.
...
llvm-svn: 108951
2010-07-20 22:32:37 +00:00
Devang Patel
11a42a4655
Remove unused argument.
...
llvm-svn: 108946
2010-07-20 22:20:10 +00:00
John McCall
5add20cefa
Fix the IR generation for catching pointers by references.
...
Fixes <rdar://problem/8212123>.
llvm-svn: 108944
2010-07-20 22:17:55 +00:00
Chris Lattner
32ac583d91
in 'new int[4]', constant fold the 4*4=16 instead of
...
doing an overflow check.
llvm-svn: 108943
2010-07-20 21:55:52 +00:00
Sebastian Redl
0675030cf9
Allow loading source locations from any file in the chain. WIP
...
llvm-svn: 108942
2010-07-20 21:50:20 +00:00
Chris Lattner
94027202e0
don't demand names to be on IR.
...
llvm-svn: 108937
2010-07-20 21:34:36 +00:00
Chris Lattner
2be2074f75
temporarily disable this to fix the build bot.
...
llvm-svn: 108936
2010-07-20 21:32:10 +00:00
Sebastian Redl
b293a45d28
More work on getting PCHReader to handle multiple files. Promote SLocOffsets to per-file data. WIP
...
llvm-svn: 108930
2010-07-20 21:20:32 +00:00
Chris Lattner
f2f3870189
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
llvm-svn: 108927
2010-07-20 21:07:09 +00:00
Fariborz Jahanian
217af240b5
Adopt objc_assign_threadlocal() for __thread variables of GC types.
...
Implements radar 8203301.
llvm-svn: 108917
2010-07-20 20:30:03 +00:00
Devang Patel
6c01820900
Print template argument names for template class.
...
llvm-svn: 108916
2010-07-20 20:24:18 +00:00
Chris Lattner
26008e07de
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.
llvm-svn: 108915
2010-07-20 20:19:24 +00:00
Douglas Gregor
af82e3510b
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.
llvm-svn: 108913
2010-07-20 20:18:03 +00:00
Dan Gohman
481e40c681
Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,
...
avoiding MDNode overhead.
llvm-svn: 108911
2010-07-20 20:13:52 +00:00
Ted Kremenek
4407ea4948
Hookup checking for invalid length modifiers in scanf format strings.
...
llvm-svn: 108907
2010-07-20 20:04:47 +00:00
Ted Kremenek
ea28f83a5f
Move 'hasValidLengthModifier' from PrintfFormatSpecifier to FormatSpecifier.
...
llvm-svn: 108906
2010-07-20 20:04:42 +00:00
Ted Kremenek
36521956f7
Cleanup whitespace in switch statement. No functionality change.
...
llvm-svn: 108905
2010-07-20 20:04:36 +00:00
Ted Kremenek
bb0ffd7ade
Refactor ScanfConversionSpecifier to subclass ConversionSpecifier.
...
llvm-svn: 108904
2010-07-20 20:04:32 +00:00
Ted Kremenek
f03e6d85a1
Add 'ConversionSpecifier' root class in 'analyze_format_string' namespace and
...
derived 'PrintfConversionSpecifier' from this class. We will do the same for
'ScanfConversionSpecifier'.
llvm-svn: 108903
2010-07-20 20:04:27 +00:00
Ted Kremenek
fe1316882c
Tidy up analyze_printf::ConversionSpecifier::Kind declaration, prepping it to be merged
...
with analyze_scanf::ConversionSpecifier::Kind.
llvm-svn: 108902
2010-07-20 20:04:20 +00:00
Ted Kremenek
348d1499c1
Rename 'UnicodeStrArg' to 'SArg'.
...
llvm-svn: 108901
2010-07-20 20:04:15 +00:00
Ted Kremenek
516ef222ba
Rename 'ConsumedSoFarArg' -> 'nArg' and 'OutIntPtrArg' to 'nArg' (scanf and printf checking).
...
llvm-svn: 108900
2010-07-20 20:04:10 +00:00
Ted Kremenek
1ce32be36a
Rename 'VoidPtrArg' to 'pArg' in printf/scanf checking.
...
llvm-svn: 108899
2010-07-20 20:04:04 +00:00
Ted Kremenek
563e3edbc2
Rename 'CStrArg' to 'sArg' for printf checking to match with the analagous enum for scanf checking.
...
llvm-svn: 108898
2010-07-20 20:03:58 +00:00
Ted Kremenek
ab0fe8a48d
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.
llvm-svn: 108897
2010-07-20 20:03:49 +00:00
Ted Kremenek
b65a9d5a1a
Rename diagnostic so that it can be reused with scanf checking. No functionality change.
...
llvm-svn: 108896
2010-07-20 20:03:43 +00:00
Chris Lattner
b7a95cf165
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.
llvm-svn: 108884
2010-07-20 18:49:33 +00:00
Chris Lattner
cb46bdc34f
remove the special case for constant array sizes from
...
EmitCXXNewAllocSize. This code uses IRBuilder, which does
constant folding already.
llvm-svn: 108882
2010-07-20 18:45:57 +00:00
Jim Grosbach
71d963e954
Re-apply fixed version of 108749, correctly conditionalizing the new sections on
...
ObjC ABI version 2 this time.
llvm-svn: 108847
2010-07-20 16:20:26 +00:00
Douglas Gregor
73a18fdd39
Slip up long string literal
...
llvm-svn: 108838
2010-07-20 14:34:35 +00:00
Douglas Gregor
b37b46e488
Complain when string literals are too long for the active language
...
standard's minimum requirements.
llvm-svn: 108837
2010-07-20 14:33:20 +00:00
Argyrios Kyrtzidis
dde5790562
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.
llvm-svn: 108834
2010-07-20 13:59:58 +00:00
Argyrios Kyrtzidis
c1624e9eda
Whether the specialization should be added to template's folding set when read from PCH,
...
is determined by a isCanonicalDecl check.
llvm-svn: 108833
2010-07-20 13:59:40 +00:00
Argyrios Kyrtzidis
47470f2f3f
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 .
llvm-svn: 108832
2010-07-20 13:59:28 +00:00
Rafael Espindola
38360b3ff7
Add -lstdc++ to DragonFly tools.
...
Patch by Sascha Wildner.
llvm-svn: 108830
2010-07-20 12:59:03 +00:00
Zhongxing Xu
edb77fe8b4
Constify all references to Stmt* and CFGBlock* in libChecker.
...
llvm-svn: 108811
2010-07-20 06:22:24 +00:00
Zhongxing Xu
09a95d7448
Add const iterator to InitListExpr.
...
llvm-svn: 108810
2010-07-20 06:15:27 +00:00
Sebastian Redl
c57d34bc35
Update ImplicitCastExpr to be able to represent an XValue.
...
llvm-svn: 108807
2010-07-20 04:20:21 +00:00
Daniel Dunbar
08d047666a
Fix test for Win32.
...
llvm-svn: 108806
2010-07-20 04:06:54 +00:00
Zhongxing Xu
6694255306
Constify.
...
llvm-svn: 108804
2010-07-20 02:56:49 +00:00
Zhongxing Xu
70856f7986
remove const_cast.
...
llvm-svn: 108803
2010-07-20 02:53:15 +00:00
Daniel Dunbar
9d8416b799
Driver: Switch to using a SmallVector instead of std::vector, and stop
...
accessing outside the range of the vector (which always asserts on Win32).
llvm-svn: 108802
2010-07-20 02:47:40 +00:00
Zhongxing Xu
3e02548d22
constify.
...
llvm-svn: 108801
2010-07-20 02:46:11 +00:00
Zhongxing Xu
c2acbe0f45
Constify.
...
llvm-svn: 108800
2010-07-20 02:41:28 +00:00
Zhongxing Xu
08ce5dd0f0
Add comments.
...
llvm-svn: 108795
2010-07-20 02:14:22 +00:00
Stuart Hastings
7d7bc561bf
Correct line info for declarations/definitions. Radar 8063111.
...
llvm-svn: 108785
2010-07-19 23:56:31 +00:00
Jim Grosbach
428a7103d9
and revert the related tests, too
...
llvm-svn: 108766
2010-07-19 22:53:57 +00:00
Jim Grosbach
50c63168ed
Temporarily revert. Some odd internal breakage is likely related.
...
llvm-svn: 108764
2010-07-19 22:43:34 +00:00
Sebastian Redl
3d3f0b1039
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.
...
llvm-svn: 108763
2010-07-19 22:38:35 +00:00
Sebastian Redl
bd1b5befee
Promote IdentifierOffsets to per-file data.
...
llvm-svn: 108762
2010-07-19 22:28:42 +00:00
Sebastian Redl
9e687994f3
Promote DeclOffsets and TypeOffsets to per-file data.
...
llvm-svn: 108760
2010-07-19 22:06:55 +00:00
Fariborz Jahanian
3c7ebc3a5e
Patch to type match comparing Objective-C Classes which implement
...
protocols (Radar 8191774).
llvm-svn: 108758
2010-07-19 22:02:22 +00:00
Ted Kremenek
6cd694233d
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.
llvm-svn: 108757
2010-07-19 22:01:06 +00:00
Douglas Gregor
aa21cc401b
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.
llvm-svn: 108756
2010-07-19 21:46:24 +00:00
Jim Grosbach
6331d9781c
Update tests for r108749
...
llvm-svn: 108754
2010-07-19 21:39:14 +00:00
Ted Kremenek
ce81542d61
Hook up 'invalid conversion' warning for scanf format strings.
...
llvm-svn: 108750
2010-07-19 21:25:57 +00:00
Jim Grosbach
f699594de8
Put ObjC method names, method types and class names in separate string literal
...
sections. rdar://8207705
llvm-svn: 108749
2010-07-19 20:54:43 +00:00
Sebastian Redl
393f8b76c0
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.
...
llvm-svn: 108748
2010-07-19 20:52:06 +00:00
Ted Kremenek
f34f346dac
Put warnings in the 'Deprecated' group into a 'Deprecations' DiagCategory. Fixes <rdar://problem/8203182>.
...
llvm-svn: 108743
2010-07-19 20:20:06 +00:00
Ted Kremenek
5c3e1b9a54
Add missing conversion specifier parsing for 'u', 'x', 'o', and 's'. Fixes <rdar://problem/8204052>.
...
llvm-svn: 108742
2010-07-19 19:47:40 +00:00
Daniel Dunbar
99b5524324
Driver: Make -fnext-runtime the default when rewriting Objective-C.
...
llvm-svn: 108741
2010-07-19 19:44:22 +00:00
Daniel Dunbar
2c91be4261
IRgen: Add a test case I forgot to commit at some point.
...
llvm-svn: 108713
2010-07-19 17:11:38 +00:00
Daniel Dunbar
354e96df95
Driver/Darwin: Add deployment target after doing argument translation, so that
...
-mmacosx-version-min works inside a -Xarch_ flag.
llvm-svn: 108712
2010-07-19 17:11:36 +00:00
Daniel Dunbar
b2b8a91aa4
Driver: Factor out Darwin::AddDeploymentTarget.
...
llvm-svn: 108711
2010-07-19 17:11:33 +00:00
Douglas Gregor
549c1cd2c5
Remove unused location-to-AST-node resolver. libclang's implementation supercedes it
...
llvm-svn: 108708
2010-07-19 16:18:30 +00:00
Fariborz Jahanian
2a36089eef
Categories cannot synthesize property ivars,
...
and a minor cleanup.
llvm-svn: 108707
2010-07-19 16:14:33 +00:00
Rafael Espindola
77a067a653
Implement support for reading arguments specified in a file with @file . If
...
there is no file named "file", keep the @file option unchanged.
llvm-svn: 108697
2010-07-19 15:20:12 +00:00
Zhongxing Xu
eb2528104a
Fix construction of AnalysisContext. Thanks Daniel.
...
llvm-svn: 108694
2010-07-19 13:16:50 +00:00
Benjamin Kramer
1b925d5717
Adjust test for float printing differences. Windows uses three digits for the exponent, everyone else two.
...
llvm-svn: 108693
2010-07-19 11:48:10 +00:00
Argyrios Kyrtzidis
3816ed4d58
Fix http://llvm.org/PR7660
...
A ParmVarDecl instantiated from a FunctionProtoType may have Record as DeclContext,
in which case isStaticDataMember() will erroneously return true.
llvm-svn: 108692
2010-07-19 10:14:41 +00:00
Daniel Dunbar
00c57967da
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.
llvm-svn: 108686
2010-07-19 07:21:12 +00:00
Chris Lattner
8d72f2aa3a
tidy up comment.
...
llvm-svn: 108676
2010-07-19 05:07:24 +00:00
Rafael Espindola
129e43d29b
Implement support for reading arguments specified in a file with @file .
...
llvm-svn: 108672
2010-07-19 03:08:01 +00:00
Zhongxing Xu
cf144c6322
fix test case.
...
llvm-svn: 108671
2010-07-19 02:06:14 +00:00
Zhongxing Xu
a74af93eaf
remove CallInliner.cpp.
...
llvm-svn: 108670
2010-07-19 01:55:38 +00:00
Zhongxing Xu
ec5623570e
Add double close check to StreamChecker. Patch by Lei Zhang.
...
llvm-svn: 108669
2010-07-19 01:52:29 +00:00
Zhongxing Xu
84f65e0692
Reapply r108617.
...
llvm-svn: 108668
2010-07-19 01:31:21 +00:00
Daniel Dunbar
e38764c66c
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!
llvm-svn: 108667
2010-07-19 00:44:04 +00:00
Daniel Dunbar
deaff5d792
Update for LLVM API change.
...
llvm-svn: 108665
2010-07-19 00:33:53 +00:00
Rafael Espindola
7661436220
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.
llvm-svn: 108660
2010-07-18 22:03:55 +00:00
Daniel Dunbar
b31b76f1eb
Driver: Fix a possible use after free.
...
llvm-svn: 108659
2010-07-18 21:16:15 +00:00
Chandler Carruth
3973af797a
Fix a goof in my previous patch -- not all of the builtins return a value, some
...
fixed return types.
llvm-svn: 108657
2010-07-18 20:54:12 +00:00
Eli Friedman
f8340deacd
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.
llvm-svn: 108656
2010-07-18 20:49:59 +00:00
Chris Lattner
e03a5745b1
daniel doesn't hate me, he hates macpython 2.5, which
...
is a very reasonable position on life!
llvm-svn: 108651
2010-07-18 18:42:35 +00:00
Peter Collingbourne
9e73cae25e
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.
llvm-svn: 108643
2010-07-18 16:45:46 +00:00
Douglas Gregor
3efffd05d5
Revert -Wdiscard-qual typo
...
llvm-svn: 108641
2010-07-18 11:27:38 +00:00
Chandler Carruth
bc8cab16c5
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.
llvm-svn: 108638
2010-07-18 07:23:17 +00:00
Chris Lattner
ad4f38b1a9
BUILD_ARCHIVE is the default for libraries, no need to set it.
...
llvm-svn: 108633
2010-07-18 00:14:47 +00:00
Eli Friedman
3ee1022f37
Fix crash initializing a bit-field with a non-constant in a place where we
...
try to evaluate the initializer as a constant.
llvm-svn: 108632
2010-07-17 23:55:01 +00:00
Eli Friedman
e98194d9e8
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.
llvm-svn: 108630
2010-07-17 20:43:49 +00:00
Fariborz Jahanian
aea8e1e3d2
Added PCH/ASTImporter code for ObjCIvarDecl's field.
...
llvm-svn: 108627
2010-07-17 18:35:47 +00:00
Chris Lattner
52c00bdd5b
Add another terrible VC++ compatibility hack: allow users to
...
allow invalid token pastes (when in -fms-extensions mode)
with -Wno-invalid-token-paste
llvm-svn: 108624
2010-07-17 16:24:30 +00:00
Chris Lattner
b2c4937ee4
rename test
...
llvm-svn: 108623
2010-07-17 16:18:46 +00:00
Chris Lattner
3e40dd34c4
rename test
...
llvm-svn: 108622
2010-07-17 16:17:41 +00:00
Benjamin Kramer
e2e031ed6f
Revert r108617, it broke the build.
...
llvm-svn: 108621
2010-07-17 13:51:58 +00:00
Zhongxing Xu
8de7966fd5
Fix cmake build.
...
llvm-svn: 108619
2010-07-17 11:59:16 +00:00
Zhongxing Xu
4ca4a999b1
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.
llvm-svn: 108617
2010-07-17 11:12:42 +00:00
Daniel Dunbar
05474285aa
clang -cc1as: Switch to using AsmParser constructor function.
...
llvm-svn: 108605
2010-07-17 02:26:21 +00:00
Ted Kremenek
b32964d02d
Fix '<rdar://problem/8202272> __imag passed non-complex should not crash' by removing a bogus assertion.
...
llvm-svn: 108602
2010-07-17 01:28:55 +00:00
Fariborz Jahanian
6a06144021
Another test case for on demand synthesis of ivars.
...
llvm-svn: 108600
2010-07-17 01:16:59 +00:00
Fariborz Jahanian
18722981e2
Patch to synthesize property ivars on demand as
...
part of the new property synthesis by default.
wip.
llvm-svn: 108599
2010-07-17 00:59:30 +00:00
John McCall
36ea3723c0
The GNU-runtime ObjC personality function doesn't let us rethrow with URR for
...
multiple reasons. Rethrow with _objc_exception_throw instead. Fixes PR7656.
llvm-svn: 108595
2010-07-17 00:43:08 +00:00
Ted Kremenek
8b9fd890e3
Fix APFloat assertion failure in IdempotentOperationChecker resulting in having
...
an APFloat with different "float semantics" than the compared float literal.
llvm-svn: 108590
2010-07-17 00:40:32 +00:00
Sebastian Redl
c2e6dbfa19
Teach the PCH reader to load the dependency when encountering a chain metadata record. WIP
...
llvm-svn: 108578
2010-07-17 00:12:06 +00:00
Anders Carlsson
bb4cfdff7e
When checking whether to bind an expression to a temporary, don't bind Obj-C message send expressions who call methods that return references.
...
llvm-svn: 108559
2010-07-16 21:18:37 +00:00
Craig Silverstein
e1c6749665
Fix typeid the same way I fixed sizeof. Sad I had missed it before.
...
Reviewed by chandlerc
llvm-svn: 108557
2010-07-16 21:15:34 +00:00
Ted Kremenek
0030be81f5
Remove unicode quotes characters that somehow made it into a recent commit of mine.
...
llvm-svn: 108552
2010-07-16 20:49:01 +00:00
Sebastian Redl
2abc0383ce
Separate out the initial loading of a PCH so that loading chained PCHs can reuse it.
...
llvm-svn: 108551
2010-07-16 20:41:52 +00:00
Tom Care
826e6b4023
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
llvm-svn: 108550
2010-07-16 20:41:41 +00:00
Nick Lewycky
725b4e7533
Give the 'self/array-comparison is always true/false' warning a new flag,
...
"-Wtautological-compare".
llvm-svn: 108546
2010-07-16 18:42:10 +00:00
Ted Kremenek
d7b31cc60d
Hook up warning for an incomplete scanlist in scanf format strings.
...
llvm-svn: 108542
2010-07-16 18:28:03 +00:00
Ted Kremenek
c618728e8d
Tweak zero-field width in scanf format string diagnostic.
...
llvm-svn: 108541
2010-07-16 18:27:56 +00:00
Sebastian Redl
34522813e7
First baby steps towards PCHReader being able to keep track of multiple PCH files. WIP
...
llvm-svn: 108537
2010-07-16 17:50:48 +00:00
Chandler Carruth
34833372d1
Make this destructor virtual to placate GCC's warnings.
...
llvm-svn: 108534
2010-07-16 17:27:32 +00:00
Craig Silverstein
16b7d86ef7
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.
llvm-svn: 108533
2010-07-16 17:06:12 +00:00
John McCall
934069464e
Initialize a couple of fields inherited for our private use.
...
llvm-svn: 108532
2010-07-16 17:02:45 +00:00
Douglas Gregor
fc6c3e73cd
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>.
llvm-svn: 108531
2010-07-16 16:54:17 +00:00
Sebastian Redl
1ea025bef9
Add a little more data to chained PCHs. WIP
...
llvm-svn: 108528
2010-07-16 16:36:56 +00:00
Douglas Gregor
3a8e0d7d57
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.
llvm-svn: 108527
2010-07-16 15:40:40 +00:00
Douglas Gregor
5692680e0e
Suppress the "typedef requires a name" warning in Microsoft-extensions mode
...
llvm-svn: 108526
2010-07-16 15:18:19 +00:00
John McCall
796c2a52a9
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.
llvm-svn: 108521
2010-07-16 08:13:16 +00:00
Chandler Carruth
eeb3c8419f
Make this grossness default to the error it should always be.
...
llvm-svn: 108511
2010-07-16 05:46:45 +00:00
Daniel Dunbar
84336ba3f8
Sema: Fix a bug with #pragma options align=reset, reset against an empty stack
...
is well defined, it resets to the default alignment.
llvm-svn: 108508
2010-07-16 04:54:16 +00:00
Chandler Carruth
9339605c35
Butcher a perfectly reasonable diagnostic to pacify old versions of SWIG.
...
llvm-svn: 108505
2010-07-16 04:32:28 +00:00
Ted Kremenek
5530131bb7
Add initial test cases for scanf format string checking.
...
llvm-svn: 108503
2010-07-16 02:11:34 +00:00
Ted Kremenek
a1ef09407d
Add the main scanf-parsing logic that I meant to include in my previous commit.
...
llvm-svn: 108502
2010-07-16 02:11:31 +00:00
Ted Kremenek
575e89dda1
Add missing header file.
...
llvm-svn: 108501
2010-07-16 02:11:26 +00:00
Ted Kremenek
0208793e41
Add most of the boilerplate support for scanf format string checking. This includes
...
handling the parsing of scanf format strings and hooking the checking into Sema.
Most of this checking logic piggybacks on what was already there for checking printf format
strings, but the checking logic has been refactored to support both.
What is left to be done is to support argument type checking in format strings and of course
fix the usual tail of bugs that will follow.
llvm-svn: 108500
2010-07-16 02:11:22 +00:00
Ted Kremenek
5932c35138
Add builtin definition for scanf, including extending the builtin encoding to
...
represent builtins that have the "scanf" attribution (via the format attribute) just
like we do with printf functions. Follow-up work is needed to add similar support
for fscanf et al.
This is to support format-string checking for scanf functions.
llvm-svn: 108499
2010-07-16 02:11:15 +00:00
Eli Friedman
eca55afea3
Fix for PR3800: make sure not to evaluate the expression for a read-write
...
asm operand twice.
llvm-svn: 108489
2010-07-16 00:55:21 +00:00
Daniel Dunbar
999daa57c7
Builtins/ARM: __clear_cache doesn't seem to have a consistent prototype, declare
...
the builtin as void __clear_cache(...) to workaround this, which appears to
match what GCC does.
llvm-svn: 108487
2010-07-16 00:31:23 +00:00
Daniel Dunbar
3348e2d175
IRgen: Support user defined attributes on block runtime functions.
...
- This issue here is that /usr/include/Blocks.h wants to define some of the
block runtime globals as weak, depending on the target. This doesn't work in
Clang because we aren't using the AST decl for these globals.
- The fix is a pretty gross hack which just watches all the decls for the
specific blocks globals we need to know about; if we see one we use it,
otherwise we use the hand coded type.
In time, I would like to clean this up by changing IRgen to ask Sema/AST for
the decl, which would then be lazily loaded from the builtin table if
necessary. This could be used in a whole host of places in IRgen and would
get rid of a lot of grotty hand coding of LLVM IR; however, we need some
extra Sema support for this as well as support for builtin global variables.
llvm-svn: 108482
2010-07-16 00:00:19 +00:00
Daniel Dunbar
900546d2e3
IRgen: Move blocks runtime interfaces to CodeGenModule.
...
llvm-svn: 108481
2010-07-16 00:00:15 +00:00
Daniel Dunbar
01ad0a78d0
Suppress !+Asserts warning.
...
llvm-svn: 108480
2010-07-16 00:00:11 +00:00
John McCall
70013b640f
When deferring the emission of declarations with initializers in C++, remember
...
the order they appeared in the translation unit. If they get emitted, put them
in their proper order. Fixes rdar://problem/7458115
llvm-svn: 108477
2010-07-15 23:40:35 +00:00
Devang Patel
8fd6499a97
Set "optimization is ON" and supply other optional parameters. This helps codegenerator preserve info in case the symbol is deleted.
...
llvm-svn: 108471
2010-07-15 23:09:46 +00:00
Douglas Gregor
c5dded5f99
Improve test case. Thanks Eli
...
llvm-svn: 108470
2010-07-15 23:04:05 +00:00
Douglas Gregor
8997690ff1
Don't suppress the emission of available_externally functions marked
...
with always_inline attribute. Thanks to Howard for the tip.
llvm-svn: 108469
2010-07-15 22:58:18 +00:00
Devang Patel
b3026df9fa
Mark implementation generated methods as artificial.
...
Tested by namespace.exp and virtfunc.exp from gdb testsuite.
llvm-svn: 108468
2010-07-15 22:57:00 +00:00
John McCall
ec624b2d19
After some discussion, the ABI list settled on a much more sensible mangling
...
for string literals.
llvm-svn: 108464
2010-07-15 21:53:03 +00:00
Douglas Gregor
dc9361876c
When we're performing tentative parsing to determine whether the
...
parser is looking at a declaration or an expression, use a '=' to
conclude that we are parsing a declaration.
This is wrong. However, our previous approach of finding a comma after
the '=' is also wrong, because the ',' could be part of a
template-argument-list. So, for now we're going to use the same wrong
heuristic as GCC and Visual C++, because less real-world code is
likely to be broken this way. I've opened PR7655 to keep track of our
wrongness; note also the XFAIL'd test.
Fixes <rdar://problem/8193163>.
llvm-svn: 108459
2010-07-15 21:05:01 +00:00
Daniel Dunbar
758f87cb97
build/Darwin: Add missing Info.plist template.
...
llvm-svn: 108457
2010-07-15 20:26:56 +00:00
Daniel Dunbar
20267fefa2
build/Darwin: Enable version information for clang executable.
...
llvm-svn: 108445
2010-07-15 19:33:44 +00:00
Douglas Gregor
cdb466e58f
Reinstate the scalar-cast-to-const-reference improvements, this time
...
with the proper spelling of "non-class prvalue". Silly me, I think
class rvalues were xvalues rather than prvalues!
Hah hah hah.
llvm-svn: 108443
2010-07-15 18:58:16 +00:00
Douglas Gregor
cb2b662283
Make the "unused result" warning a warning about run-time behavior, so
...
that we don't warn when there isn't going to be any computation anyway.
llvm-svn: 108442
2010-07-15 18:47:04 +00:00
Douglas Gregor
31e225cc90
Revert r108431 and r108433 (the cast-to-const-reference fixes), which
...
broke nightlytest.
llvm-svn: 108439
2010-07-15 18:41:54 +00:00
Douglas Gregor
d9d45838e0
Add test case for PR5290; this bug was fixed with the non-class rvalue
...
de-cv-qualification fixes.
llvm-svn: 108437
2010-07-15 18:35:15 +00:00
Devang Patel
99c372134d
Revert 108220 and subsequent patch.
...
This is not required (I am not 100% sure why) but method.exp from gdb testsuite flagged regression due to this patch.
llvm-svn: 108434
2010-07-15 18:16:09 +00:00
Douglas Gregor
6744cbda03
Spell isPRValue() properly.
...
llvm-svn: 108433
2010-07-15 18:12:28 +00:00
Douglas Gregor
1bae6a1be9
Teach CodeGenFunction::EmitCastLValue() to handle casts to an lvalue
...
that involve binding a reference to a pure rvalue temporary (e.g., not
a class temporary), by creating a new temporary and copying the result
there. Fixes PR6024.
llvm-svn: 108431
2010-07-15 18:04:13 +00:00
Douglas Gregor
cee039093a
CK_BitCast is not an lvalue bitcast any longer
...
llvm-svn: 108428
2010-07-15 16:39:55 +00:00
Daniel Dunbar
b2447154e0
Driver/Darwin: Resolve deployment target defaulting to be more predictable;
...
assume we are targetting OS X unless an explicit option is given.
llvm-svn: 108426
2010-07-15 16:18:06 +00:00
Daniel Dunbar
736406d0dc
Driver/Darwin: Allow -m{ios,macosx}-version-min= to be passed with -Xarch.
...
- This should be safe, because the driver itself shouldn't need to make
decisions that depend on the deployment target.
llvm-svn: 108425
2010-07-15 15:26:14 +00:00
Daniel Dunbar
1d14dd1dc6
CodeGen: Tweak ABI handling for Minix, patch by Kees van Reeuwijk!
...
llvm-svn: 108423
2010-07-15 15:02:28 +00:00
Chris Lattner
ceefcf0143
see comment.
...
llvm-svn: 108410
2010-07-15 05:22:46 +00:00
Daniel Dunbar
487a796d50
Driver: Support 'clang -x ir ...'.
...
llvm-svn: 108391
2010-07-15 00:49:21 +00:00
Chris Lattner
deee7a3c0b
restrict the && -> & warning to cover a case daniel noted.
...
Don't warn about "logically bool" expressions on the RHS,
even if they fold to a constant.
llvm-svn: 108388
2010-07-15 00:26:43 +00:00
Sebastian Redl
85b2a6a430
Add a callback interface that allows interested parties to get notified whenever PCHReader deserializes a type or decl (and possibly other things in the future). Have PCHWriter implement these callbacks as noops and register to receive them if we're chaining PCHs. This will allow PCHWriter to track the IDs of these things, which it needs to write the dependent files. WIP
...
llvm-svn: 108383
2010-07-14 23:45:08 +00:00
Daniel Dunbar
6f2e839693
CodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosing
...
whether to use objc_msgSend_fpret; the choice is target dependent, not Obj-C ABI
dependent.
- <rdar://problem/8139758> arm objc _objc_msgSend_fpret bug
llvm-svn: 108379
2010-07-14 23:39:36 +00:00
Sebastian Redl
8b41f30064
There is another implementation of PCHReaderListener around. Update it to the new interface.
...
llvm-svn: 108377
2010-07-14 23:29:55 +00:00
Douglas Gregor
eebe72199e
When determining whether an overload set with explicit template
...
arguments only resolves to a single specialization, make sure to look
through using declarations. Fixes PR7641.
llvm-svn: 108376
2010-07-14 23:20:53 +00:00
Benjamin Kramer
8d5609b604
Pass StringRefs by value.
...
llvm-svn: 108375
2010-07-14 23:19:41 +00:00
Douglas Gregor
5f0e252f63
When there are extra or missing template parameter lists in a template
...
definition, we're likely going to end up breaking the invariants of
the template system, e.g., that the depths of template parameter lists
match up with the nesting template of the template. So, make sure we
mark such ill-formed declarations as invalid or don't even build them
at all.
llvm-svn: 108372
2010-07-14 23:14:12 +00:00
Douglas Gregor
c357f4121e
Add lvalue-bitcast support for complex numbers.
...
llvm-svn: 108363
2010-07-14 21:35:45 +00:00
Sebastian Redl
409183ff7c
Increase the max PCH level for declarations to 7. Add a FromPCH flag to types.
...
llvm-svn: 108354
2010-07-14 20:26:45 +00:00
Daniel Dunbar
9765b9817d
Driver: When re'execing clang, use path to the main executable instead of
...
looking up Clang in the normal search paths (which may end up finding the wrong
clang).
llvm-svn: 108346
2010-07-14 18:46:27 +00:00
Daniel Dunbar
9c3ed5f4d0
Driver: Remove some unused arguments.
...
llvm-svn: 108345
2010-07-14 18:46:23 +00:00
Fariborz Jahanian
56a9d54de8
Don't error when doing default property synthesis
...
and some are already synthesized by user declaration.
llvm-svn: 108341
2010-07-14 18:11:52 +00:00
Sebastian Redl
75fbb3b5e5
Make PCHReader cope with PCH files containing more than one predefines buffer.
...
llvm-svn: 108340
2010-07-14 17:49:11 +00:00
Douglas Gregor
9f1570d993
Only filter out names reserved for the implementation (e.g., __blah or
...
_Foo) from code-completion results when they come from a system
header.
llvm-svn: 108338
2010-07-14 17:44:04 +00:00
Fariborz Jahanian
c0b0ced477
Consider obective-c pointer arguments as valid sentinel args
...
as well. Fixes radar 7975788.
llvm-svn: 108333
2010-07-14 16:37:51 +00:00
John McCall
4f3b5f302c
Fix the mangling of template template arguments, which do not always
...
follow <name>; instead they follow <type>, which has <name> as a subset.
Fixes PR7446.
llvm-svn: 108326
2010-07-14 06:43:17 +00:00
Chandler Carruth
cb3b5a483f
Wire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.
...
This flag and warning match GCC semantics. Also, move it to -Wextra as this is
a largely cosmetic issue and doesn't seem to mask problems. Subsequent fixes to
the tests which no longer by default emit the warning. Added explicit test
cases for both C and C++ behavior with the warning turned on.
llvm-svn: 108325
2010-07-14 06:36:18 +00:00
Douglas Gregor
261793bb73
Add test case that was causing an infinite loop when reading PCH files. The test works with ToT Clang already
...
llvm-svn: 108318
2010-07-14 04:45:33 +00:00
John McCall
afe20780ee
Remove a few mangling FIXMEs:
...
- TSTs whose template is a template template parameter already work
- we don't provide an imaginary type, so we can't mangle one
- we don't need a generic FIXME for vendor type qualifiers
llvm-svn: 108317
2010-07-14 04:38:21 +00:00
John McCall
05ddbb80d2
Implement the standard mangling for array-subscript expressions, and implement
...
the current proposals from David Vandervoorde for new, delete, throw, typeid,
imaginary literals, string literals, and null literals.
llvm-svn: 108315
2010-07-14 04:20:34 +00:00