Commit Graph

120903 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 623e8778c1 In FixItRewriteToTemp::RewriteFilename don't try to close the file descriptor
with close(); return it instead.

Fixes mingw build and eliminates possible racing issues.

llvm-svn: 149043
2012-01-26 04:19:04 +00:00
Anna Zaks 60835eb11e [analyzer] The CFContainer test should only be run on x86_64.
llvm-svn: 149042
2012-01-26 04:00:23 +00:00
NAKAMURA Takumi 69ee7d5c52 Rewrite/FrontendActions.cpp: Tweak to unbreak msvc.
llvm-svn: 149041
2012-01-26 03:47:18 +00:00
Bob Wilson 269e6377dd Revert r148249: "Make the auto-detection hack for the iOS simulator set the target triple correctly."
There were some problems with this, so I'm backing it out for now.

llvm-svn: 149040
2012-01-26 03:37:03 +00:00
Peter Collingbourne c331a1eb19 Improve efficiency of Sema::MaybeBindToTemporary by working with the
canonical type directly and adding a fast path for the common case
that the type is directly a RecordType.

llvm-svn: 149039
2012-01-26 03:33:51 +00:00
Peter Collingbourne dad62f1bce Simplify {Record,Enum}Type::classof.
llvm-svn: 149038
2012-01-26 03:33:46 +00:00
Peter Collingbourne 53860cfeb0 Adjust CLANG_BUILD_EXAMPLES to mean whether the examples are built
by default, rather than whether they may be built at all.

llvm-svn: 149037
2012-01-26 03:33:40 +00:00
Peter Collingbourne 1425b4556a Use function pointers, rather than references, to pass Destroyers
around, in the process cleaning up the various gcc/msvc compiler
workarounds.

llvm-svn: 149036
2012-01-26 03:33:36 +00:00
Douglas Gregor e67bb67a9b Add missing include of <unistd.h>
llvm-svn: 149035
2012-01-26 03:20:14 +00:00
Eli Friedman f49643ddce Add an additional testcase for a lambda with implicit void return type.
llvm-svn: 149034
2012-01-26 03:16:41 +00:00
Chris Lattner 34d9a17778 unbreak test/Bitcode/shuffle.ll.
llvm-svn: 149033
2012-01-26 03:10:45 +00:00
Ted Kremenek 1ca6ce5a22 Post link to checker-260, which is checker-259 with some experimental checks enabled.
llvm-svn: 149032
2012-01-26 03:02:34 +00:00
Eli Friedman 34b49061aa Refactor to share code for handling return statements between lambda expressions and block literals. As it turns out, almost all the logic can be shared.
llvm-svn: 149031
2012-01-26 03:00:14 +00:00
Greg Clayton e284163990 Added a 'gdbremote' python module that adds two commands: start_gdb_log and end_gdb_log.
When this is imported into your lldb using the "command script import /path/to/gdbremote.py"
these new commands are available within LLDB. 'start_gdb_log' will enable logging with 
timestamps for GDB remote packets, and 'stop_gdb_log' will then dump the details and
also a lot of packet timing data. This allows us to accurately track what packets are
taking up the most time when debugging (when using the ProcessGDBRemote debugging plug-in).

Also udpated the comments at the top of the cmdtemplate.py to show how to correctly import
the module from within LLDB.

llvm-svn: 149030
2012-01-26 02:56:24 +00:00
Chris Lattner 8722fe5a24 simplify by using ShuffleVectorInst::getMaskValue.
llvm-svn: 149029
2012-01-26 02:54:54 +00:00
Chris Lattner cf12970bd0 eliminate the Constant::getVectorElements method. There are better (and
more robust) ways to do what it was doing now.  Also, add static methods
for decoding a ShuffleVector mask.

llvm-svn: 149028
2012-01-26 02:51:13 +00:00
Argyrios Kyrtzidis 24e9afff43 Introduce 3 new fixit options:
-fixit-recompile
	applies fixits and recompiles the result
-fixit-to-temporary
	applies fixits to temporary files
-fix-only-warnings">,
    applies fixits for warnings only, not errors

Combining "-fixit-recompile -fixit-to-temporary" allows testing the result of fixits
without touching the original sources.

llvm-svn: 149027
2012-01-26 02:40:48 +00:00
Eric Christopher 7b878febf1 Reverse the order that these are expected for clang change. Should
be no functional change (the offsets in AT_data_member_location are still
correct). If the gdb testsuite itself needs changing then I'll revert this
and the clang patch.

llvm-svn: 149026
2012-01-26 02:33:53 +00:00
Chris Lattner e8c94f7d98 fix to go along with an llvm change: VMCore now returns an UndefValue
when asking for a ConstantStruct with all undef elements.

llvm-svn: 149025
2012-01-26 02:33:22 +00:00
Chris Lattner fa77500d96 Continue improving support for ConstantDataAggregate, and use the
new methods recently added to (sometimes greatly!) simplify code.

llvm-svn: 149024
2012-01-26 02:32:04 +00:00
Chris Lattner f14a67f5d3 Add a ConstantDataVector::getSplatValue() method, for parity with
ConstantVector.  Fix some outright bugs in the implementation of
ConstantArray and Constant struct, which would cause us to not make
one big UndefValue when asking for an array/struct with all undef
elements.  Enhance Constant::isAllOnesValue to work with
ConstantDataVector.

llvm-svn: 149021
2012-01-26 02:31:22 +00:00
Ted Kremenek 37e965221c Enable several checkers under --analyze for general testing.
llvm-svn: 149016
2012-01-26 02:27:38 +00:00
Eric Christopher 9f94fa368a Tidy and remove some unused variables.
llvm-svn: 149015
2012-01-26 02:05:28 +00:00
Rafael Espindola 273fd772ab Fix our handling of #pragma GCC visibility.
Now the lexer just produces a token and the parser is the one responsible for
activating it.
This fixes problem like the one pr11797 where the lexer and the parser were not
in sync. This also let us be more strict on where in the file we accept
these pragmas.

llvm-svn: 149014
2012-01-26 02:02:57 +00:00
Eric Christopher 5bfde1aa42 Collect this information together. No reason to have it split.
llvm-svn: 149013
2012-01-26 01:57:29 +00:00
Eric Christopher a15e6352fe Refactor into its own function.
llvm-svn: 149012
2012-01-26 01:57:13 +00:00
Chandler Carruth 0b1756b880 Reintroduce r148981 with significantly improved regression test. Now it
both actually tests what it wants to, doesn't have bogus and broken
assertions in it, and is also formatted much more cleanly and
consistently. Probably still some more that can be improved here, but
its much better.

Original commit message:
----
Try to unbreak the FreeBSD toolchain's detection of 32-bit targets
inside a 64-bit freebsd machine with the 32-bit compatibility layer
installed. The FreeBSD image always has the /usr/lib32 directory, so
test for the more concrete existence of crt1.o. Also enhance the tests
for freebsd to clarify what these trees look like and exercise the new
code.

Thanks to all the FreeBSD folks for helping me understand what caused
the failure and how we might fix it. =] That helps a lot. Also, yay
build bots.

llvm-svn: 149011
2012-01-26 01:35:15 +00:00
Peter Collingbourne 76e1c8c9ae llvm-config: Add support for CMake build trees in which the build
mode does not form part of the path.

llvm-svn: 149010
2012-01-26 01:31:38 +00:00
NAKAMURA Takumi e3593114a1 StaticAnalyzer/Checkers: Fix CMake build.
llvm-svn: 149009
2012-01-26 01:14:39 +00:00
Anna Zaks 06f10bf05a [analyzer] Add an AST checker that checks for a common pitfall when
using CFArrayCreate & family.

Specifically, CFArrayCreate's input should be:
'A C array of the pointer-sized values to be in the new array.'

(radar://10717339)

llvm-svn: 149008
2012-01-26 01:05:43 +00:00
Fariborz Jahanian 26d8371b07 objc: allow block pointer matching 'id' type when
they show up as argument types of two block pointers.
// rdar://10734265

llvm-svn: 149007
2012-01-26 00:45:38 +00:00
Chris Lattner 8326bd8e10 some general cleanup, using new methods and tidying up old code.
llvm-svn: 149006
2012-01-26 00:42:34 +00:00
Chris Lattner 3dbad40341 fix pasto in the new (and still unused) ShuffleVectorInst::getShuffleMask method.
llvm-svn: 149005
2012-01-26 00:41:50 +00:00
Greg Clayton 690b034161 Fix page title.
llvm-svn: 149004
2012-01-26 00:32:22 +00:00
Eli Friedman 1da70394f6 Slight refactoring; catch yet another case where we were missing an lvalue-to-rvalue conversion.
llvm-svn: 149003
2012-01-26 00:26:18 +00:00
Johnny Chen 9ec3c4f5a7 For Dump(Stream *s), use GetOptionsNoCreate()->GetIgnoreCount() and fix the indentation.
llvm-svn: 149002
2012-01-26 00:08:14 +00:00
Fariborz Jahanian 0c859d67ef arc migrator: Added an option to the migrator
unused yet.

llvm-svn: 149001
2012-01-26 00:08:04 +00:00
Chris Lattner 154aabc0c4 add StructType helpers too.
llvm-svn: 149000
2012-01-26 00:06:44 +00:00
Chris Lattner 40a279e1c5 Ok, break down and add some cast<>'ing helper methods to the Type class
to reduce the number of cast<>'s we have.  This allows someone to use
things like Ty->getVectorNumElements() instead of 
cast<VectorType>(Ty)->getNumElements() when you know that a type is a
vector.

It would be a great general cleanup to move the codebase to use these,
I will do so in the code I'm touching.

llvm-svn: 148999
2012-01-26 00:01:10 +00:00
Chris Lattner 1dcb654311 add some helper methods to ShuffleVectorInst and enhance its
"isValidOperands" and "getMaskValue" methods to allow 
ConstantDataSequential.

llvm-svn: 148998
2012-01-25 23:49:49 +00:00
Ted Kremenek 8e4c4266de Rework flushing of diagnostics to PathDiagnosticConsumer. Now all the reports are batched up before being flushed
to the underlying consumer implementation.  This allows us to unique reports across analyses to multiple functions (which
shows up with inlining).

llvm-svn: 148997
2012-01-25 23:47:14 +00:00
Jakob Stoklund Olesen 4864a81aa3 Improve sub-register def handling in ProcessImplicitDefs.
This boils down to using MachineOperand::readsReg() more.

This fixes PR11829 where a use ended up after the first def when
lowering REG_SEQUENCE instructions involving IMPLICIT_DEFs.

llvm-svn: 148996
2012-01-25 23:36:27 +00:00
Eli Friedman 9562f39e2f Don't stack-allocate an IntegerLiteral which can be referred to after the current method returns. PR11744, part 2.
llvm-svn: 148995
2012-01-25 23:20:27 +00:00
Johnny Chen 29f7dff581 Typo.
llvm-svn: 148994
2012-01-25 23:08:23 +00:00
Argyrios Kyrtzidis e8be6652ce Revert r148981 because it fails test/Driver/freebsd.c
Original log:

Author: chandlerc <chandlerc@91177308-0d34-0410-b5e6-96231b3b80d8>
Date:   Wed Jan 25 21:32:31 2012 +0000

    Try to unbreak the FreeBSD toolchain's detection of 32-bit targets
    inside a 64-bit freebsd machine with the 32-bit compatibility layer
    installed. The FreeBSD image always has the /usr/lib32 directory, so
    test for the more concrete existence of crt1.o. Also enhance the tests
    for freebsd to clarify what these trees look like and exercise the new
    code.

    Thanks to all the FreeBSD folks for helping me understand what caused
    the failure and how we might fix it. =] That helps a lot. Also, yay
    build bots.

llvm-svn: 148993
2012-01-25 22:55:16 +00:00
Eli Friedman a98d1f8ca6 Add some ABI tweaks for i386-pc-win32 triple so that we return structs in an MSVC-compatible way. Patch by Joe Groff.
llvm-svn: 148992
2012-01-25 22:46:34 +00:00
Eli Friedman 04342eee52 Improve the error message slightly for files that aren't using the expected UTF-8 encoding. Patch by Seth Cantrell.
llvm-svn: 148991
2012-01-25 22:34:12 +00:00
Anton Korobeynikov 7722a2d4e3 Properly emit ctors / dtors with priorities into desired sections
and let linker handle the rest.

This finally fixes PR5329

llvm-svn: 148990
2012-01-25 22:24:19 +00:00
Eli Friedman f7f102f81a Fix a crash involving a multi-dimensional dependent VLA. PR11744.
llvm-svn: 148989
2012-01-25 22:19:07 +00:00
Ted Kremenek 807f7e38a9 Post open source analyzer build checker-259.
llvm-svn: 148988
2012-01-25 22:18:04 +00:00