Torok Edwin
12b8a63e13
Comparing std::string with NULL is a bad idea, so just check whether its empty.
...
This code was crashing always with oprofile enabled, since it tried to create a StringRef
out of NULL, which run strlen on NULL.
llvm-svn: 91046
2009-12-10 10:01:47 +00:00
John McCall
84d8767c15
Implement redeclaration checking and hiding semantics for using declarations. There
...
are a couple of O(n^2) operations in this, some analogous to the usual O(n^2)
redeclaration problem and some not. In particular, retroactively removing
shadow declarations when they're hidden by later decls is pretty unfortunate.
I'm not yet convinced it's worse than the alternative, though.
llvm-svn: 91045
2009-12-10 09:41:52 +00:00
Eli Friedman
e919e382a4
Fix for PR5515: allow "merging" array bounds both forwards and backwards.
...
llvm-svn: 91044
2009-12-10 08:54:47 +00:00
Eli Friedman
d011893e86
Test for r90950.
...
llvm-svn: 91043
2009-12-10 08:51:23 +00:00
Anders Carlsson
bf56946073
Mangle static variables inside Objective-C methods in Objective-C++. We currently mangle them the same way as gcc does.
...
llvm-svn: 91042
2009-12-10 03:14:39 +00:00
Eli Friedman
d5bc94e2eb
Get rid of static variable.
...
llvm-svn: 91041
2009-12-10 02:21:21 +00:00
Chris Lattner
3c674cf804
If we enter parens, colons can become un-sacred, allowing us to emit
...
a better diagnostic in the second example.
llvm-svn: 91040
2009-12-10 02:08:07 +00:00
Chris Lattner
244b96ba0a
fix a more evil case of : / :: confusion arising in ?:.
...
llvm-svn: 91039
2009-12-10 02:02:58 +00:00
Chris Lattner
17c3b1f278
fix incorrect parsing of bitfields pointed out by Doug. I chose
...
to use ColonProtectionRAIIObject in the C codepath even though it
won't matter for consistency.
llvm-svn: 91037
2009-12-10 01:59:24 +00:00
Anders Carlsson
fefc7b8e7b
Actually store the pointer into the global variable, spotted by Eli.
...
llvm-svn: 91036
2009-12-10 01:58:33 +00:00
Mike Stump
3c6a12ca65
Setup cleanup on eh edge out of the construction of the cleanup object
...
during throw to deallocate the exception object. WIP.
llvm-svn: 91035
2009-12-10 01:52:30 +00:00
Chris Lattner
399df12fb1
minimal fix for PR5743
...
llvm-svn: 91032
2009-12-10 01:38:15 +00:00
Anders Carlsson
a72ddd4609
Handle emitting static variables that have reference type.
...
llvm-svn: 91027
2009-12-10 01:05:11 +00:00
Anders Carlsson
364051c6a6
Separate generating code for static variables and global variables.
...
llvm-svn: 91026
2009-12-10 00:57:45 +00:00
Anders Carlsson
3c951d1ae0
Fix tabs.
...
llvm-svn: 91025
2009-12-10 00:57:18 +00:00
Chris Lattner
b2434d558d
Second half of r91023, saving files is good.
...
llvm-svn: 91024
2009-12-10 00:45:15 +00:00
Chris Lattner
5701386620
move GreaterThanIsOperatorScope into RAIIObjectsForParser. Add some more
...
TODOs for other classes that could be moved out of Parser.h. I don't plan
to do these in the near term though.
llvm-svn: 91023
2009-12-10 00:44:03 +00:00
Chris Lattner
125c0ee5c7
fix PR5740: a colon is sacred when parsing case statement expressions!
...
llvm-svn: 91016
2009-12-10 00:38:54 +00:00
Chris Lattner
793c75a28f
rename testcase
...
llvm-svn: 91015
2009-12-10 00:37:13 +00:00
Chris Lattner
d5c1c9d0ae
refactor the 'ColonIsSacred' argument to ParseOptionalCXXScopeSpecifier
...
to be a bool in Parser that is twiddled by the ColonProtectionRAIIObject
class. No functionality change.
llvm-svn: 91014
2009-12-10 00:32:41 +00:00
Anders Carlsson
633c6f6f36
Move more decl related functions to CGDeclCXX.cpp
...
llvm-svn: 91012
2009-12-10 00:30:05 +00:00
Eric Christopher
22889c049d
Make sure the immediate dominator isn't NULL through iterations
...
of the loop. We could get to this condition via indirect
branches.
llvm-svn: 91009
2009-12-10 00:25:41 +00:00
Chris Lattner
8a9a97a660
rename ExtensionRAIIObject.h -> RAIIObjectsForParser.h
...
llvm-svn: 91008
2009-12-10 00:21:05 +00:00
Anders Carlsson
bc49cfed84
Add CGDeclCXX.cpp and move EmitCXXGlobalVarDeclInit there.
...
llvm-svn: 91006
2009-12-10 00:16:00 +00:00
Chris Lattner
9ccc879006
Fix PR5744, a case where we were getting the pointer size instead of the
...
value size. This only manifested when memdep inprecisely returns clobber,
which is do to a caching issue in the PR5744 testcase. We can 'efficiently
emulate' this by using '-no-aa'
llvm-svn: 91004
2009-12-10 00:11:45 +00:00
Jim Grosbach
53e8854443
Add memory barrier intrinsic support for ARM. Moving towards adding the atomic operations intrinsics.
...
llvm-svn: 91003
2009-12-10 00:11:09 +00:00
Nuno Lopes
221c1fd63e
spread 'const' love to some variables. this considerably reduces the amount of dirty data around.
...
llvm-svn: 91002
2009-12-10 00:07:02 +00:00
Mike Stump
75546b8c88
Fixup spacing.
...
llvm-svn: 91001
2009-12-10 00:06:18 +00:00
Mike Stump
2600491817
Fix spacing.
...
llvm-svn: 91000
2009-12-10 00:05:14 +00:00
Chris Lattner
3ddf804f78
allow this to build when the #if 0's are enabled. No functionality change.
...
llvm-svn: 90999
2009-12-10 00:04:46 +00:00
Mike Stump
f5cbb08c4b
Ensure we only generate one terminate handler.
...
llvm-svn: 90998
2009-12-10 00:02:42 +00:00
Mike Stump
3b60f034f9
Remove obsolete FIXME and some dead fallback code.
...
llvm-svn: 90997
2009-12-09 23:52:09 +00:00
Mike Stump
102530719f
Add terminate handler to cleanups on exceptional edges.
...
llvm-svn: 90996
2009-12-09 23:49:53 +00:00
Fariborz Jahanian
531c16f9fb
Code gen for ObjCIsaExpr AST used as lvalue.
...
(fixes radar 7457534).
llvm-svn: 90995
2009-12-09 23:35:29 +00:00
Mike Stump
25b20fc2ae
Add terminate handler for copy constructors for thrown objects. WIP.
...
llvm-svn: 90994
2009-12-09 23:31:35 +00:00
Ted Kremenek
8573913760
Fix null dereference in OSAtomicChecker and special case SymbolicRegions. We still aren't handling them correctly; I've added to failing test cases to test/Analysis/NSString-failed-cases.m that should pass and then be merged in to test/Analysis/NSString.m.
...
llvm-svn: 90993
2009-12-09 23:29:55 +00:00
Douglas Gregor
3e1e527826
Reimplement reference initialization (C++ [dcl.init.ref]) using the
...
new notion of an "initialization sequence", which encapsulates the
computation of the initialization sequence along with diagnostic
information and the capability to turn the computed sequence into an
expression. At present, I've only switched one CheckReferenceInit
callers over to this new mechanism; more will follow.
Aside from (hopefully) being much more true to the standard, the
diagnostics provided by this reference-initialization code are a bit
better than before. Some examples:
p5-var.cpp:54:12: error: non-const lvalue reference to type 'struct
Derived'
cannot bind to a value of unrelated type 'struct Base'
Derived &dr2 = b; // expected-error{{non-const lvalue reference to
...
^ ~
p5-var.cpp:55:9: error: binding of reference to type 'struct Base' to
a value of
type 'struct Base const' drops qualifiers
Base &br3 = bc; // expected-error{{drops qualifiers}}
^ ~~
p5-var.cpp:57:15: error: ambiguous conversion from derived class
'struct Diamond' to base class 'struct Base':
struct Diamond -> struct Derived -> struct Base
struct Diamond -> struct Derived2 -> struct Base
Base &br5 = diamond; // expected-error{{ambiguous conversion from
...
^~~~~~~
p5-var.cpp:59:9: error: non-const lvalue reference to type 'long'
cannot bind to
a value of unrelated type 'int'
long &lr = i; // expected-error{{non-const lvalue reference to type
...
^ ~
p5-var.cpp:74:9: error: non-const lvalue reference to type 'struct
Base' cannot
bind to a temporary of type 'struct Base'
Base &br1 = Base(); // expected-error{{non-const lvalue reference to
...
^ ~~~~~~
p5-var.cpp:102:9: error: non-const reference cannot bind to bit-field
'i'
int & ir1 = (ib.i); // expected-error{{non-const reference cannot
...
^ ~~~~~~
p5-var.cpp:98:7: note: bit-field is declared here
int i : 17; // expected-note{{bit-field is declared here}}
^
llvm-svn: 90992
2009-12-09 23:02:17 +00:00
Mike Stump
2b488873bf
Break out code for reuse. WIP.
...
llvm-svn: 90991
2009-12-09 22:59:31 +00:00
Dan Gohman
72c367fb52
Dereference loopHeader after checking for null rather than before.
...
llvm-svn: 90990
2009-12-09 22:55:01 +00:00
Evan Cheng
2262909b20
Fix test.
...
llvm-svn: 90988
2009-12-09 22:24:42 +00:00
Fariborz Jahanian
26de2e594b
Fixes a bogus error when declaring an extern "C" array.
...
(fixes radar 7457109).
llvm-svn: 90986
2009-12-09 21:39:38 +00:00
Evan Cheng
493b882f80
Optimize splat of a scalar load into a shuffle of a vector load when it's legal. e.g.
...
vector_shuffle (scalar_to_vector (i32 load (ptr + 4))), undef, <0, 0, 0, 0>
=>
vector_shuffle (v4i32 load ptr), undef, <1, 1, 1, 1>
iff ptr is 16-byte aligned (or can be made into 16-byte aligned).
llvm-svn: 90984
2009-12-09 21:00:30 +00:00
Mike Stump
f16b8c30d9
Add throw support. WIP.
...
llvm-svn: 90982
2009-12-09 19:24:08 +00:00
Fariborz Jahanian
a5fee26d28
Codegen. support for ObjCIsaExpr AST which until now
...
was not needed (fixes radar 7453430).
llvm-svn: 90981
2009-12-09 19:05:56 +00:00
Dan Gohman
220b196c94
Reuse the Threshold value to size these containers because it's
...
currently somewhat convenient for them to have the same value.
llvm-svn: 90980
2009-12-09 18:48:53 +00:00
Devang Patel
9ccfb641d1
Reapply r90858, a cleanup patch.
...
llvm-svn: 90979
2009-12-09 18:24:21 +00:00
Chris Lattner
ca5f9cb18b
fix hte last remaining known (by me) phi translation bug. When we reanalyze
...
clobbers to forward pieces of large stores to small loads, we need to consider
the properly phi translated pointer in the store block.
llvm-svn: 90978
2009-12-09 18:21:46 +00:00
Chris Lattner
f8ba1253f1
change GetStoreValueForLoad to use IRBuilder, which is cleaner and
...
implicitly constant folds.
llvm-svn: 90977
2009-12-09 18:13:28 +00:00
Mike Stump
d0caa82b36
Fix 80-col violation.
...
llvm-svn: 90976
2009-12-09 18:09:35 +00:00
Bob Wilson
1c5a6fb299
Fix a comment.
...
llvm-svn: 90975
2009-12-09 18:05:27 +00:00