Commit Graph

36340 Commits

Author SHA1 Message Date
Duncan Sands d31649bc59 Improve comment.
llvm-svn: 42132
2007-09-19 10:25:38 +00:00
Duncan Sands a38e527523 Partial fix for PR1678: correct some parts of constant
fold that were missed in the fix for PR1646.  Probably
this null/not-null logic should be factorized somewhere.

llvm-svn: 42131
2007-09-19 10:16:17 +00:00
Duncan Sands 56df7dec2b A global variable with external weak linkage can be null, while
an alias could alias such a global variable.

llvm-svn: 42130
2007-09-19 10:10:31 +00:00
Gabor Greif ef858c9ff6 include alloca.h if available. this helps Solaris, but intnat and uintnat types are still undefined, causing errors
llvm-svn: 42129
2007-09-19 09:29:58 +00:00
Duncan Sands 4e426623f5 Testcase for PR1678.
llvm-svn: 42128
2007-09-19 07:43:17 +00:00
Steve Naroff 59155be0b2 Remove #include of config.h, it is no longer needed.
llvm-svn: 42126
2007-09-19 03:01:22 +00:00
Evan Cheng 0effc3a6b8 Use struct SDep instead of std::pair for SUnit pred and succ lists. First step
in tracking physical register output dependencies.

llvm-svn: 42125
2007-09-19 01:38:40 +00:00
Evan Cheng 17f589f76e Set CCR (EFLAGS) copy cost to -1, i.e. extremely expensive to copy.
llvm-svn: 42124
2007-09-19 01:36:39 +00:00
Evan Cheng f73fb6261b Add CopyCost to TargetRegisterClass. This specifies the cost of copying a value
between two registers in the specific class.

llvm-svn: 42123
2007-09-19 01:35:01 +00:00
Devang Patel 69a55a38ed Relax loop ExitCondition predicate restriction.
llvm-svn: 42122
2007-09-19 00:28:47 +00:00
Devang Patel 455a53b7db Filter loops where split condition's false branch is not empty. For example
for (int i = 0; i < N; ++i) {
  if (i == somevalue)
    dosomething();
   else
    dosomethingelse();
}

llvm-svn: 42121
2007-09-19 00:15:16 +00:00
Devang Patel 4c238c451f Bail out early, before modifying anything.
llvm-svn: 42120
2007-09-19 00:11:01 +00:00
Devang Patel 31f2c8592c Work is incomplete. Loop is not modified at all right now.
llvm-svn: 42119
2007-09-19 00:08:13 +00:00
Devang Patel ee35011d01 ooops...
llvm-svn: 42118
2007-09-18 23:58:14 +00:00
Steve Naroff 467e619a65 Remove alloca import...
llvm-svn: 42117
2007-09-18 23:56:42 +00:00
Steve Naroff d54978ba8b Progress on message expressions...
- Add ObjcMessageExpr AST node and associated constructors.
- Add SourceLocation's to ActOnKeywordMessage/ActOnUnaryMessage API.
- Instantiate message expressions...
- Replace alloca usage with SmallString.

Next step, installing a correct type, among other tweaks...

llvm-svn: 42116
2007-09-18 23:55:05 +00:00
Ted Kremenek fb9ea52a13 DataflowSolver now acccepts an "_Equal" template parameter that allows the user
to specify how two dataflow values should be compared for equality.  The default
is to use std::equal_to.

llvm-svn: 42115
2007-09-18 23:40:51 +00:00
Ted Kremenek d51126b97e Fixed bug where getBitRef would incorrectly grab the bit from the
wrong bitvector.

llvm-svn: 42114
2007-09-18 23:30:45 +00:00
Ted Kremenek 9427b0e23b Changed solver to use "==" operator when comparing dataflow values
rather than a special "equal" method defined in the class for the
value.

llvm-svn: 42113
2007-09-18 23:30:21 +00:00
Evan Cheng e7ff9da64b Clean up.
llvm-svn: 42112
2007-09-18 22:56:31 +00:00
Evan Cheng e2e8f2d96b Fix a bogus splat xform:
shuffle <undef, undef, x, undef>, <undef, undef, undef, undef>, <2, 2, 2, 2>
!=
<undef, undef, x, undef>

llvm-svn: 42111
2007-09-18 21:54:37 +00:00
Ted Kremenek 8d4dcc5409 Minor performance fix in transfer function logic. Previously we
called VisitStmt, but VisitChildren is more direct and creates less
boilerplate logic.

llvm-svn: 42110
2007-09-18 21:47:41 +00:00
Ted Kremenek 271161078b More refactoring and code reduction.
llvm-svn: 42109
2007-09-18 21:43:18 +00:00
Gabor Greif 49122edc98 rename test, it is obviously misspelled
llvm-svn: 42108
2007-09-18 21:42:39 +00:00
Ted Kremenek b1361eaaa7 Add overloaded versions of DataflowSolver::runOnBlock to simplify
invocation of the solver.

UninitializedValues checker now uses CFG::runOnAllBlocks to query the
computed dataflow values (tighter code).

llvm-svn: 42107
2007-09-18 21:08:21 +00:00
Ted Kremenek 360c3b4abb Added member template CFG::VisitBlockStmts to provide a succinct way
of visiting all block-level statements in a CFG.

Tightened implementation of UninitializedValues.

llvm-svn: 42106
2007-09-18 20:59:00 +00:00
Ted Kremenek 2bde624474 Additional comments and cosmetic cleanups.
llvm-svn: 42105
2007-09-18 20:44:03 +00:00
Fariborz Jahanian 867a7eb5cb Patch for object creation and handling of category declarations.
llvm-svn: 42104
2007-09-18 20:26:58 +00:00
Dale Johannesen af12b57405 Prevent crash on long double.
llvm-svn: 42103
2007-09-18 18:36:59 +00:00
Ted Kremenek df9a2a9f8b Moved TransferFunction object within DataflowSolver to be a instance
variable instead of a temporary.

llvm-svn: 42102
2007-09-18 18:17:19 +00:00
Gordon Henriksen dc88c06732 Tests of the ocaml (and thus C) bindings for constants.
llvm-svn: 42101
2007-09-18 18:07:51 +00:00
Ted Kremenek 584e21a349 Modified DataFlowValues and DataflowSolver to associate dataflow value
with CFG *edges* instead of blocks.  This will fascilitate dataflow
analyses that are sensitive to block terminators, and also simplifies
some reasoning.

Updated UninitializedValues to comply to this new interface.

llvm-svn: 42099
2007-09-18 18:02:44 +00:00
Ted Kremenek 1d77d76837 Added type "CFG::Edge" to encapsulate the notion of directed-edges
within source-level CFGs.

llvm-svn: 42098
2007-09-18 18:01:15 +00:00
Dan Gohman 8cca8469de Move the entries for 64-bit CMP, IMUL, and a few others into the correct
tables so that they are eligible for reload/remat folding. And add
entries for JMP and CALL.

llvm-svn: 42094
2007-09-18 14:59:14 +00:00
Gordon Henriksen 37582f74cd Adding ocaml language bindings for the vmcore and bitwriter libraries. These are
built atop the C language bindings, and user programs can link with them as 
such:

  # Bytecode
  ocamlc -cc g++ llvm.cma llvmbitwriter.cma -o example example.ml
  # Native
  ocamlopt -cc g++ llvm.cmxa llvmbitwriter.cmxa -o example.opt example.ml

The vmcore.ml test exercises most/all of the APIs thus far bound. Unfortunately,
they're not yet numerous enough to write hello world. But:

  $ cat example.ml
  (* example.ml *)
  
  open Llvm
  open Llvm_bitwriter
  
  let _ =
    let filename = Sys.argv.(1) in
    let m = create_module filename in
    
    let v = make_int_constant i32_type 42 false in
    let g = define_global "hello_world" v m in
    
    if not (write_bitcode_file m filename) then exit 1;
    
    dispose_module m;

  $ ocamlc -cc g++ llvm.cma llvm_bitwriter.cma -o example example.ml
  File "example.ml", line 11, characters 6-7:
  Warning Y: unused variable g.
  $ ./example example.bc
  $ llvm-dis < example.bc
  ; ModuleID = '<stdin>'
  @hello_world = global i32 42            ; <i32*> [#uses=0]

The ocaml test cases provide effective tests for the C interfaces.

llvm-svn: 42093
2007-09-18 12:49:39 +00:00
Gordon Henriksen 4c7ca7d61e Regenerate.
llvm-svn: 42092
2007-09-18 12:27:13 +00:00
Gordon Henriksen c0f56013e1 (no commit message)
llvm-svn: 42091
2007-09-18 12:26:59 +00:00
Gordon Henriksen 5c4d7b8052 (no commit message)
llvm-svn: 42090
2007-09-18 12:26:17 +00:00
Hartmut Kaiser ae27fdc0f4 alloca.h doesn't exist on Windows.
llvm-svn: 42089
2007-09-18 12:16:59 +00:00
Gabor Greif 56c83140c1 alloca.h is needed on Solaris
llvm-svn: 42088
2007-09-18 11:01:25 +00:00
Gordon Henriksen be6bd16418 Incorporating review feedback for GC verifier patch.
llvm-svn: 42087
2007-09-18 10:14:30 +00:00
Bill Wendling e8c885f261 Don't pass back a reference to a temporary.
llvm-svn: 42086
2007-09-18 09:10:16 +00:00
Bill Wendling a83fd8014d Update my entry.
llvm-svn: 42079
2007-09-18 05:28:19 +00:00
Bill Wendling 69833b61ac The exception handling function info should be reset for each new
function. The information isn't used heavily -- it's only used at the end
of exception handling emission -- so there's no need to cache it.

llvm-svn: 42078
2007-09-18 05:03:44 +00:00
Gordon Henriksen 76a0374b25 C bindings for libLLVMCore.a and libLLVMBitWriter.a.
- The naming prefix is LLVM.
- All types are represented using opaque references.
- Functions are not named LLVM{Type}{Method}; the names became
  unreadable goop. Instead, they are named LLVM{ImperativeSentence}.
- Where an attribute only appears once in the class hierarchy (e.g.,
  linkage only applies to values; parameter types only apply to
  function types), the class is omitted from identifiers for
  brevity. Tastes like methods.
- Strings are C strings or string/length tuples on a case-by-case
  basis.
- APIs which give the caller ownership of an object are not mapped
  (removeFromParent, certain constructor overloads). This keeps
  keep memory management as simple as possible.

For each library with bindings:

  llvm-c/<LIB>.h       - Declares the bindings.
  lib/<LIB>/<LIB>.cpp  - Implements the bindings.

So just link with the library of your choice and use the C header
instead of the C++ one.

llvm-svn: 42077
2007-09-18 03:18:57 +00:00
Gordon Henriksen 64e72c034a Fixing an comment in Module.h that refers to a nonexistent parameter.
Also adding some missing svn:ignores that've been bothering me.

llvm-svn: 42076
2007-09-18 02:09:34 +00:00
Devang Patel fcda998ab2 Fix PR1657
llvm-svn: 42075
2007-09-18 01:54:42 +00:00
Bill Wendling 067f1d8e95 Objective-C was generating EH frame info like this:
"_-[NSString(local) isNullOrNil]".eh = 0
        .no_dead_strip  "_-[NSString(local) isNullOrNil]".eh

The ".eh" should be inside the quotes.

llvm-svn: 42074
2007-09-18 01:47:22 +00:00
Fariborz Jahanian 0c74e9d161 Uses more description name for method implementation kind argument.
Moves such argument as the last argument and uses defaul value.

llvm-svn: 42073
2007-09-18 00:25:23 +00:00
Hartmut Kaiser a9deb50918 Updated VC++ project files after file rename.
llvm-svn: 42072
2007-09-17 23:33:12 +00:00