Steve Naroff
4292bde14f
Fix the following bug submitted by Justin Handville.
...
int main(int argc, char* argv[])
{
return 0;
}
After speaking briefly with Chris, we decided this should be a front-end fix.
The fix...have Sema::GetTypeForDeclarator() do the default function/array conversion, as
I outlined in the 9/9 email on this topic.
Since this conversion is done before Sema::ParseParamDeclarator(), I thought I could
remove the conversion from Sema::ParseParamDeclarator(). Unfortunately, this didn't work.
The conversion apparently needs to be done in both places (which doesn't make sense to me).
Will investigate.
llvm-svn: 41811
2007-09-10 22:17:00 +00:00
Evan Cheng
8c3c198499
New entry.
...
llvm-svn: 41810
2007-09-10 22:16:37 +00:00
Evan Cheng
3b9f777f47
Observation of rematerialization.
...
llvm-svn: 41809
2007-09-10 22:11:18 +00:00
Chris Lattner
6777b72659
Add some notes about better flag handling.
...
llvm-svn: 41808
2007-09-10 21:43:18 +00:00
Chris Lattner
58c227bd09
Emit:
...
cmpl %eax, %ecx
setae %al
movzbl %al, %eax
instead of:
cmpl %eax, %ecx
setb %al
xorb $1, %al
movzbl %al, %eax
when using logical not of a C comparison.
llvm-svn: 41807
2007-09-10 21:39:07 +00:00
Chris Lattner
7a9935c31f
this is not infinite recursion.
...
llvm-svn: 41806
2007-09-10 21:16:23 +00:00
Chris Lattner
33a7f51412
1. Don't call Value::getName(), which is slow.
...
2. Lower calls to fabs and friends to FABS nodes etc unless the function has
internal linkage. Before we wouldn't lower if it had a definition, which
is incorrect. This allows us to compile:
define double @fabs(double %f) {
%tmp2 = tail call double @fabs( double %f )
ret double %tmp2
}
into:
_fabs:
fabs f1, f1
blr
llvm-svn: 41805
2007-09-10 21:15:22 +00:00
Chris Lattner
c75cbe6473
Prevent tailcallelim from breaking "recursive" calls to builtins.
...
llvm-svn: 41804
2007-09-10 20:58:55 +00:00
Steve Naroff
acb1e7478f
Some small tweaks to the recent Objc support...
...
llvm-svn: 41803
2007-09-10 20:51:04 +00:00
Evan Cheng
637395e6bd
It's not safe to rematerialize MOV32r0 etc. by simply cloning the original
...
instruction. These are implemented with xor which will modify the conditional
code. They should be rematerialized as move instructions.
llvm-svn: 41802
2007-09-10 20:48:53 +00:00
Fariborz Jahanian
33d037441e
Early patch to collect objective-c methods inserts them in
...
class object.
llvm-svn: 41801
2007-09-10 20:33:04 +00:00
Devang Patel
f8ab0a9acc
Filter exit conditions which are not yet handled.
...
llvm-svn: 41800
2007-09-10 18:33:42 +00:00
Devang Patel
c24099ac82
New test.
...
llvm-svn: 41799
2007-09-10 18:12:52 +00:00
Devang Patel
d7409fdce5
Require SCEV before LCSSA.
...
llvm-svn: 41798
2007-09-10 18:08:23 +00:00
Ted Kremenek
bd9cc5ca89
Fixed LiveVariables to no longer track the liveness of function pointers
...
that refer to direct function calls.
Modified interface of LiveVariables to only track liveness of VarDecls.
This cleans up a bunch of edge cases, and removed the bug just mentioned.
llvm-svn: 41797
2007-09-10 17:36:42 +00:00
Ted Kremenek
5f64ca8ec5
Modified dumping of Decl information to including the Decl type.
...
llvm-svn: 41796
2007-09-10 17:32:55 +00:00
Ted Kremenek
0319fc07fc
Added "isFunctionPointerType()" so that we can readily see if a DeclRefExpr
...
refers to a function.
llvm-svn: 41795
2007-09-10 17:20:54 +00:00
Ted Kremenek
cfe207c112
Renaming of the LiveVariablesAuditor interface. Changed "Auditor" and
...
"Audit" to "Observer" and "Observe"
llvm-svn: 41794
2007-09-10 15:56:38 +00:00
Owen Anderson
82e4fa1020
Remove an un-needed dependence query. This improves compile time marginally on 401.bzip2.
...
llvm-svn: 41792
2007-09-09 21:43:49 +00:00
Daniel Berlin
e80ca9c2c6
Add SparseBitVector implementation
...
llvm-svn: 41790
2007-09-09 01:10:40 +00:00
Owen Anderson
4266bb73e8
Turn GVN on by default.
...
llvm-svn: 41787
2007-09-08 22:23:52 +00:00
Dale Johannesen
29e6ac4281
Implement misaligned FP loads and stores.
...
llvm-svn: 41786
2007-09-08 19:29:23 +00:00
Nick Lewycky
a9b13d5cc1
Fix description of the call instruction. There are two types, with one being
...
optional.
llvm-svn: 41785
2007-09-08 13:57:50 +00:00
Chuck Rose III
bf19e0a556
Fix for VisualStudio. It is treating a 2 bit enum as a signed int for comparison purposes, causing failures. Using an extra bit fixes it.
...
llvm-svn: 41784
2007-09-08 04:17:08 +00:00
Chris Lattner
f8a3dadd40
Don't rely on ADL to find this member, patch by Justin Handville
...
llvm-svn: 41783
2007-09-08 01:29:20 +00:00
Evan Cheng
ee8d9a0e81
Smarter Reset(). Instead of deallocating all memory regions and reallocate the
...
first region, just deallocate all but the last region in the list.
llvm-svn: 41782
2007-09-08 00:02:17 +00:00
Evan Cheng
cef2c0efcc
TableGen no longer emit CopyFromReg nodes for implicit results in physical
...
registers. The scheduler is now responsible for emitting them.
llvm-svn: 41781
2007-09-07 23:59:02 +00:00
Ted Kremenek
35fff1e656
-check-dead-stores now no longer prints out the function declarations
...
for each function. This was the behavior prior to the following patch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=41779
llvm-svn: 41780
2007-09-07 23:54:15 +00:00
Ted Kremenek
45c9e96c2b
Refactored driver options that perform analyses/work over CFGs to use
...
"CFGVisitor", which now handles all the boilerplate for iterating over
the function definitions in a translation unit and building the CFGs.
This logic was previously replicated for each driver option that used
CFGs.
The options -dump-cfg, -view-cfg, -check-dead-stores, and
-dump-live-variables now use this refactored code.
llvm-svn: 41779
2007-09-07 23:47:56 +00:00
Bill Wendling
9929bc403d
Add missing index versions of instructions to the map.
...
llvm-svn: 41776
2007-09-07 22:01:02 +00:00
Dan Gohman
a95cbb0007
Avoid storing and reloading zeros and other constants from stack slots
...
by flagging the associated instructions as being trivially rematerializable.
llvm-svn: 41775
2007-09-07 21:32:51 +00:00
Dale Johannesen
9e70086c8f
Apply feedback from previous patch.
...
llvm-svn: 41774
2007-09-07 21:07:57 +00:00
Dale Johannesen
b6d795c1fc
Revert previous change to IR.
...
llvm-svn: 41769
2007-09-07 18:31:50 +00:00
Rafael Espindola
1de0c86717
Add support for having different alignment for objects on call frames.
...
The x86-64 ABI states that objects passed on the stack have
8 byte alignment. Implement that.
llvm-svn: 41768
2007-09-07 14:52:14 +00:00
Hartmut Kaiser
ec7531c9f6
Fixed compilation on Windows.
...
Silenced a couple of warnings.
Added *.vcproj file for new clangAnalysis library.
Renamed Basic to clangBasic projects.
llvm-svn: 41767
2007-09-07 14:34:20 +00:00
Anton Korobeynikov
122bf4be7e
Split eh.select / eh.typeid.for intrinsics into i32/i64 versions. This is needed, because they just "mark" register
...
liveins and we let frontend solve type issue, not lowering code :)
llvm-svn: 41763
2007-09-07 11:39:35 +00:00
Bill Wendling
5f912b9149
Test for PR1641.
...
llvm-svn: 41762
2007-09-07 08:30:09 +00:00
Chris Lattner
85a51e0060
Don't zap back to back volatile load/stores
...
llvm-svn: 41759
2007-09-07 05:33:03 +00:00
Owen Anderson
e2f23a3abf
Add lengthof and endof templates that hide a lot of sizeof computations.
...
Patch by Sterling Stein!
llvm-svn: 41758
2007-09-07 04:06:50 +00:00
Ted Kremenek
3ce57c6baf
Added more checking in "dead stores" for values that are initialized
...
but never used.
Fix a bug in LiveVariables where uses on the LHS of self-assign
operators (e.g +=, *=, etc) would not be properly recorded in the
liveness state of the variable.
llvm-svn: 41757
2007-09-06 23:39:53 +00:00
Ted Kremenek
10e7870746
Minor bug fixes to corner cases where LiveVariables would crash on some CFGs
...
that contained no declarations, or when a variable is declared but never used.
llvm-svn: 41756
2007-09-06 23:25:10 +00:00
Ted Kremenek
1bb9f2596f
Forgot to check in the actual "dead stores" checker in the last commit!
...
llvm-svn: 41755
2007-09-06 23:01:46 +00:00
Ted Kremenek
6dc7b11d32
Added "Dead Stores", a flow-sensitive checker that checks for stores
...
to variables that are no longer live. This analysis is built on top
of CFGs and the LiveVariables analysis.
changes to driver:
added driver option "-check-dead-stores" to run the analysis
llvm-svn: 41754
2007-09-06 23:00:42 +00:00
Ted Kremenek
3f8ed2653c
LiveVariables:
...
- Finished 99% of analysis logic. Probably a few bugs.
- Added querying functions to query liveness.
- Added better pretty printing of liveness.
- Added better bookkeeping of per-variable liveness information.
- Added LiveVariablesAuditor interface, which allows "lazy" querying
of intra-basic block liveness information.
Driver:
- Minor cleanups involved in dumping liveness information.
llvm-svn: 41753
2007-09-06 21:26:58 +00:00
Steve Naroff
09bf815f89
The goal of this commit is to get just enough Sema support to recognize Objective-C classes
...
as types. That said, the AST nodes ObjcInterfaceDecl, ObjcInterfaceType, and ObjcClassDecl are *very*
preliminary.
The good news is we no longer need -parse-noop (aka MinimalActions) to parse cocoa.m.
llvm-svn: 41752
2007-09-06 21:24:23 +00:00
David Greene
517d5d8ebe
Constify to catch bugs.
...
llvm-svn: 41751
2007-09-06 19:46:46 +00:00
Dale Johannesen
bed9dc423c
Next round of APFloat changes.
...
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double. Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)
llvm-svn: 41747
2007-09-06 18:13:44 +00:00
Anton Korobeynikov
a07765b8f4
Proper handle case, when aliasee is external weak symbol referenced only by alias itself.
...
Also, fix a case, when target doesn't have weak symbols supported.
llvm-svn: 41746
2007-09-06 17:21:48 +00:00
Ted Kremenek
73c18e0362
Added LabelLoc to GotoStmt to record the source location of the label token
...
in the actual GotoStmt.
Fixed bug where GotoStmt::getSourceRange incorrectly used the target LabelStmt
to compute its extent.
llvm-svn: 41745
2007-09-06 17:11:52 +00:00
David Greene
a6d5d2a6a0
Add instruction dump output. This helps find bugs.
...
llvm-svn: 41744
2007-09-06 16:36:39 +00:00