Commit Graph

36308 Commits

Author SHA1 Message Date
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
Bill Wendling 5752f692ed Add support for appending a suffix to the end of a mangled name.
llvm-svn: 42071
2007-09-17 22:39:32 +00:00
Fariborz Jahanian cfacdae9a8 Patch to remove ObjcProtoMethodDecl and use ObjcMethodDecl
instead for @protocol method decls.

llvm-svn: 42070
2007-09-17 22:36:42 +00:00
Evan Cheng ffd6995cc7 Bug fix and minor clean up of generated code.
llvm-svn: 42069
2007-09-17 22:26:41 +00:00
Devang Patel 00064e1bab Do not hide APInt::dump() inside #ifndef NDEBUG.
llvm-svn: 42068
2007-09-17 22:24:00 +00:00
Ted Kremenek 3c996d9a60 Bug fix to merging of data flow values (merge incorrectly made values
too "conservative").

Several revisions to UninitializedValues checker after testing.  We
now appear to be working correctly (probably some bugs still, but main
functionality appears to be there).  Implemented careful emitting of
warnings so that we wouldn't get a cascade of warnings for simply not
defining a single variable and using it everywhere.  This way the
warnings point closer to the root cause rather than "symptoms" from
using values derived from uninitialized variables.

llvm-svn: 42067
2007-09-17 21:59:08 +00:00
Tanya Lattner 613ccacb49 Fix broken default help strings for enable-shared, enable-static, and enable-fast-install. Regenerate configure script.
llvm-svn: 42066
2007-09-17 21:41:15 +00:00
Steve Naroff c4657d00bb Add a comment and remove unused constructors.
llvm-svn: 42063
2007-09-17 21:26:50 +00:00
Ted Kremenek fb5c46c740 Made driver flag --check-uninit-values more self-explanatory.
llvm-svn: 42062
2007-09-17 21:21:20 +00:00
Hartmut Kaiser f696cfcf06 Fixed a VC++ issue related to bitmasks. As it turns out the compiler fills the unused bits of the word a bitmask is stored in with '1' (or randomly, I can't tell, I've seen '1' so far only), which creates wrong results in certain cases.
Please review.

llvm-svn: 42061
2007-09-17 21:11:08 +00:00
Fariborz Jahanian 39d641f526 Patch to add objective-c's @protocl type declaration.
llvm-svn: 42060
2007-09-17 21:07:36 +00:00
Steve Naroff f0f2afce5a Finish defining Action API for message expressions.
llvm-svn: 42059
2007-09-17 21:01:15 +00:00
Devang Patel 267c07b51f Do not eliminate loop when it is invalid to do so. For example,
for(int i = 0; i < N; i++) {
	if ( i == XYZ) {
		A;
	else
		B;
	}
	C;
	D;
}

llvm-svn: 42058
2007-09-17 21:01:05 +00:00
Ted Kremenek 1abd5c9d8f Re-added UninitializedValues.cpp to the XCode project because the file was renamed.
llvm-svn: 42057
2007-09-17 20:52:52 +00:00
Ted Kremenek d0b206fd98 Renamed file due to mispelling.
llvm-svn: 42056
2007-09-17 20:50:02 +00:00
Ted Kremenek 7e61e81bbf UninitialuzedValues now only tracks BlockVarDecls; obviating false positives with
globals and function parameters.

llvm-svn: 42055
2007-09-17 20:49:30 +00:00
Devang Patel 712dbe9d13 Skeleton for transformations to truncate loop's iteration space.
llvm-svn: 42054
2007-09-17 20:39:48 +00:00
Gordon Henriksen a2f3e13cf4 Fix for PR1633: Verifier doesn't fully verify GC intrinsics
LLVM now enforces the following prototypes for the write barriers:

<ty>* @llvm.gcread(<ty2>*, <ty>**)
void @llvm.gcwrite(<ty>*, <ty2>*, <ty>**)

And for @llvm.gcroot, the first stack slot is verified to be an alloca or a 
bitcast of an alloca.

Fixes test/CodeGen/Generic/GC/lower_gcroot.ll, which violated these.

llvm-svn: 42051
2007-09-17 20:30:04 +00:00
Steve Naroff 486760aee3 - Refactored ObjcKeywordInfo into ObjcKeywordInfo, ObjcKeywordDecl, and ObjcKeywordMessage.
- Removed helper ObjcGetSelectorInfo(), moving the code directly into ObjcBuildMethodDeclaration().
- Many refinements to ParseObjCMessageExpression().
- Add ActOnMessageExpression().

Next step, finish the message actions and (finally) create/instantiate an ObjcMessageExpr AST.

llvm-svn: 42050
2007-09-17 20:25:27 +00:00
Dale Johannesen ff7e443792 Remove RSTRegClass case from loadRegFromStackSlot
and storeRegToStackSlot.  Evan and I concluded this
should never be needed and it appears to be true.
(It if is needed, adjustment would be needed for
long double to work.)

llvm-svn: 42049
2007-09-17 20:15:38 +00:00
Devang Patel 9d1af9b63d Fix comment.
llvm-svn: 42048
2007-09-17 20:07:40 +00:00
Devang Patel 77ae4d358f This is not ideal but unbreaks build failure.
APInt::dump() is inside #ifndef NDEBUG, however SelectionDAG dump() routines are not.

llvm-svn: 42047
2007-09-17 20:03:03 +00:00
Ted Kremenek dd3015375c More progress on UnitializedValues checker. We now have preliminary support
for reporting errors and running the checker.

llvm-svn: 42046
2007-09-17 19:59:27 +00:00
Dale Johannesen a1336cf57e Implement x86 long double in jit (not really
complete, but common cases work)

llvm-svn: 42043
2007-09-17 18:44:13 +00:00
Chris Lattner 0625bd6472 Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfo
Add a new DenseMapInfo::isEqual method to allow clients to redefine
the equality predicate used when probing the hash table.

llvm-svn: 42042
2007-09-17 18:34:04 +00:00
Ted Kremenek 6f0751475a Split tracking of unitialized values for Decls and CFGBlock-level expressions.
llvm-svn: 42041
2007-09-17 18:31:23 +00:00
Daniel Berlin bd590a8287 That's what i get for using carbon emacs in a terminal
llvm-svn: 42040
2007-09-17 18:05:59 +00:00
Daniel Berlin 28ae955181 Fix iterator so it doesn't sometimes report bits that aren't in the bitmap
llvm-svn: 42039
2007-09-17 18:04:21 +00:00
Dan Gohman e903c1021f Add a utility function to SDOperand for testing if a value is unused.
llvm-svn: 42038
2007-09-17 17:44:31 +00:00
Evan Cheng 8070099fef X86ISD::TEST is dead.
llvm-svn: 42037
2007-09-17 17:42:53 +00:00
Chris Lattner 1406f7143b regenerate
llvm-svn: 42036
2007-09-17 17:40:48 +00:00
Dan Gohman 2ac2652779 Instcombine x-((x/y)*y) into a remainder operator.
llvm-svn: 42035
2007-09-17 17:31:57 +00:00
Ted Kremenek 789ea076a8 Removed "ObserverTy" from core DataflowValues types. The observer
mechanism can be implemented simply by affixing the Observer to an
analysis meta data, so it doesn't need to be a required type.  This
also permits analyses not to implement an Observer if it doesn't make
sense.

Changed "DataflowValues::MetaDataTy" to
"DataflowValues::AnalysisDataTy" to reflect that the type
enscapsulated the data associated with analyzing a given CFG.

Changed CFGStmtVisitor::BlockStmt_VisitImplicitControlFlowStmt(Stmt*)
to ...VisitImplicitControlFlowExpr(Expr*).  The type narrowing is more
precise and more useful to clients.

Added CFGStmtVisitor::BlockStmt_VisitExpr to reflect the visitation of
expressions at the block statement level.  This captures all implicit
control-flow statements as well as other expressions that are hoisted
to the block level (such as conditions for terminators and function
calls).  This is especially useful for dataflow analysis.

llvm-svn: 42034
2007-09-17 17:14:52 +00:00