Commit Graph

73313 Commits

Author SHA1 Message Date
Bob Wilson fffbc0c5d9 Don't count PHI instructions toward the limit for tail duplicating a block.
llvm-svn: 90326
2009-12-02 17:15:24 +00:00
Jim Grosbach d831ef4945 Move EliminateDuplicatePHINodes() from SimplifyCFG.cpp to Local.cpp
llvm-svn: 90324
2009-12-02 17:06:45 +00:00
Ted Kremenek 217d7d7bcc Update checker build.
llvm-svn: 90323
2009-12-02 16:42:21 +00:00
Douglas Gregor 6ae34abd1b Move file-remapping logic into InitPreprocesor. No functionality change
llvm-svn: 90322
2009-12-02 16:32:41 +00:00
Andreas Neustifter 3d207290fe Cheap, mostly strict, stable sorting.
This is necessary for tests so the results are comparable.

llvm-svn: 90320
2009-12-02 15:57:15 +00:00
Benjamin Kramer eee88bc5d2 Silence compiler warnings.
llvm-svn: 90319
2009-12-02 15:33:44 +00:00
Devang Patel 8c33959df2 Clarify that DIEString does not keep a copy of the string.
llvm-svn: 90318
2009-12-02 15:25:16 +00:00
Douglas Gregor 9485bf9538 Extend the CIndex code-completion API to perform code completion
involving unsaved files, using the -remap-file= functionality recently
added to clang-cc.

llvm-svn: 90314
2009-12-02 09:21:34 +00:00
John McCall 3d988d9042 r90313, in which OverloadedFunctionDecl is removed and never spoken of again.
llvm-svn: 90313
2009-12-02 08:47:38 +00:00
Daniel Dunbar e7fe5b2613 Fix relative ordering of Analyis library.
llvm-svn: 90312
2009-12-02 08:44:24 +00:00
Daniel Dunbar a8a509376c Fix ASTUnit::getOriginalSourceFileName() when using ASTUnit's derived from
source files.

llvm-svn: 90311
2009-12-02 08:44:16 +00:00
Daniel Dunbar 7afbb8c08c ASTUnit: Don't create an LLVMContext, it shouldn't be needed.
llvm-svn: 90310
2009-12-02 08:43:56 +00:00
John McCall 67c0087074 Rip out the last remaining implicit use of OverloadedFunctionDecl in Sema:
LookupResult::getAsSingleDecl() is no more.  Shift Sema::LookupSingleName to
return null on overloaded results.

llvm-svn: 90309
2009-12-02 08:25:40 +00:00
Mike Stump a510597ef9 terminate doesn't throw.
llvm-svn: 90308
2009-12-02 08:18:09 +00:00
Douglas Gregor d062bff7ee Introduce a new clang-cc option
-remap-file=from;to

which takes the file "from" and transparently replaces its contents
with the contents of the file "to" from the source manager's
perspective. This is the moral equivalent of

  cp from saved
  cp to from
  <call clang>
  cp saved from
  rm saved

without all of the pesky file copying.

llvm-svn: 90307
2009-12-02 08:08:39 +00:00
John McCall d28ae27d8d Push overloaded function templates through the parser using a totally different
leaked data structure than before.  This kills off the last remaining 
explicit uses of OverloadedFunctionDecl in Sema.                                         

llvm-svn: 90306
2009-12-02 08:04:21 +00:00
Mike Stump 33270211a0 More exception handling improvements... WIP.
Highlights include:

  Add a helper to generate __cxa_free_exception and _ZSt9terminatev.
  Add a region to handle EH object deallocation for ctor failures for throw.
  Add a terminate handler for __cxa_end_catch.
  A framework for adding cleanup actions for the exceptional edges only.

llvm-svn: 90305
2009-12-02 07:41:41 +00:00
Owen Anderson b9878ee6b6 Cleanup/remove some parts of the lifetime region handling code in memdep and GVN,
per Chris' comments.  Adjust testcases to match.

llvm-svn: 90304
2009-12-02 07:35:19 +00:00
Eli Friedman 6393aac45e Fix another "operator delete missing" crash: make sure we don't check
isVirtual() before we've actually calculated whether the destructor is
virtual.

llvm-svn: 90303
2009-12-02 07:16:50 +00:00
Eli Friedman df76fe45e6 Tweak test to check for a bit more.
llvm-svn: 90302
2009-12-02 07:04:32 +00:00
Eli Friedman 81bce6b05e Make sure to call AddOverriddenMethods for implicit copy assignment operators;
it's rare, but possible, for the difference to be significant.

llvm-svn: 90301
2009-12-02 06:59:20 +00:00
Douglas Gregor 53ad6b94b0 Extend the source manager with the ability to override the contents of
files with the contents of an arbitrary memory buffer. Use this new
functionality to drastically clean up the way in which we handle file
truncation for code-completion: all of the truncation/completion logic
is now encapsulated in the preprocessor where it belongs
(<rdar://problem/7434737>).

llvm-svn: 90300
2009-12-02 06:49:09 +00:00
Chris Lattner c468025ac9 factor some code better.
llvm-svn: 90299
2009-12-02 06:44:58 +00:00
Chris Lattner 2764b4dc55 formatting cleanups.
llvm-svn: 90298
2009-12-02 06:35:55 +00:00
Chris Lattner eea42c7b51 tidy up, remove dependence on order of evaluation of function args from EmitMemCpy.
llvm-svn: 90297
2009-12-02 06:05:42 +00:00
Zhongxing Xu af35329f71 Hard bifurcate the state into nil receiver and non-nil receiver, so that
we don't need to use the DoneEvaluation hack when check for 
ObjCMessageExpr.

PreVisitObjCMessageExpr() only checks for undefined receiver or arguments.

Add checker interface EvalNilReceiver(). This is a 'once-and-done' interface.

llvm-svn: 90296
2009-12-02 05:49:12 +00:00
Zhongxing Xu d186a02987 libFrontend depends on libDriver now.
llvm-svn: 90295
2009-12-02 05:45:19 +00:00
Douglas Gregor 2a1b691622 Eliminate the unnecessary FirstFID cache variable from the source manager's ContentCache
llvm-svn: 90294
2009-12-02 05:34:39 +00:00
Chris Lattner 4ca1981e82 merge sext-2 into sext.ll
llvm-svn: 90293
2009-12-02 05:34:35 +00:00
Chris Lattner 0a12a8f9fe rename test
llvm-svn: 90292
2009-12-02 05:32:33 +00:00
Chris Lattner fe206d2a13 filecheckize
llvm-svn: 90291
2009-12-02 05:32:16 +00:00
Mon P Wang bb3eac9e7a Fixed an assertion failure for tracking sext of a vector of integers
llvm-svn: 90290
2009-12-02 04:59:58 +00:00
John McCall cd4b47747b Stop trying to analyze class-hierarchies for dependently-scoped id-expressions;
there's nothing interesting we can say now that we're correctly not requiring
the qualifier to name a known base class in dependent contexts.

Require scope specifiers on member access expressions to name complete types
if they're not dependent;  delay lookup when they are dependent.

Use more appropriate diagnostics when qualified implicit member access
expressions find declarations from unrelated classes.

llvm-svn: 90289
2009-12-02 03:53:29 +00:00
Daniel Dunbar 55a17b66cd Add ASTUnit::LoadFromCommandLine, which creates an ASTUnit out of a list of
(clang/driver) command line arguments (including the source file).
 - The arguments are expected to include the source file.

 - The idea is that even though this is a somewhat odd API, its the form which
   many tools can most easily use (for example, by interposing with the compiler).

Also, switch index-test's -ast-from-source to use this entry point, and provide
a -arg command line argument which can be used to test that the command line
arguments are handled correctly.

llvm-svn: 90288
2009-12-02 03:23:45 +00:00
Daniel Dunbar 120c77e4e9 Driver: Add Command::Creator member variable, which tracks the tool that was
used to create a particular command.

llvm-svn: 90287
2009-12-02 03:23:25 +00:00
Fariborz Jahanian 037bcb5be3 Added an assert.
llvm-svn: 90285
2009-12-01 23:35:33 +00:00
Fariborz Jahanian 4d9ab43f23 Fix a code gen. crash synthesizing a destructor.
Fixes pr5660.

llvm-svn: 90283
2009-12-01 23:18:25 +00:00
Devang Patel a5749bda2c Add utility routine to create subprogram definition entry from subprogram declaration entry.
llvm-svn: 90282
2009-12-01 23:09:02 +00:00
Devang Patel a605b9124a Reuse existing subprogram DIE.
llvm-svn: 90281
2009-12-01 23:07:59 +00:00
Daniel Dunbar 465f4c4867 In SourceManager::isBeforeInTranslationUnit, if we are trying to compare two source locations with no common ancestor in the include stack, determine order by assuming memory buffers preceed files, and then that FileIDs are created in order.
The later assumption is patently false, but this was already broken -- this situation is conceptually impossible, my feeling is we should fix SourceManager and friends to make it impossible in practice as well. However, we need to fix PR5662 and perhaps some other things involving memory buffers first. In the short term I'm pretty sure this is reliable.

Chris, Argiris, is this going to break anything that wasn't already broken?

llvm-svn: 90280
2009-12-01 23:07:57 +00:00
Ted Kremenek 733a3e6104 Added dead-stores test cases that involve the use of blocks.
llvm-svn: 90277
2009-12-01 23:04:14 +00:00
Chris Lattner ed3b360290 pass the reason for failure up from MemoryBuffer and report it
in diagnostics when we fail to open a file.  This allows us to
report things like:

$ clang test.c -I.
test.c:2:10: fatal error: error opening file './foo.h': Permission denied
#include "foo.h"
         ^

llvm-svn: 90276
2009-12-01 22:52:33 +00:00
Chris Lattner 0e3b78a6c2 return more useful error messages by using strerror to format errno
instead of returning an ambiguous reason.

llvm-svn: 90275
2009-12-01 22:51:41 +00:00
Ted Kremenek b2dc72d2d0 Add new test case file that focuses on testing analyzer support for blocks.
llvm-svn: 90274
2009-12-01 22:47:46 +00:00
Eli Friedman b2b120f664 Make EmitStoreOfScalar generate a more sane representation of boolean stores.
"Fixes" PR5645.

llvm-svn: 90272
2009-12-01 22:31:51 +00:00
Eric Christopher 8aa46bc6fd Update per Bill's comments. Work in progress.
llvm-svn: 90271
2009-12-01 22:28:41 +00:00
John McCall a6d407c296 Fix IsProvablyNotDerivedFrom to always use record definitions when available.
Gets clang-on-clang passing again.

llvm-svn: 90270
2009-12-01 22:28:41 +00:00
Evan Cheng 732351f732 Fix PR5391: support early clobber physical register def tied with a use (ewwww)
- A valno should be set HasRedefByEC if there is an early clobber def in the middle of its live ranges. It should not be set if the def of the valno is defined by an early clobber.
- If a physical register def is tied to an use and it's an early clobber, it just means the HasRedefByEC is set since it's still one continuous live range.
- Add a couple of missing checks for HasRedefByEC in the coalescer. In general, it should not coalesce a vr with a physical register if the physical register has a early clobber def somewhere. This is overly conservative but that's the price for using such a nasty inline asm "feature".

llvm-svn: 90269
2009-12-01 22:25:00 +00:00
Ted Kremenek d63ba8f221 The minimum element size in BumpVector should be 1, not 0.
llvm-svn: 90268
2009-12-01 22:13:00 +00:00
Ted Kremenek 117e472b52 Provide the correct vector size for referenced variables.
llvm-svn: 90267
2009-12-01 22:12:34 +00:00