Ted Kremenek
40cd13ecff
Fix potential use of uninitialized variable.
...
llvm-svn: 65109
2009-02-20 04:34:29 +00:00
Dan Gohman
2a12ae7d1f
Implement "superhero" strength reduction, or full strength
...
reduction of address calculations down to basic pointer arithmetic.
This is currently off by default, as it needs a few other features
before it becomes generally useful. And even when enabled, full
strength reduction is only performed when it doesn't increase
register pressure, and when several other conditions are true.
This also factors out a bunch of exisiting LSR code out of
StrengthReduceStridedIVUsers into separate functions, and tidies
up IV insertion. This actually decreases register pressure even
in non-superhero mode. The change in iv-users-in-other-loops.ll
is an example of this; there are two more adds because there are
two fewer leas, and there is less spilling.
llvm-svn: 65108
2009-02-20 04:17:46 +00:00
Eli Friedman
cf7cbe7441
A few small tweaks to isConstantInitializer. (No test because this
...
isn't getting used by Sema or CodeGen at the moment...)
llvm-svn: 65107
2009-02-20 02:36:22 +00:00
Eli Friedman
7157825d44
Use -verify for consistency.
...
llvm-svn: 65106
2009-02-20 02:03:47 +00:00
Eli Friedman
0b8337c30b
Add support for * (unary dereference) operator to ExprConstant.
...
llvm-svn: 65105
2009-02-20 01:57:15 +00:00
Daniel Dunbar
63e03cbe8c
ccc: Use toolChain arch name instead of looking for arch command line
...
argument; the toolchain should always know the arch.
- Fixes: <rdar://problem/6582911> -ccc-clang-archs doesn't work for excluding ppc
llvm-svn: 65104
2009-02-20 01:48:01 +00:00
Chris Lattner
caae716837
optimize the 'StoredDeclsMap' for the common case where there is
...
exactly one decl with a specific name in a specific context. This
avoids a bunch of malloc traffic and shrinks StoredDeclsMap to hold
one pointer instead of 3 words (for a std::vector).
This speeds up -fsyntax-only on cocoa.h with PTH by ~7.3%.
llvm-svn: 65103
2009-02-20 01:44:05 +00:00
Daniel Dunbar
1b84824f83
ccc: Store arch name in all toolchains.
...
- No functionality change.
llvm-svn: 65102
2009-02-20 01:36:35 +00:00
Eli Friedman
ce98257691
Suppress constant initializer checking when the declaration isn't valid.
...
This prevents emitting diagnostics which are almost certainly useless.
(Note that the test is checking that we emit only one diagnostic.)
llvm-svn: 65101
2009-02-20 01:34:21 +00:00
Daniel Dunbar
92cfae68e9
ccc: Give all tools access to the toolchain they are in.
...
- No functionality change.
llvm-svn: 65100
2009-02-20 01:30:38 +00:00
Eli Friedman
719ed1a9ab
Initialize the Init variable to something reasonable when we emit an
...
error, so we don't crash.
llvm-svn: 65099
2009-02-20 01:18:21 +00:00
Eli Friedman
742421e2e7
ExprConstant handling for a couple more cases of pointer-to-int casts
...
from the testsuite.
llvm-svn: 65098
2009-02-20 01:15:07 +00:00
Fariborz Jahanian
c86fb5ecb4
More objc gc's ir-gen fixes.
...
llvm-svn: 65097
2009-02-20 01:14:43 +00:00
Chris Lattner
29578f3f41
make the redeclaration case faster for the common instance of a redeclaration
...
where there is exactly one existing declaration. This is common.
this speeds up clang about 3% on cocoa.h for me 0.165 -> 0.160s
llvm-svn: 65096
2009-02-20 01:10:07 +00:00
Chris Lattner
33f219d1a9
80 cols
...
llvm-svn: 65095
2009-02-20 00:56:18 +00:00
Chris Lattner
24e24d51a1
slight code simplifications.
...
llvm-svn: 65094
2009-02-20 00:55:03 +00:00
Mike Stump
2a9baebae1
Deox and Capitolize.
...
llvm-svn: 65093
2009-02-20 00:45:51 +00:00
Bill Wendling
0a0987d198
Add an accessor method to DwarfWriter to tell of debugging info should be emitted.
...
llvm-svn: 65092
2009-02-20 00:44:43 +00:00
Bill Wendling
fc1042f9bb
Add a default debug location object to the Machine Function. It's used to emit a default debugging label at the beginning of a function.
...
llvm-svn: 65091
2009-02-20 00:42:52 +00:00
Chris Lattner
464ceb4ec8
map source ranges through macro expansions. Before:
...
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
MAX(P, F);
^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
^
(no ranges on the second diagnostics)
After:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
MAX(P, F);
^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
~~~ ^ ~~~
(ranges!)
llvm-svn: 65090
2009-02-20 00:25:28 +00:00
Mike Stump
f5a5c4fa11
Fix spacing.
...
llvm-svn: 65089
2009-02-20 00:19:45 +00:00
Chris Lattner
1973d84625
refactor, pass ranges down instead of the whole
...
DiagnosticInfo.
llvm-svn: 65088
2009-02-20 00:18:51 +00:00
Ted Kremenek
a26ad40e41
Add test case for <rdar://problem/6562655>.
...
llvm-svn: 65085
2009-02-20 00:10:09 +00:00
Ted Kremenek
c537a6d3f1
Fix crash from <rdar://problem/6562655>: 'init' method only return a receiver alias if the return type is a location.
...
llvm-svn: 65084
2009-02-20 00:05:35 +00:00
Chris Lattner
cf868c458c
replace a dirty hack with a clean solution. Too bad we can't
...
use Blocks for our callbacks ;-)
llvm-svn: 65083
2009-02-19 23:53:20 +00:00
Ted Kremenek
68abaa984d
retain/release checker: Generate an intermediate simulation node for "leak"
...
transitions and then generate a subsequent node that removes the dead symbol
bindings. This should drastically improve caching in the simulation graph when
retain-counted objects are being tracked.
llvm-svn: 65082
2009-02-19 23:47:02 +00:00
Chris Lattner
810d330cd3
Fix a long standard problem with clang retaining "too much" sugar
...
information about types. We often print diagnostics where we say
"foo_t" is bad, but the user doesn't know how foo_t is declared
(because it is a typedef). Fix this by expanding sugar when present
in a diagnostic (and not one of a few special cases, like vectors).
Before:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' and 'typeof(F)')
MAX(P, F);
^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
^
After:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
MAX(P, F);
^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
^
llvm-svn: 65081
2009-02-19 23:45:49 +00:00
Ted Kremenek
513f0b147e
Added a new method to GRStmtNodeBuilder to build nodes using an arbitrary
...
PostStmt program point. This allows clients to pass in PostStmtCustom program
points.
llvm-svn: 65080
2009-02-19 23:45:28 +00:00
Ted Kremenek
406d2c17f5
ProgramPoint::Profile now specially handles PostStmtCustom (hashes on tag and data) so that clients don't need a unique address for the pair itself.
...
llvm-svn: 65079
2009-02-19 23:43:16 +00:00
Chris Lattner
a8bac26e2c
pretty printing vector types should print the element type, not just the attribute.
...
llvm-svn: 65078
2009-02-19 23:42:29 +00:00
Fariborz Jahanian
0f466c746f
More objc's gc ir-gen stuff.
...
llvm-svn: 65077
2009-02-19 23:36:06 +00:00
Chris Lattner
ae0197e134
GetTypeForDeclarator can return null on error now, handle this.
...
llvm-svn: 65076
2009-02-19 23:13:55 +00:00
Daniel Dunbar
2a07da78c0
ccc: Give nicer error when spawning a subprocess fails.
...
llvm-svn: 65075
2009-02-19 22:59:57 +00:00
Daniel Dunbar
1c8560d93e
Extend Evaluate() to fold (int) <pointer type>.
...
- PR3463, PR3398, <rdar://problem/6553401> crash on relocatable
symbol addresses as constants in static locals.
- There are many more scenarious we could handle (like arithmetic on
such an int) but this is the main use case.
llvm-svn: 65074
2009-02-19 22:24:01 +00:00
Daniel Dunbar
cf04aa1a02
Simplify, no functionality change.
...
llvm-svn: 65073
2009-02-19 22:16:29 +00:00
Ted Kremenek
e76eb060c7
Fix another PTH warning that should not be a note.
...
llvm-svn: 65072
2009-02-19 22:14:49 +00:00
Ted Kremenek
36b005db45
Make PTH warnings actual warnings instead of 'notes'.
...
llvm-svn: 65071
2009-02-19 22:13:40 +00:00
Mike Stump
a67033294a
Add enough checking to ensure that non-constant block literals don't
...
appear to be constant. I'll probably redo this and throw it all away
later once we have codegen for BlockDeclRefExprs.
llvm-svn: 65070
2009-02-19 22:01:56 +00:00
Daniel Dunbar
a118a07157
ccc: Also look for .gch files when seeing if we should auto load a
...
token-cache for clang.
llvm-svn: 65069
2009-02-19 22:01:23 +00:00
Bill Wendling
7b9f38ad37
Temporarily revert r65065. It was causing test failures.
...
llvm-svn: 65068
2009-02-19 21:57:07 +00:00
Bill Wendling
1a0a3d0ff5
Print out debug info when printing the machine instruction.
...
llvm-svn: 65067
2009-02-19 21:44:55 +00:00
Daniel Dunbar
18e1444f82
Remove IRgen constant emission assumption that LValue APValue results
...
only occur for pointer types; they are also possible for integer types
now.
- No intended functionality change, IntExprEvaluate doesn't return
LValue results yet.
llvm-svn: 65066
2009-02-19 21:44:24 +00:00
Bill Wendling
df78dcc0b2
Check for -fast here too.
...
llvm-svn: 65065
2009-02-19 21:23:54 +00:00
Bill Wendling
19e0a5b3c3
Generate these labels when we're in "fast" mode, not simply when we're no in
...
"optimize-for-size" mode.
llvm-svn: 65064
2009-02-19 21:12:54 +00:00
Daniel Dunbar
ca097adca8
Change IntExprEvaluator to operate on an APValue not an APSInt.
...
- Prep for handling lvalues, no intended functionality change.
llvm-svn: 65063
2009-02-19 20:17:33 +00:00
Dale Johannesen
f6a71b39b7
Describe tail merging's use of InsertBranch.
...
llvm-svn: 65062
2009-02-19 19:40:21 +00:00
Dan Gohman
a34d7adefb
Use DEBUG() instead of passing *DOUT to WriteAsOperand,
...
since the latter just passes a null reference when
debugging is not enabled.
llvm-svn: 65060
2009-02-19 19:32:06 +00:00
Daniel Dunbar
96f8677e11
Arguments to unordered comparison builtins may need implicit casts.
...
- <rdar://problem/6094103> sema fails to promote type arguments to __builtin_isgreater (and friends)
llvm-svn: 65059
2009-02-19 19:28:43 +00:00
Dan Gohman
30a2959367
Make the debug output of LSR less cryptic and more informative.
...
llvm-svn: 65057
2009-02-19 19:23:27 +00:00
Anders Carlsson
f96954ca30
Add irgen support for the noinline attribute.
...
llvm-svn: 65056
2009-02-19 19:22:11 +00:00