Commit Graph

54588 Commits

Author SHA1 Message Date
Ted Kremenek fa1840b25e Add panic function.
llvm-svn: 64852
2009-02-17 23:27:17 +00:00
Mike Stump eecd39f2d7 Avoid getNameAsCString when the decl doesn't have a name.
Build of the parm list with the iterator, not end().

llvm-svn: 64851
2009-02-17 23:25:52 +00:00
Daniel Dunbar 491812cd76 Rename UnaryTypeTraitExpr::Evaluate to EvaluateTrait to not collide
with Expr::Evaluate().

llvm-svn: 64850
2009-02-17 23:20:26 +00:00
Chris Lattner 976fdefe2f gcc spells it "warn_unused_result" (already supported) not "warnunusedresult"
llvm-svn: 64849
2009-02-17 23:20:10 +00:00
Douglas Gregor 67a6564091 Implement basic parsing and semantic analysis for explicit
specialization of class templates, e.g.,

  template<typename T> class X;

  template<> class X<int> { /* blah */ };

Each specialization is a different *Decl node (naturally), and can
have different members. We keep track of forward declarations and
definitions as for other class/struct/union types.

This is only the basic framework: we still have to deal with checking
the template headers properly, improving recovery when there are
failures, handling nested name specifiers, etc.

llvm-svn: 64848
2009-02-17 23:15:12 +00:00
Daniel Dunbar 79d10a2f43 ABITest: Add some checking of values for return types; useful for
catching internal consistency problems (esp. w/ reference compiler).

llvm-svn: 64847
2009-02-17 23:13:43 +00:00
Daniel Dunbar 45f68153d3 Note some more things to integrate into ABITest
llvm-svn: 64846
2009-02-17 23:12:22 +00:00
Duncan Sands bf3ba5a1e9 If an alias is dead and so is its aliasee, then globaldce would
crash because the alias would still be using the aliasee when the
aliasee was deleted.

llvm-svn: 64844
2009-02-17 23:05:26 +00:00
Devang Patel f4dad74621 And now, not so elegant, test case...
llvm-svn: 64838
2009-02-17 22:48:18 +00:00
Daniel Dunbar abdc0f1e07 Eliminate dependency on where test is run from.
llvm-svn: 64837
2009-02-17 22:47:27 +00:00
Devang Patel d57a720d57 Remove changes that were accidently included in previous commit.
llvm-svn: 64835
2009-02-17 22:45:18 +00:00
Devang Patel 4d20395a5f The debugger sometimes lookup dynamically in the runtime to find ivar info of any Objective-C classes. It would be very helpful to debugger if the compiler encodes runtime version number in DWARF.
Add support for two additional DWARF attributes to encode Objective-C runtime version number.

llvm-svn: 64834
2009-02-17 22:43:44 +00:00
Ted Kremenek bf30d54580 BasicValueFactory: getMinValue/getMaxValue can be applied to any location type as specified by Loc::IsLocType().
llvm-svn: 64832
2009-02-17 22:21:44 +00:00
Ted Kremenek 2620a06fe7 Attribute 'iboutlet' can be applied to Objective-C property declarations.
llvm-svn: 64831
2009-02-17 22:20:20 +00:00
Daniel Dunbar 43a5d9e409 Eek! getDeclAlign sometimes returned alignment in bits.
- Renamed to getDeclAlignInBytes since most other query functions
   work in bits.

 - Fun to track down as isIntegerConstantExpr was getting it right,
   but Evaluate() was getting it wrong. Maybe we should assert they
   compute the same thing when they succeed?

llvm-svn: 64828
2009-02-17 22:16:19 +00:00
Scott Michel cf0da6c597 Remove trailing whitespace to reduce later commit patch noise.
(Note: Eventually, commits like this will be handled via a pre-commit hook that
 does this automagically, as well as expand tabs to spaces and look for 80-col
 violations.)

llvm-svn: 64827
2009-02-17 22:15:04 +00:00
Chris Lattner abbd427cd0 initial reimplement tgmath.h, written by Howard Hinnant!
llvm-svn: 64826
2009-02-17 22:14:32 +00:00
Fariborz Jahanian 37b43cd89c Simplified ExtQualType per Chris's feedback.
llvm-svn: 64820
2009-02-17 21:45:36 +00:00
Devang Patel 528987a1e8 Emit debug info for bitfields.
llvm-svn: 64815
2009-02-17 21:23:59 +00:00
Rafael Espindola fabd0534fd tools like nm and ar only need register_claim_file and add_symbols. Don't abort
if other hooks are missing.

llvm-svn: 64812
2009-02-17 21:08:21 +00:00
Dan Gohman d90415555e LoopIndexSplit doesn't actually use ScalarEvolution.
llvm-svn: 64811
2009-02-17 20:50:11 +00:00
Dan Gohman 4330034160 Add a method to ScalarEvolution for telling it when a loop has been
modified in a way that may effect the trip count calculation. Change
IndVars to use this method when it rewrites pointer or floating-point
induction variables instead of using a doInitialization method to
sneak these changes in before ScalarEvolution has a chance to see
the loop. This eliminates the need for LoopPass to depend on
ScalarEvolution.

llvm-svn: 64810
2009-02-17 20:49:49 +00:00
Chris Lattner 24f31a0e59 commit a tweaked version of Daniel's patch for PR3599. We now
eliminate all the extensions and all but the one required truncate
from the testcase, but the or/and/shift stuff still isn't zapped.

llvm-svn: 64809
2009-02-17 20:47:23 +00:00
Argyrios Kyrtzidis 8c80735929 Remove one more redundant dyn_cast.
llvm-svn: 64808
2009-02-17 20:46:25 +00:00
Argyrios Kyrtzidis 84d8fae3be Move DeclContext::getParent and getLexicalParent in-line.
llvm-svn: 64806
2009-02-17 20:26:05 +00:00
Argyrios Kyrtzidis 50c0ff1f43 Currently all DeclContexts are Decls as well; use cast<Decl> instead of dyn_cast.
llvm-svn: 64805
2009-02-17 20:24:53 +00:00
Argyrios Kyrtzidis 4b4f67ac0a Remove some redundant Decl -> Decl castings.
llvm-svn: 64804
2009-02-17 20:23:54 +00:00
Argyrios Kyrtzidis 13c9cc8b37 Now that ObjC decls have DeclContexts too, remove an ugly hack from IdentifierResolver.
llvm-svn: 64802
2009-02-17 20:21:51 +00:00
Argyrios Kyrtzidis 0cf6625ff8 All Decls have a DeclContext now, hooray! Fans of consistency rejoice.
Pass the DeclContext to ObjCIvarDecls as well.

llvm-svn: 64801
2009-02-17 20:20:37 +00:00
Fariborz Jahanian 19c44508a1 Added support for objc's gc attribute in ExtQualType.
llvm-svn: 64800
2009-02-17 20:16:45 +00:00
Ted Kremenek 35b13439cc Convert tabs to spaces.
llvm-svn: 64799
2009-02-17 19:53:58 +00:00
Daniel Dunbar d97b07e7d4 Backend: Accept -mcpu and -mattr for use by TargetMachine.
llvm-svn: 64798
2009-02-17 19:47:34 +00:00
Dan Gohman 143206d07b Move dumpPassStructure out of line.
llvm-svn: 64796
2009-02-17 19:41:26 +00:00
Dan Gohman 15bf1a76b9 Tidy whitespace.
llvm-svn: 64791
2009-02-17 19:34:54 +00:00
Ted Kremenek 47c853007e Enhance tests to exercise more combinations of using the RangeConstraintManager with the RegionStoreManager.
llvm-svn: 64788
2009-02-17 19:29:07 +00:00
Ted Kremenek 3189f495de Revised RangeConstraintManager based on several discussions with Ben Laurie and
Zhongxing Xu. The resultant code is less than 1/2 the size of the original.

Key highlights:

- All CouldBeXXX methods have been removed. Checking for feasibility is now just
  done in the AddXXX methods.

- RangeSets now represent "all possible values" explicitly as the range set {
  [min, max] } instead of the empty set. The empty set now represents "no
  feasible values". This change consolidated much of the core algorithm to only
  have one code path instead of alternate paths that considered the empty set to
  represent "all possible falues."

llvm-svn: 64787
2009-02-17 19:28:04 +00:00
Ted Kremenek 131812a84c BasicValueFactory: getMaxValue and getMinValue now also handle 'block' pointers.
llvm-svn: 64786
2009-02-17 19:22:05 +00:00
Dan Gohman f84d42f282 Delete trailing whitespace.
llvm-svn: 64784
2009-02-17 19:13:57 +00:00
Daniel Dunbar 7b8b7492dd ccc: Pass -{MM,MMD,MF,MP,MT} to clang. Error on -{M,MM,MG,MQ} which
clang doesn't support yet.
 - See PR3603.

llvm-svn: 64783
2009-02-17 19:02:12 +00:00
Douglas Gregor 13c6362a43 Proof that attribute __overloadable__ works as well as overloadable
llvm-svn: 64781
2009-02-17 18:51:14 +00:00
Daniel Dunbar 38ad1e6138 Change EmitConstantExpr to allow failure.
IRgen no longer relies on isConstantInitializer, instead we just try
to emit the constant. If that fails then in C we emit an error
unsupported (this occurs when Sema accepted something that it doesn't
know how to fold, and IRgen doesn't know how to emit) and in C++ we
emit a guarded initializer.

This ends up handling a few more cases, because IRgen was actually
able to emit some of the constants Sema accepts but can't Evaluate().
For example, PR3398.

llvm-svn: 64780
2009-02-17 18:43:32 +00:00
Daniel Dunbar 3d926cbf79 80-cols.
llvm-svn: 64779
2009-02-17 18:31:04 +00:00
Fariborz Jahanian ece8582ca2 Renamed ASQualType to ExtQualType to reflect its more
general use; as for, objc2's gc type attributes. No
change in functionality.

llvm-svn: 64778
2009-02-17 18:27:45 +00:00
Daniel Dunbar 89f908b883 ccc: Recognize -isystem.
llvm-svn: 64776
2009-02-17 18:10:48 +00:00
Daniel Dunbar ce96aea9ec ccc: Assume gcc will accept piped assembler input when using generic GCC toolchain.
llvm-svn: 64775
2009-02-17 18:10:15 +00:00
Daniel Dunbar 8ceb91f41b ccc: Fix a FIXME.
llvm-svn: 64774
2009-02-17 18:07:00 +00:00
Duncan Sands f974c5703c This transform also applies to private linkage.
llvm-svn: 64773
2009-02-17 17:50:04 +00:00
Ted Kremenek 852882ca97 Add '_assert' to list of known panic functions.
llvm-svn: 64772
2009-02-17 17:48:52 +00:00
Ben Laurie c8f1ab5035 Don't include alloca.h if it doesn't exist.
llvm-svn: 64771
2009-02-17 17:33:31 +00:00
Ben Laurie 54a06ce437 Handle fatal errors.
llvm-svn: 64770
2009-02-17 17:32:22 +00:00