Commit Graph

131317 Commits

Author SHA1 Message Date
Manuel Klimek 3aad855a89 Fixes a segfault in Tooling when using pch's:
Clear the FileManager's stat cache in between running
translation units, as the stat cache loaded from a pch
is only valid for one compiler invocation.

llvm-svn: 161047
2012-07-31 13:56:54 +00:00
Alexander Potapenko 8aae9557d6 Factor out the main() function.
llvm-svn: 161046
2012-07-31 13:51:26 +00:00
Alexey Samsonov 500e99639d [Sanitizer] Wrapper around llvm::DIContext from LLVM DebugInfo library. If a macro SANITIZER_USES_LLVM_LIBS is defined (by default it is not), then sanitizer runtime includes llvm headers and tries to use LLVM libs for in-process symbolization. To make it functional, we have to link with these LLVM libs - either pass them to linker from Clang driver, or link them into static ASan runtime when we build it.
llvm-svn: 161045
2012-07-31 11:51:26 +00:00
Benjamin Kramer 1bbcbd0187 Remove deprecated getNameAsCString methods.
llvm-svn: 161044
2012-07-31 11:45:39 +00:00
Jiangning Liu 5007bb6c0b Add two more .keep files to avoid the missing of empty folders in git repository.
llvm-svn: 161043
2012-07-31 10:52:55 +00:00
Jiangning Liu 43f37dca77 Add two .keep files to avoid the missing of empty folders in git repository.
llvm-svn: 161042
2012-07-31 10:24:27 +00:00
Chandler Carruth 94ed210702 Implement copy and move assignment for TinyPtrVector. These try to
re-use allocated vectors as much as possible.

llvm-svn: 161041
2012-07-31 09:42:24 +00:00
Alexander Kornienko 4de035947b Added -ast-list option to dump filterable AST decl node names.
llvm-svn: 161040
2012-07-31 09:37:40 +00:00
Jiangning Liu 61b06cbcb4 Support ARM hard float (arm-linux-gnueabihf).
llvm-svn: 161038
2012-07-31 08:06:29 +00:00
Sylvestre Ledru ef7d8295b6 Fix some minor typos
llvm-svn: 161037
2012-07-31 07:05:57 +00:00
Sylvestre Ledru a5202660fb Fix some minor typos
llvm-svn: 161036
2012-07-31 06:56:50 +00:00
Manuel Klimek 4b7740a9fe Document the result type of the matcher functions where
it's not obvious from the source code.

llvm-svn: 161035
2012-07-31 06:28:58 +00:00
Craig Topper 9caea12bd8 Use uint8_t to store the InstructionContext table. Saves 768 bytes of static data.
llvm-svn: 161034
2012-07-31 06:15:39 +00:00
Craig Topper 6f142746e7 Tidy up. Move for loop index declarations into for statements. Use unsigned instead of uint16_t for loop indices. Use unsigned instead of uint32_t for arguments to raw_ostream.indent.
llvm-svn: 161033
2012-07-31 06:02:05 +00:00
Craig Topper b61024cfcc Tidy up function argument formatting.
llvm-svn: 161032
2012-07-31 05:42:02 +00:00
Craig Topper 347e8cf3b7 Remove trailing whitespace
llvm-svn: 161031
2012-07-31 05:28:41 +00:00
Craig Topper 0c4253fe29 Remove trailing whitespace
llvm-svn: 161030
2012-07-31 05:27:01 +00:00
Craig Topper c2efce404e Make INSTRUCTION_SPECIFIER_FIELDS match X86DisassemblerCommon.h. Also remove trailing whitespace.
llvm-svn: 161029
2012-07-31 05:18:26 +00:00
John McCall f253834456 Introduce new queries on ObjCRuntime for how to interpret subscripts
on object pointers and whether pointer arithmetic on object pointers
is supported.  Make ObjFW interpret subscripts as pseudo-objects.
Based on a patch by Jonathan Schleifer.

llvm-svn: 161028
2012-07-31 05:14:30 +00:00
Craig Topper fb39f97d4c Tidy up trailing whitespace
llvm-svn: 161027
2012-07-31 04:58:05 +00:00
Craig Topper 5f33d90214 Tidy up trailing whitespace
llvm-svn: 161026
2012-07-31 04:38:27 +00:00
Chandler Carruth c0b8a0c216 Clean up trailing whitespace and unnecessary blank lines.
llvm-svn: 161025
2012-07-31 04:13:57 +00:00
Chandler Carruth a565375a18 Bring TinyPtrVector under test. Somehow we never picked up unit tests
for this class. These tests exercise most of the basic properties, but
the API for TinyPtrVector is very strange currently. My plan is to start
fleshing out the API to match that of SmallVector, but I wanted a test
for what is there first.

Sadly, it doesn't look reasonable to just re-use the SmallVector tests,
as this container can only ever store pointers, and much of the
SmallVector testing is to get construction and destruction right.

Just to get this basic test working, I had to add value_type to the
interface.

While here I found a subtle bug in the combination of 'erase', 'begin',
and 'end'. Both 'begin' and 'end' wanted to use a null pointer to
indicate the "end" iterator of an empty vector, regardless of whether
there is actually a vector allocated or the pointer union is null.
Everything else was fine with this except for erase. If you erase the
last element of a vector after it has held more than one element, we
return the end iterator of the underlying SmallVector which need not be
a null pointer. Instead, simply use the pointer, and poniter + size()
begin/end definitions in the tiny case, and delegate to the inner vector
whenever it is present.

llvm-svn: 161024
2012-07-31 02:48:31 +00:00
Jakob Stoklund Olesen 0c807dfae2 Clear kill flags in removeCopyByCommutingDef().
We are extending live ranges, so kill flags are not accurate. They
aren't needed until they are recomputed after RA anyway.

<rdar://problem/11950722>

llvm-svn: 161023
2012-07-31 02:47:24 +00:00
Rafael Espindola 06b2b4a7c9 Handle functions with struct arguments or return types and the regparm
attribute. It is a variation of the x86_64 ABI:

* A struct returned indirectly uses the first register argument to pass the
  pointer.
* Floats, Doubles and structs containing only one of them are not passed in
  registers.
* Other structs are split into registers if they fit on the remaining ones.
  Otherwise they are passed in memory.
* When a struct doesn't fit it still consumes the registers.

llvm-svn: 161022
2012-07-31 02:44:24 +00:00
Jordan Rose 3865c6e670 [analyzer] Add a test that messages to super invalidate ivars.
llvm-svn: 161021
2012-07-31 02:05:30 +00:00
Rafael Espindola 74ec5c03ca Attributes preceding a function declaration are first applied to the return
type and then propagated to the function. This was failing for destructors,
constructors and constructors templates since they don't have a return type.

Fix that by directly calling processTypeAttrs on the dummy type we use as the
return type in these cases.

llvm-svn: 161020
2012-07-31 01:54:04 +00:00
Aaron Ballman 1f10cc5eb4 No longer emitting a PCH file when using -fsyntax-only on a header file. Fixes PR13343.
llvm-svn: 161019
2012-07-31 01:21:00 +00:00
Manman Ren 2b6a0dfd4c Reverse order of the two branches at end of a basic block if it is profitable.
We branch to the successor with higher edge weight first.
Convert from
     je    LBB4_8  --> to outer loop
     jmp   LBB4_14 --> to inner loop
to
     jne   LBB4_14
     jmp   LBB4_8

PR12750
rdar: 11393714

llvm-svn: 161018
2012-07-31 01:11:07 +00:00
Jordan Rose 42e8d6497d [analyzer] Let CallEvent decide what goes in an inital stack frame.
This removes explicit checks for 'this' and 'self' from
Store::enterStackFrame. It also removes getCXXThisRegion() as a virtual
method on all CallEvents; it's now only implemented in the parts of the
hierarchy where it is relevant. Finally, it removes the option to ask
for the ParmVarDecls attached to the definition of an inlined function,
saving a recomputation of the result of getRuntimeDefinition().

No visible functionality change!

llvm-svn: 161017
2012-07-31 01:07:55 +00:00
Jordan Rose 4502b53c3b Explain why ACC_bottom should never occur in diagnosing ARC casts.
This is just a clarification on Fariborz's original patch, per e-mail
discussion. No functionality change.

llvm-svn: 161016
2012-07-31 01:07:43 +00:00
Douglas Gregor 721b14d1b3 When we encounter a code-completion token while parsing an ill-formed
lambda-introducer in Objective-C++11, fall back to treating the tokens
as an Objective-C message send to provide those (more likely)
completions. Fixes <rdar://problem/11980263>.

llvm-svn: 161015
2012-07-31 00:50:07 +00:00
John McCall ff755cda9c Don't crash *or* insert a bogus autorelease when emitting a
this-adjustment thunk in ARC++.

llvm-svn: 161014
2012-07-31 00:33:55 +00:00
Greg Clayton 9d192e1a90 <rdar://problem/11620586>
Fixed an issue where warning logs were causing a crash.

llvm-svn: 161013
2012-07-31 00:31:32 +00:00
Anna Zaks 5808eb8029 [analyzer] Handle inlining of instance calls to super.
Use self-init.m for testing. (It used to have a bunch of failing tests
with dynamic inlining turned on.)

llvm-svn: 161012
2012-07-30 23:48:36 +00:00
Anna Zaks 160dcdf2d6 [analyzer] Only run this test with no IPA
The inlinable portion of the test relies on attributes/instead of the
function implementation.

llvm-svn: 161011
2012-07-30 23:48:31 +00:00
Andrew Trick 79795897b3 Use the latest MachineRegisterInfo APIs. No functionality.
llvm-svn: 161010
2012-07-30 23:48:17 +00:00
Andrew Trick 79df0de4fc Added MachineRegisterInfo::hasOneDef()
llvm-svn: 161009
2012-07-30 23:48:14 +00:00
Richard Smith 7f78227ce9 PR13479: If we see the definition of an out-of-line destructor in C++11, be
sure to update the exception specification on the declaration as well as the
definition. If we're building in -fno-exceptions mode, nothing else will
trigger it to be updated.

llvm-svn: 161008
2012-07-30 23:48:14 +00:00
Andrew Trick 535a23c38b Inline MachineRegisterInfo::hasOneUse
llvm-svn: 161007
2012-07-30 23:48:12 +00:00
Chandler Carruth e9cdc7f0d8 Extend the InstVisitor to visit the specialized classes wrapping
CallInst for intrinsics. This allows users of the InstVisitor that would
like to special case certain very common intrinsics to do so naturally
in keeping with the type hierarchy's utility classes.

llvm-svn: 161006
2012-07-30 23:45:06 +00:00
Jordan Rose c2d249ce2c [analyzer] Perform post-call checks for all inlined calls.
Previously, we were only checking the origin expressions of inlined calls.
Checkers using the generic postCall and older postObjCMessage callbacks were
ignored. Now that we have CallEventManager, it is much easier to create
a CallEvent generically when exiting an inlined function, which we can then
use for post-call checks.

No test case because we don't (yet) have any checkers that depend on this
behavior (which is why it hadn't been fixed before now).

llvm-svn: 161005
2012-07-30 23:39:47 +00:00
Jakob Stoklund Olesen 68c2cd059e Avoid looking at stale data in verifyAnalysis().
llvm-svn: 161004
2012-07-30 23:15:12 +00:00
Jakob Stoklund Olesen c14cf57ba9 Allow traces to enter nested loops.
This lets traces include the final iteration of a nested loop above the
center block, and the first iteration of a nested loop below the center
block.

We still don't allow traces to contain backedges, and traces are
truncated where they would leave a loop, as seen from the center block.

llvm-svn: 161003
2012-07-30 23:15:10 +00:00
Jim Grosbach 20666162e9 Keep empty assembly macro argument values in the middle of the list.
Empty macro arguments at the end of the list should be as-if not specified at
all, but those in the middle of the list need to be kept so as not to screw
up the positional numbering. E.g.:
.macro foo
foo_-bash___:
  nop
.endm

foo 1, 2, 3, 4
foo 1, , 3, 4

Should create two labels, "foo_1_2_3_4" and "foo_1__3_4".

rdar://11948769

llvm-svn: 161002
2012-07-30 22:44:17 +00:00
Chandler Carruth 0b01261cb0 Move the SmallVector unit tests to be type-parameterized so that we can
test more than a single instantiation of SmallVector.

Add testing for 0, 1, 2, and 4 element sized "small" buffers. These
appear to be essentially untested in the unit tests until now.

Fix several tests to be robust in the face of a '0' small buffer. As
a consequence of this size buffer, the growth patterns are actually
observable in the test -- yes this means that many tests never caused
a grow to occur before. For some tests I've merely added a reserve call
to normalize behavior. For others, the growth is actually interesting,
and so I captured the fact that growth would occur and adjusted the
assertions to not assume how rapidly growth occured.

Also update the specialization for a '0' small buffer length to have all
the same interface points as the normal small vector.

llvm-svn: 161001
2012-07-30 22:17:52 +00:00
Greg Clayton 9b5450f6c9 Don't set the thread when adopting selected execution context entries, and use the "lldb_private::StateIsStoppedState(StateType, bool)" function to tell if the state is stopped.
llvm-svn: 161000
2012-07-30 22:05:39 +00:00
Richard Smith 711ceba5ab Extend the ',' versus ';' diagnostic for -Wvexing-parse to cover the with-arguments case as well as the no-arguments case.
llvm-svn: 160999
2012-07-30 21:42:05 +00:00
Richard Smith 943c440455 Improvements to vexing-parse warnings. Make the no-parameters case more
accurate by asking the parser whether there was an ambiguity rather than trying
to reverse-engineer it from the DeclSpec. Make the with-parameters case have
better diagnostics by using semantic information to drive the warning,
improving the diagnostics and adding a fixit.

Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for
declarations of the form 'T (*x)(...)', which seem to have a very high false
positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'.

llvm-svn: 160998
2012-07-30 21:30:52 +00:00
Jakob Stoklund Olesen 984cfe8322 Clarify invalidation strategy in comment.
llvm-svn: 160997
2012-07-30 21:16:22 +00:00