Commit Graph

95912 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis f89a56c74b Warn about arg1 && arg2 || arg3, as GCC 4.3+ does. Fixes rdar://8659922
llvm-svn: 119381
2010-11-16 21:00:12 +00:00
Rafael Espindola a9e9593d49 Add const.
llvm-svn: 119380
2010-11-16 20:56:23 +00:00
Douglas Gregor 3edb16765d Use an OwningPtr for the preamble buffer in ASTUnit. This plugs a leak
where we failed to free this buffer along one of the paths, and
detangles the code a little.

llvm-svn: 119379
2010-11-16 20:45:51 +00:00
Anton Yartsev f2a1345a34 turned pointers into pointers to const in function parameters in all functions/builtins accepting pointers to a const-qualified type according to PIM and "Language Extensions for CBEA"
llvm-svn: 119376
2010-11-16 20:09:36 +00:00
Jakob Stoklund Olesen 9beef41f2c Fix emergency spilling in LiveIntervals::spillPhysRegAroundRegDefsUses.
Always spill the full representative register at any point where any subregister
is live.

This fixes PR8620 which caused the old logic to get confused and not spill
anything at all.

The fundamental problem here is that the coalescer is too aggressive about
physical register coalescing. It sometimes makes it impossible to allocate
registers without these emergency spills.

llvm-svn: 119375
2010-11-16 19:55:14 +00:00
Jakob Stoklund Olesen 7583f68954 Print out the register class of the current interval.
llvm-svn: 119374
2010-11-16 19:55:12 +00:00
Johnny Chen 43b3bad58b Initial check-in of a Python utility to run the lldb test suite and send the
result including the session logs of test failures/errors as a MIME message.

llvm-svn: 119371
2010-11-16 19:44:50 +00:00
Peter Collingbourne b813cacf06 Document -enable-no-infs-fp-math and -enable-no-nans-fp-math command line options
llvm-svn: 119370
2010-11-16 19:40:13 +00:00
Bob Wilson dfac58bed1 Tidy up some things in <arm_neon.h>.
Stop defining types with "__neon_" prefixes and then using typedefs without
the prefix; there's no reason to do that anymore.  Remove types that combine
multiple Neon vectors and treat them as a single long vector; they are not
used.

llvm-svn: 119369
2010-11-16 19:39:14 +00:00
Fariborz Jahanian a3e54bd33e Implements __block API for c++ objects. There is still
issue with runtime which I am discussing it with Blaine.
This is wip (so no test yet).

llvm-svn: 119368
2010-11-16 19:29:39 +00:00
Bob Wilson 2880185194 Reapply "Stop using struct wrappers for Neon vector types in <arm_neon.h>."
I've temporarily disabled the failing clang test.

llvm-svn: 119367
2010-11-16 19:16:06 +00:00
Bob Wilson 849857445f Temporarily disable this check for Neon vector type mangling.
I'll reenable it soon when I'm done reworking <arm_neon.h>.

llvm-svn: 119366
2010-11-16 19:08:19 +00:00
Michael J. Spencer 83d98c1d38 system_error: More conditional error codes for Darwin.
llvm-svn: 119365
2010-11-16 18:48:21 +00:00
Ted Kremenek 0c27bcfd05 Static analyzer: Catch calls to malloc() with
allocation sizes of 0 bytes.

Fixes PR 2899.

llvm-svn: 119364
2010-11-16 18:47:04 +00:00
Bob Wilson 4d9c9a646b Revert "Stop using struct wrappers for Neon vector types in <arm_neon.h>."
It's breaking buildbots.

llvm-svn: 119363
2010-11-16 18:43:07 +00:00
Rafael Espindola 3bbea57a6e Parse and ignore some .cfi_* directives.
llvm-svn: 119362
2010-11-16 18:34:07 +00:00
Michael J. Spencer 5ed2428b3c This is the first step in adding sane error handling support to LLVMSystem.
The system API's will be shifted over to returning an error_code, and returning
other return values as out parameters to the function.

Code that needs to check error conditions will use the errc enum values which
are the same as the posix_errno defines (EBADF, E2BIG, etc...), and are
compatable with the error codes in WinError.h due to some magic in system_error.

An example would be:

if (error_code ec = KillEvil("Java")) { // error_code can be converted to bool.
  handle_error(ec);
}

llvm-svn: 119360
2010-11-16 18:31:52 +00:00
Argyrios Kyrtzidis 20ee5ae871 Emit a specific diagnostic when typedefing C++ bool, mirroring gcc.
Fixes rdar://8365458

llvm-svn: 119359
2010-11-16 18:18:13 +00:00
Bob Wilson d6b6755414 Stop using struct wrappers for Neon vector types in <arm_neon.h>.
Thanks to Nate Begeman for an earlier version of this patch.

llvm-svn: 119358
2010-11-16 18:17:03 +00:00
Jim Grosbach 186747527a Revert inadvertant checkin of CMake libdeps.
llvm-svn: 119355
2010-11-16 18:14:41 +00:00
Jim Grosbach e600aba989 ARM conditional mov encoding fix.
llvm-svn: 119354
2010-11-16 18:13:42 +00:00
Johnny Chen 7826b0a721 Disambiguate the name lookup for the data type of anon_uint variable.
llvm-svn: 119353
2010-11-16 18:11:55 +00:00
Duncan Sands 637049515f Have a few places that want to simplify phi nodes use SimplifyInstruction
rather than calling hasConstantValue.  No intended functionality change.

llvm-svn: 119352
2010-11-16 17:41:24 +00:00
Dan Gohman a230754385 Fix missing includes of "llvm/Analysis/Passes.h" in the tutorials. Thanks
for Arnaud Allard de Grandmaison for preparing a patch.

llvm-svn: 119351
2010-11-16 17:28:22 +00:00
Benjamin Kramer d1fb1f49a2 MSVC doesn't like the noinline attribute at the end of a declaration. Try the other side.
llvm-svn: 119349
2010-11-16 15:45:46 +00:00
Nico Weber 1610d47048 Add gcc-4.4.4 headers on Gentoo systems. Patch by Bertjan Broeksema!
llvm-svn: 119348
2010-11-16 12:42:55 +00:00
Duncan Sands 5ffc298bc7 In which I discover the existence of loops. Threading an operation
over a phi node by applying it to each operand may be wrong if the
operation and the phi node are mutually interdependent (the testcase
has a simple example of this).  So only do this transform if it would
be correct to perform the operation in each predecessor of the block
containing the phi, i.e. if the other operands all dominate the phi.
This should fix the FFMPEG snow.c regression reported by İsmail Dönmez.

llvm-svn: 119347
2010-11-16 12:16:38 +00:00
Chandler Carruth 40c98640e1 Remove an unintended restriction on sysroots introduced during the Path
conversion.

llvm-svn: 119346
2010-11-16 11:30:11 +00:00
Chandler Carruth b19289331d This really seems like a boring set of fixes to our tests to make them more
independent of the underlying system. Let me know if any of these are too
aggressive.

llvm-svn: 119345
2010-11-16 10:26:08 +00:00
John McCall 07bb19667a Simplify some complex emission and implement correct semantics for
assignment to volatiles in C.  This in effect reverts some of mjs's
work in and around r72572.  Basically, the C++ standard is quite
clear, except that it lies about volatile behavior approximating
C's, whereas the C standard is almost actively misleading.

llvm-svn: 119344
2010-11-16 10:08:07 +00:00
Chandler Carruth 5eef9ba483 Futher reduce the includes of our builtin headers, and teach limits.h to avoid
include_next when not hosted or unavailable. This follows the pattern in
stdint.h and allows these headers to work even in a freestanding configuration
without a standard library.

llvm-svn: 119343
2010-11-16 10:07:43 +00:00
John McCall 6dd263e31b Reverting r119341: doesn't compile, no obvious fix.
llvm-svn: 119342
2010-11-16 09:18:38 +00:00
Marcin Swiderski 76e66c1d60 Refactored GRExprEngine::getCXXThisRegion to use CXXMethodDecl::getThisType instead of calculating it by hand.
llvm-svn: 119341
2010-11-16 08:50:38 +00:00
Chandler Carruth 1c8383dccd Fix PR8625 and correctly interpret member-calls to static members when
producing warnings.

This feels really fragile, and I've not audited all other argument index-based
warnings. I suspect we'll grow this bug on another warning eventually. It might
be nice to adjust the argument indices when building up the attribute AST node,
as we already have to remember about the 'this' argument within that code to
produce correct errors.

llvm-svn: 119340
2010-11-16 08:49:43 +00:00
Chandler Carruth 743682bb9f Re-work the handling of implicit 'this' arguments and silly GCC-style attribute
argument indexes. This handles the offsets in a consistent manner for all of
the attributes which I saw working with these concepts. I've also added tests
for the attribute that motivated this: nonnull.

I consolidated the tests for format attributes into one file, and fleshed them
out a bit to trigger more of the warning cases. Also improved the quality of
some of the diagnostics that occur with invalid argument indices.

The only really questionable change here is supporting the implicit this
argument for the ownership attribute. I'm not sure it's really a sensible
concept there, but implemented the logic for consistency.

llvm-svn: 119339
2010-11-16 08:35:43 +00:00
Ted Kremenek 4ff4654893 Rework USR generation from CXCursors to use CXStringBufs
for the backing of generated USRs.  This optmizes
for the case when a client generates a sequence
of USRs in sequence, disposing of them soon
after generating them.  By using a string buffer,
we recycle malloc'ed memory instead of constantly
malloc'ing and copying strings.

llvm-svn: 119338
2010-11-16 08:15:38 +00:00
Ted Kremenek 915542850b Change CXTranslationUnit to not directly cast to an ASTUnit*,
but to wrap both an ASTUnit and a "string pool"
that will be used for fast USR generation.

This requires a bunch of mechanical changes, as
there was a ton of code that assumed that CXTranslationUnit
and ASTUnit* were the same.

Along with this change, introduce CXStringBuf,
which provides an llvm::SmallVector<char> backing
for repeatedly generating CXStrings without a huge
amount of malloc() traffic.  This requires making
some changes to the representation of CXString
by renaming a few fields (but keeping the size
of the object the same).

llvm-svn: 119337
2010-11-16 08:15:36 +00:00
Argyrios Kyrtzidis 9813d3221d Improve diagnostic for calling non-const method on const object. Fixes rdar://7743000
llvm-svn: 119336
2010-11-16 08:04:45 +00:00
Zhongxing Xu 1ade3267d7 Handle member initializer in C++ ctor.
- Add a new Kind of ProgramPoint: PostInitializer.
 - Still use GRStmtNodeBuilder. But special handling PostInitializer in 
   GRStmtNodeBuilder::GenerateAutoTransition().
 - Someday we should clean up the interface of GRStmtNodeBuilder.

llvm-svn: 119335
2010-11-16 07:52:17 +00:00
Craig Silverstein 9e448da324 Have CXXDeleteExpr::getDestroyedType return the actual destroyed type
in more situations.  In particular, for code like

   template<class T> void Fn() { T* x; delete x; }

getDestroyedType() will now return T rather than T*, as it would
before this change.  On the other hand, for code like this:

   template<class T> void Fn() { T x; delete x; }

getDestroyedType() will return an empty QualType(), since it doesn't
know what the actual destroyed type would be.  Previously, it would
return T.

OKed by rjmccall

llvm-svn: 119334
2010-11-16 07:16:25 +00:00
Marcin Swiderski 4098598ca8 Basic support for C++ in BasicStore:
- CXXThisRegion treated like VarRegion and ObjCIVarRegion in various places,
- Reference treated like pointer in BindDeclInternal.

llvm-svn: 119333
2010-11-16 07:15:33 +00:00
John McCall 3eba6e67ec Now that we have reliable cast kinds, simplify scalar cast IR gen.
llvm-svn: 119332
2010-11-16 06:21:14 +00:00
John McCall d50a27111c Kill CK_Unknown and flesh out the documentation for the existing CastKinds.
llvm-svn: 119331
2010-11-16 05:46:29 +00:00
John McCall fa8edb11e1 Teach complex compound assignment IR-generation that the RHS of
a compound assignment is always already in the computation type.

llvm-svn: 119330
2010-11-16 05:45:35 +00:00
Caroline Tice ef5c6d02f5 Make processes use InputReaders for their input. Move the process
ReadThread stuff into the main Process class (out of the Process Plugins).
This has the (intended) side effect of disabling the command line tool
from reading input/commands while the process is running (the input is
directed to the running process rather than to the command interpreter).

llvm-svn: 119329
2010-11-16 05:07:41 +00:00
Rafael Espindola 7d19efd6ff A bit more of gnu as compatibility when handling relocations with aliases.
llvm-svn: 119328
2010-11-16 04:11:46 +00:00
Jason Molenda 5920333be1 Add an UnwindPlan Row for the last instruction of a function when
we're using the stack pointer to define the CFA again.  Makes unwinds
while sitting at the 'ret' instruction work, assuming we have accurate
function address bounds.

llvm-svn: 119327
2010-11-16 03:01:20 +00:00
John McCall 29600e160e Kill off the remaining places which generate CK_Unknown casts.
llvm-svn: 119326
2010-11-16 02:32:08 +00:00
Bill Wendling 5aa33ca29d L_bit doesn't work here.
llvm-svn: 119325
2010-11-16 02:20:22 +00:00
Greg Clayton 7fedea2c6f First attempt and getting "const" C++ method function signatures correct.
It currently isn't working, but it should be close. I will work on this more
when I figure out what I am not doing correctly.

llvm-svn: 119324
2010-11-16 02:10:54 +00:00