Commit Graph

145203 Commits

Author SHA1 Message Date
Richard Smith c98bb4ed99 Handle _Pragma on a u8, u, or U string literal per the C11 specification. Also
handle raw string literals here. C++11 doesn't yet specify how they will
behave, but discussion on core suggests that we should just strip off
everything but the r-char-sequence.

llvm-svn: 176779
2013-03-09 23:30:15 +00:00
Craig Topper fa9888fce7 Remove an unused member variable from HelpPrinter. Move another member variable to be a local variable in the only method that uses it.
llvm-svn: 176778
2013-03-09 23:29:37 +00:00
Lang Hames be3d971143 Don't glue users to extract_subreg when selecting the llvm.arm.ldrexd
intrinsic - it can cause impossible-to-schedule subgraphs to be
introduced.

PR15053.

llvm-svn: 176777
2013-03-09 22:56:09 +00:00
Jakub Staszak 56436543b3 Remove unneeded cast.
llvm-svn: 176776
2013-03-09 19:34:14 +00:00
Benjamin Kramer 6eda79f69a Remove a source of nondeterminism from the LoopVectorizer.
This made us emit runtime checks in a random order. Hopefully bootstrap
miscompares will go away now.

llvm-svn: 176775
2013-03-09 19:22:40 +00:00
Benjamin Kramer d235d37d27 Remove unused diagnostic.
llvm-svn: 176774
2013-03-09 18:44:47 +00:00
Benjamin Kramer fc0c7bf0d7 Fix test case.
llvm-svn: 176773
2013-03-09 18:34:27 +00:00
Benjamin Kramer 01b75cc0f2 Test case hygiene.
llvm-svn: 176772
2013-03-09 18:25:40 +00:00
Jakub Staszak d6ca3c5ba5 Remove unneeded const_cast.
llvm-svn: 176771
2013-03-09 18:24:26 +00:00
Jakub Staszak 8adba50a40 Use forward declaration instead of #include.
llvm-svn: 176770
2013-03-09 18:05:34 +00:00
Arnold Schwaighofer 8b3dc09400 LoopVectorizer: Ignore all dbg intrinisic
Ignore all DbgIntriniscInfo instructions instead of just DbgValueInst.

llvm-svn: 176769
2013-03-09 16:27:27 +00:00
Arnold Schwaighofer 4090b61ac3 LoopVectorizer: Ignore dbg.value instructions
We want vectorization to happen at -g. Ignore calls to the dbg.value intrinsic
and don't transfer them to the vectorized code.

radar://13378964

llvm-svn: 176768
2013-03-09 15:56:34 +00:00
Benjamin Kramer 36f89ccc49 Make helper function static.
llvm-svn: 176767
2013-03-09 15:15:22 +00:00
Benjamin Kramer 160f72dc8e TLI: Microoptimize calls to strlen+memcmp to strncmp.
The strlen+memcmp was hidden in a call to StringRef::operator==. We check if
there are any null bytes in the string upfront so we can simplify the comparison
Small speedup when compiling code with many function calls.

llvm-svn: 176766
2013-03-09 13:48:23 +00:00
Jakub Staszak 2ef36b633b Simplify code. No functionality change.
llvm-svn: 176765
2013-03-09 11:18:59 +00:00
Nick Lewycky 291df6ec42 Use the correct index variable. This is the meat of what was supposed to be in
r176751. Also, learn a lesson about applying patches by hand/eyeball.

llvm-svn: 176764
2013-03-09 10:13:26 +00:00
Nick Lewycky 4288f9ef17 Commit the right files for r176762. Sigh.
llvm-svn: 176763
2013-03-09 09:32:16 +00:00
Nick Lewycky c1f9694d05 We need a shndx if the number of sections breaks SHN_LORESERVE. This condition
for choosing to emit a shndx was simply testing the wrong variable.

llvm-svn: 176762
2013-03-09 09:31:44 +00:00
Jason Molenda 252d6a385c Remove use of the ARMDisassembler framework from
DNBArchImplARM.  This framework is no longer around;
all armv7 devices support using hardware breakpoints
to instruction single step.

llvm-svn: 176761
2013-03-09 07:03:32 +00:00
Jason Molenda 03a00faae4 Also remove actual link against the ARMDisassembler framework from
debugserver's build settings.

llvm-svn: 176760
2013-03-09 06:19:31 +00:00
Jason Molenda cc526b797a We don't need to specify the VALID_ARCHS in the xcode project file.
Also, don't build debugserver with -DUSE_ARM_DISASSEMBLER_FRAMEWORK -
that framework isn't around at this point.

llvm-svn: 176759
2013-03-09 06:15:46 +00:00
Edwin Vane bdcd1350c1 Adding -final-syntax-check to cpp11-migrate user docs
llvm-svn: 176758
2013-03-09 03:38:20 +00:00
Edwin Vane e4e7c24efc Splitting cpp11-migrate transform docs into sub-pages
Each transform belongs in its own sub-page now. Minor refactoring to reflect
new heading levels.

llvm-svn: 176757
2013-03-09 03:33:50 +00:00
Anna Zaks 5497d1a55c [analyzer] Make Suppress IDC checker aware that it might not start from the same node it was registered at
The visitor used to assume that the value it’s tracking is null in the first node it examines. This is not true.
If we are registering the Suppress Inlined Defensive checks visitor while traversing in another visitor
(such as FindlastStoreVisitor). When we restart with the IDC visitor, the invariance of the visitor does
not hold since the symbol we are tracking no longer exists at that point.

I had to pass the ErrorNode when creating the IDC visitor, because, in some cases, node N is
neither the error node nor will be visible along the path (we had not finalized the path at that point
and are dealing with ExplodedGraph.)

We should revisit the other visitors which might not be aware that they might get nodes, which are
later in path than the trigger point.

This suppresses a number of inline defensive checks in JavaScriptCore.

llvm-svn: 176756
2013-03-09 03:23:19 +00:00
Anna Zaks ef89339986 [analyzer] Rename AttrNonNullChecker -> NonNullParamChecker
llvm-svn: 176755
2013-03-09 03:23:14 +00:00
Anna Zaks cdbca7ae77 [analyzer] Add test case for reference to null pointer param check
This tests that we track the original Expr if getDerefExpr fails.

llvm-svn: 176754
2013-03-09 03:23:10 +00:00
Greg Clayton 5a23444033 Remove my print statements I was using for debugging.
llvm-svn: 176753
2013-03-09 02:29:04 +00:00
Greg Clayton 0449678bce <rdar://problem/13384282>
As much as I hate to leave this hacky code in that adds some d and q registers to ARM registers, I must leave it in.

The code is now fixed to not just assume ANY arm target will have registers in a certain order. We now verify the common regs are the same name and byte size before adding the d and q regs.

llvm-svn: 176752
2013-03-09 02:19:08 +00:00
Nick Lewycky 03aed11cdb Fix bug introduced in r176616 when making function identifier numbers stable.
Count the subprograms, not the compile units.

llvm-svn: 176751
2013-03-09 02:06:37 +00:00
Sean Callanan 6c9265b07e Made LLDB work with the latest Clang. Also fixed
an assertion due to non-implicit Objective-C methods
without source locations.

llvm-svn: 176750
2013-03-09 01:59:31 +00:00
Michael J. Spencer 9b5e8da3b4 [Driver][GNU] Accept and ignore more options.
llvm-svn: 176749
2013-03-09 01:41:37 +00:00
Michael J. Spencer 52fdb8bf13 Fix (possible) MSVC miscompile in debug mode.
llvm-svn: 176748
2013-03-09 01:41:27 +00:00
Michael J. Spencer 2d224509af [Writer][ELF] Use correct data types for sizes. Fixes integer overflow bug.
This only happens when the section header count is > 1024.

llvm-svn: 176747
2013-03-09 01:41:16 +00:00
Nick Lewycky 593eeb000a Don't emit the extra checksum into the .gcda file if the user hasn't asked for
it. Fortunately, versions of gcov that predate the extra checksum also ignore 
any extra data, so this isn't a problem. This matches the API change made in
r176745.

llvm-svn: 176746
2013-03-09 01:33:12 +00:00
Nick Lewycky 88f1d0d64e Don't emit the extra checksum into the .gcda file if the user hasn't asked for
it. Fortunately, versions of gcov that predate the extra checksum also ignore
any extra data, so this isn't a problem. There will be a matching commit in
compiler-rt.

llvm-svn: 176745
2013-03-09 01:33:06 +00:00
Jordan Rose 613f3c0022 [analyzer] Be more consistent about Objective-C methods that free memory.
Previously, MallocChecker's pointer escape check and its post-call state
update for Objective-C method calls had a fair amount duplicated logic
and not-entirely-consistent checks. This commit restructures all this to
be more consistent and possibly allow us to be more aggressive in warning
about double-frees.

New policy (applies to system header methods only):
(1) If this is a method we know about, model it as taking/holding ownership
    of the passed-in buffer.
  (1a) ...unless there's a "freeWhenDone:" parameter with a zero (NO) value.
(2) If there's a "freeWhenDone:" parameter (but it's not a method we know
    about), treat the buffer as escaping if the value is non-zero (YES) and
    non-escaping if it's zero (NO).
(3) If the first selector piece ends with "NoCopy" (but it's not a method we
    know about and there's no "freeWhenDone:" parameter), treat the buffer
    as escaping.

The reason that (2) and (3) don't explicitly model the ownership transfer is
because we can't be sure that they will actually free the memory using free(),
and we wouldn't want to emit a spurious "mismatched allocator" warning
(coming in Anton's upcoming patch). In the future, we may have an idea of a
"generic deallocation", i.e. we assume that the deallocator is correct but
still continue tracking the region so that we can warn about double-frees.

Patch by Anton Yartsev, with modifications from me.

llvm-svn: 176744
2013-03-09 00:59:10 +00:00
John McCall e4c11cc7e5 Adjust the special non-C++ enum block return type inference
so that it looks through certain syntactic forms and applies
even if normal inference would have succeeded.

There is potential for source incompatibility from this
change, but overall we feel that it produces a much
cleaner and more defensible result, and the block
compatibility rules should curb a lot of the potential
for annoyance.

rdar://13200889

llvm-svn: 176743
2013-03-09 00:54:31 +00:00
John McCall 5ea9577016 Add TagDecl::hasNameForLinkage(), which is true if the tag
is non-anonymous or is defined in a typedef of itself.

llvm-svn: 176742
2013-03-09 00:54:27 +00:00
Jim Ingham 168d469a19 Fix a reversed test for "for_expression" in creating C++ exception breakpoints.
Add a missing "break" in processing the -h option to "breakpoint set".

llvm-svn: 176741
2013-03-09 00:48:58 +00:00
Jason Molenda c33136706d Fix assert in RegisterValue::SetBytes if we're trying to
write a 32-byte value into a 32-byte ymm vector reg - that 
is allowed.
<rdar://problem/13350587> 

llvm-svn: 176740
2013-03-09 00:04:17 +00:00
Fariborz Jahanian cfbac5d317 Documentation parsing. Some refactoring and code
improvements per Dmtiri's comments. // rdar://12379114

llvm-svn: 176739
2013-03-08 23:59:23 +00:00
Sean Callanan 83b3da95f6 Removed One Definition Rule warnings because they're
noisy when dealing with anonymous structs.

<rdar://problem/13246914>

llvm-svn: 176738
2013-03-08 23:38:53 +00:00
Jordan Rose bce0583627 [analyzer] Look for lvalue nodes when tracking a null pointer.
r176010 introduced the notion of "interesting" lvalue expressions, whose
nodes are guaranteed never to be reclaimed by the ExplodedGraph. This was
used in bugreporter::trackNullOrUndefValue to find the region that contains
the null or undef value being tracked.

However, the /rvalue/ nodes (i.e. the loads from these lvalues that produce
a null or undef value) /are/ still being reclaimed, and if we couldn't
find the node for the rvalue, we just give up. This patch changes that so
that we look for the node for either the rvalue or the lvalue -- preferring
the former, since it lets us fall back to value-only tracking in cases
where we can't get a region, but allowing the latter as well.

<rdar://problem/13342842>

llvm-svn: 176737
2013-03-08 23:30:56 +00:00
Jordan Rose 5ca395462e [analyzer] Don't rely on finding the correct return statement for suppression.
Previously, ReturnVisitor waited to suppress a null return path until it
had found the inlined "return" statement. Now, it checks up front whether
the return value was NULL, and suppresses the warning right away if so.

We still have to wait until generating the path notes to invalidate the bug
report, or counter-suppression will never be triggered. (Counter-suppression
happens while generating path notes, but the generation won't happen for
reports already marked invalid.)

This isn't actually an issue today because we never reclaim nodes for
top-level statements (like return statements), but it could be an issue
some day in the future. (But, no expected behavioral change and no new
test case.)

llvm-svn: 176736
2013-03-08 23:30:53 +00:00
Edwin Vane 3b9f08d6d0 Adding user documentation for UseAuto transform
Reviewers: silvas, gribozavr
llvm-svn: 176735
2013-03-08 23:26:00 +00:00
Jakob Stoklund Olesen 1001673865 Remove wrong and unnecessary assertion.
PHIs are allowed to have multiple operand pairs per predecessor, and
this code works just fine when it happens.

llvm-svn: 176734
2013-03-08 23:00:13 +00:00
Jan Wen Voung 7857a64909 Disable statistics on Release builds and move tests that depend on -stats.
Summary:
Statistics are still available in Release+Asserts (any +Asserts builds),
and stats can also be turned on with LLVM_ENABLE_STATS.

Move some of the FastISel stats that were moved under DEBUG()
back out of DEBUG(), since stats are disabled across the board now.

Many tests depend on grepping "-stats" output.  Move those into
a orig_dir/Stats/. so that they can be marked as unsupported
when building without statistics.

Differential Revision: http://llvm-reviews.chandlerc.com/D486

llvm-svn: 176733
2013-03-08 22:56:31 +00:00
Argyrios Kyrtzidis 51c3318b01 [libclang] Change clang_findReferencesInFile and clang_findIncludesInFile to return an enum,
as suggested by Jordan.

llvm-svn: 176732
2013-03-08 22:47:41 +00:00
Douglas Gregor f9b76cd8b5 <rdar://problem/13170740> Be a little more careful when instantiating 'this' expressions.
llvm-svn: 176731
2013-03-08 22:43:48 +00:00
Jan Wen Voung 058927b8d4 Move clang tests that depend on llvm/ADT/Statistic.h to a subdir.
The subdirectory has a lit.local.cfg that marks the tests unsupported
if llvm was built without Asserts.  There will be a patch in LLVM
that disables statistics gathering when built without Asserts so
that full Release builds can be faster.  Statistics can also
be enabled by building with -DLLVM_ENABLE_STATS.

llvm-svn: 176730
2013-03-08 22:42:02 +00:00