Commit Graph

44076 Commits

Author SHA1 Message Date
Dan Gohman 298a1d6d5f Recognize the "default" keyword, which is documented in LangRef.html
and supported in the grammar, in the lexer.

llvm-svn: 51448
2008-05-22 22:30:09 +00:00
Dan Gohman 5d30975e5e Change uses of llvm::Type::isFirstClassType to use the new
llvm::Type::isSingleValueType. Currently these two functions have
the same behavior, but soon isFirstClassType will return true for
struct and array types.

Clang may some day want to use of isFirstClassType for some of
these some day as an optimization, but it'll require some
consideration.

llvm-svn: 51446
2008-05-22 22:12:56 +00:00
Evan Cheng a1100782d5 Add a couple of test cases.
llvm-svn: 51441
2008-05-22 21:19:19 +00:00
David Greene 830487035e When rewriting defs and uses after spilling, don't set the weight of a
live interval to infinity if the instruction being rewritten is an
original remat def instruction.  We were only checking against the clone
of the remat def which doesn't actually appear in the IR at all.

llvm-svn: 51440
2008-05-22 21:16:33 +00:00
David Greene 54b52fe13b Don't attempt to update SpillSlotToUsesMap for stack slots that aren't
generated by the spiller.

llvm-svn: 51439
2008-05-22 21:12:21 +00:00
Gabor Greif ff77c8b608 transform more loops to iterator form, detabify
llvm-svn: 51436
2008-05-22 19:24:54 +00:00
Evan Cheng 53963b775e Add missing patterns.
llvm-svn: 51435
2008-05-22 18:56:56 +00:00
Ted Kremenek 1df2f3a1f5 Expand retain/release checker to consider methods/function calls that cause a
tracked object to "escape": it's reference count might be incremented by the
called function, thus causing an object's lifetime to extend beyond when the
local reference count is decremented to 0.

This addresses: <rdar://problem/5933215>

llvm-svn: 51433
2008-05-22 17:31:13 +00:00
Ted Kremenek a4010c698c Don't use ostringstream (pulling in <sstream>) when creating the dead store diagnostic (simply not needed).
llvm-svn: 51432
2008-05-22 16:28:24 +00:00
Ted Kremenek 0954b4564e Update driver include paths to work on darwin10.
llvm-svn: 51431
2008-05-22 15:26:22 +00:00
Gabor Greif 6fb9d68206 Suppress warnings about missing placement delete. This should now be std-conformant even if compiled with exceptions on.
llvm-svn: 51429
2008-05-22 13:16:42 +00:00
Eli Friedman bb5de96bc8 Patch for PR2350; the issue was tnat we were allowing (with an error)
void f(const void) in one place and rejecting it in another.

llvm-svn: 51424
2008-05-22 08:54:03 +00:00
Gabor Greif b90b3728a7 Rewrite operand loops to use iterators. This shrinks .o file (at gcc4.0.1 -O3 x86) substantially (>500 bytes). Reason still unknown.
llvm-svn: 51423
2008-05-22 06:43:33 +00:00
Chris Lattner 3d1797ccaa fix an off-by-one error in my previous patch, don't treat the callee as a incoming arg.
llvm-svn: 51422
2008-05-22 06:29:38 +00:00
Chris Lattner 79be90c3c7 Add support for multiple-return values in inline asm. This should
get inline asm working as well as it did previously with the CBE
with the new MRV support for inline asm.

llvm-svn: 51420
2008-05-22 06:19:37 +00:00
Chris Lattner ee00d04da0 Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs.  Testcase here: 
test/CodeGen/X86/asm-indirect-mem.ll

llvm-svn: 51409
2008-05-22 04:46:38 +00:00
Chris Lattner a87f1a568c testcase for PR2267
llvm-svn: 51408
2008-05-22 04:45:22 +00:00
Chris Lattner b0ccc8c8bb Free and vaarg are not really volatile.
llvm-svn: 51407
2008-05-22 03:23:06 +00:00
Chris Lattner c5ec1e19eb rewrite the validity checking for memory promotion to be simpler,
more aggressive, and more correct.  Verify that we only attempt to
promote loads and stores.

llvm-svn: 51406
2008-05-22 03:22:42 +00:00
Chris Lattner 92d7963325 minor edits
llvm-svn: 51405
2008-05-22 03:06:14 +00:00
Eli Friedman 1763075b9c Make debugging information usable. This is barebones, but it makes -g
actually work (instead of crashing llc), and there's enough info emitted 
to get line number information in gdb. This should hopefully be helpful 
for debugging non-working programs.

I got rid of the begin/endregion calls because the implementation wasn't 
working; someone who knows the debugging info a bit better might try to 
add it. I really have no clue how a compiler is supposed to emit them.

This commit shouldn't have any effect without -g.

llvm-svn: 51404
2008-05-22 01:40:10 +00:00
Eli Friedman c7460b1011 Minor refactoring: compute the return value separately from emitting the
ret.

llvm-svn: 51403
2008-05-22 01:22:33 +00:00
Eli Friedman e53d15386f Make CurFuncDecl more specific; I have some code I'm going to land in a
bit that wants to use CurFuncDecl as a FunctionDecl.

llvm-svn: 51402
2008-05-22 01:16:59 +00:00
Chris Lattner f12c08dcd8 Use 'continue' to reduce nesting in this loop. No functionality change.
llvm-svn: 51399
2008-05-22 00:53:38 +00:00
Dan Gohman 75d69da5ab Move getAccessedFieldNo out of lib/AST/Expr.cpp into
lib/CodeGen/CGExpr.cpp and to change include/clang/AST/Attr.h to
use its own enum for visibility types instead of using
llvm::GlobalValue::VisibilityTypes. These changes eliminate
dependencies in the AST library on LLVM's VMCore library.

llvm-svn: 51398
2008-05-22 00:50:06 +00:00
Dan Gohman da8fb59148 Add a Type::isSingleValueType method. This will be used by code
that currently uses Type::isFirstClassType and depends on it
returning false for struct or array types.

This commit doesn't change the behavior of Type::isFirstClassType.

llvm-svn: 51396
2008-05-21 23:35:53 +00:00
Ted Kremenek 91f035cda7 Improve dead stores diagnostics to include the variable name.
llvm-svn: 51395
2008-05-21 22:59:16 +00:00
Evan Cheng a5d27ae586 Fix PR2343. An *interesting* coalescer bug.
BB1:                                                                                                                                                  
  vr1025 = copy vr1024                                                                                                                                
  ..                                                                                                                                                  
BB2:                                                                                                                                                  
  vr1024 = op                                                                                                                                         
         = op vr1025                                                                                                                                     
  <loop eventually branch back to BB1>

Even though vr1025 is copied from vr1024, it's not safe to coalesced them since live range of vr1025 intersects the def of vr1024. This happens when vr1025 is assigned the value of the previous iteration of vr1024 in the loop.

llvm-svn: 51394
2008-05-21 22:34:12 +00:00
Bill Wendling 89c2e3babb Follow-up to the reverting of r51218. This puts the checks out-of-line. Because
they aren't in the header file, systems with a <string> header file that isn't
64-bit clean shouldn't warn if #including Path.h and specifying
-Wshorten-64-to-32.

llvm-svn: 51393
2008-05-21 21:20:07 +00:00
Dan Gohman dac7fe424f Remove the unneeded #include of VMCore header "llvm/DerivedTypes.h".
llvm-svn: 51392
2008-05-21 20:26:42 +00:00
Dan Gohman 1627ae7c48 Explicitly #include Support/Streams.h when using llvm::cout and friends.
llvm-svn: 51391
2008-05-21 20:19:16 +00:00
Gabor Greif f8d82e949a update a comment
llvm-svn: 51390
2008-05-21 18:57:33 +00:00
Gabor Greif e48de9c781 adapt to new API
llvm-svn: 51387
2008-05-21 18:30:15 +00:00
Evan Cheng 16f036cbe8 Rename -no-lazy to -disable-lazy-compilation.
llvm-svn: 51386
2008-05-21 18:20:21 +00:00
Ted Kremenek a2157719be Add Destroy method to Types, making there destruction more harmonious with
the destruction of Decls and Stmts.

llvm-svn: 51385
2008-05-21 16:38:54 +00:00
Nate Begeman 8f83fc4d9b Fix a couple issues with the JIT and multiple modules:
1. The "JITState" object creates a PassManager with the ModuleProvider that the
   jit is created with.  If the ModuleProvider is removed and deleted, the
   PassManager is invalid.

2. The Global maps in the JIT were not invalidated with a ModuleProvider was 
   removed.  This could lead to a case where the Module would be freed, and a 
   new Module with Globals at the same addresses could return invalid results.

llvm-svn: 51384
2008-05-21 16:34:48 +00:00
Ted Kremenek f025a8bc1c Fix potential double-free.
llvm-svn: 51381
2008-05-21 16:00:02 +00:00
Steve Naroff e181c13593 Fixup ASTContext::PrintStats()...it was causing several test failures.
llvm-svn: 51380
2008-05-21 15:59:22 +00:00
Ted Kremenek 512d9412ec When destroying DeclStmts, also destroy the associated Decl (reclaim its memory).
llvm-svn: 51379
2008-05-21 15:53:55 +00:00
Ted Kremenek b120ff1b95 Fixed bug in the transfer function for dereferences: the loaded value from EvalLoad should bind to the UnaryOperator*, not its subexpression.
Added test case to exercise this fix when checking for uses of uninitialized values.

Patch by Zhongxing Xu!

llvm-svn: 51377
2008-05-21 15:48:33 +00:00
Gabor Greif 78d66e4ac1 resurrect lost tests by renaming them to not end with .tr
llvm-svn: 51375
2008-05-21 14:48:24 +00:00
Gabor Greif 6e38b0ef41 suppress gcc3.4.6's <no value returned> warnings
llvm-svn: 51372
2008-05-21 14:07:30 +00:00
Eli Friedman 9a5ffcb14e Remove an unnecessary/buggy if check. Ran into this with some other
changes in my tree, so I don't have a testcase which affects trunk.

llvm-svn: 51371
2008-05-21 13:24:44 +00:00
Eli Friedman 43f6b67135 A small testcase; no patch, since it was a bug in a patch I never
committed.

llvm-svn: 51370
2008-05-21 13:21:01 +00:00
Eli Friedman 0ceef458b6 Fix this test so that it's valid; the point is to test for the crash,
not the missing diagnostic.

llvm-svn: 51365
2008-05-21 05:37:55 +00:00
Eli Friedman b158b4a47b Fix the destruction "properly" in the sense that we actually destroy the
ASTs.  This is a hack, but I haven't considered how we really 
want to do this.

llvm-svn: 51364
2008-05-21 05:33:10 +00:00
Eli Friedman 0883bfb541 PR2347: Fix crash iterating over VLAs; this started triggering because
we now iterate over the whole AST when we destroy it.

llvm-svn: 51363
2008-05-21 05:06:46 +00:00
Eli Friedman 14b2993484 Don't kill the declarations if the translation unit doesn't own them
(specifically, for TranslationUnits created from SerializationTest.cpp).  
Fixes a double-free bug in the serialization tests.

llvm-svn: 51362
2008-05-21 05:01:55 +00:00
Eli Friedman 86346ede95 Fix a couple of bugs found by Neil Booth in the const-ness checking.
llvm-svn: 51361
2008-05-21 03:39:11 +00:00
Eli Friedman bcfa2d75d7 Protect iso646.h from C++ (although I can't imagine why someone would
need it...).  Patch by Mike Stump.

llvm-svn: 51360
2008-05-21 03:11:31 +00:00