Commit Graph

213654 Commits

Author SHA1 Message Date
Craig Topper a6324c9463 Disable trigraph and escaped newline expansion on all types of raw string literals not just ASCII type.
llvm-svn: 251025
2015-10-22 15:35:21 +00:00
Rafael Espindola e015f66a73 Avoid hash lookups when finalizing StringTableBuilder. NFC.
llvm-svn: 251024
2015-10-22 15:26:35 +00:00
Rafael Espindola 0169a45e04 Use array_pod_sort. NFC.
llvm-svn: 251023
2015-10-22 15:15:44 +00:00
Benjamin Kramer 9bccaa158a [Tooling] Add a utility function to replace one nested name with another.
One problem in clang-tidy and other clang tools face is that there is no
way to lookup an arbitrary name in the AST, that's buried deep inside Sema
and might not even be what the user wants as the new name may be freshly
inserted and not available in the AST.

A common use case for lookups is replacing one nested name with another
while minimizing namespace qualifications, so replacing 'ns::foo' with
'ns::bar' will use just 'bar' if we happen to be inside the namespace 'ns'.
This adds a little helper utility for exactly that use case.

Differential Revision: http://reviews.llvm.org/D13931

llvm-svn: 251022
2015-10-22 15:04:10 +00:00
Manuel Klimek 8f9e444061 Switch check_clang_tidy to argparse and add a -resource-dir argument.
-resource-dir can be used to inject non-standard resource dirs via the
lit site config.

llvm-svn: 251021
2015-10-22 14:54:50 +00:00
Pirama Arumuga Nainar 5884a1f5a6 Fix incorrect target triple in fp16-promote.ll
Summary:
Hyphens were missing from the triple, causing it to be parsed
incorrectly.  This patch updates the triple and makes necessary
changes to the expected output.

Patch is from Vinicius Tinti.

Reviewers: ab, tinti

Subscribers: srhines, llvm-commits

Differential Revision: http://reviews.llvm.org/D13792

llvm-svn: 251020
2015-10-22 14:15:00 +00:00
Daniel Sanders 9e19817870 [mips][mips16] Fix typo in FileCheck directive.
llvm-svn: 251019
2015-10-22 14:01:52 +00:00
Asaf Badouh 7c52245660 [X86][AVX512] extend vcvtph2ps to support xmm/ymm and sae versions
Differential Revision: http://reviews.llvm.org/D13945

llvm-svn: 251018
2015-10-22 14:01:16 +00:00
James Molloy 5b2a732fac [GlobalsAA] Loosen an overly conservative bailout
Instead of bailing out when we see loads, analyze them. If we can prove that the loaded-from address must escape, then we can conclude that a load from that address must escape too and therefore cannot alias a non-addr-taken global.

When checking if a Value can alias a non-addr-taken global, if the Value is a LoadInst of a non-global, recurse instead of bailing.

If we can follow a trail of loads up to some base that is captured, we know by inference that all the loads we followed are also captured.

llvm-svn: 251017
2015-10-22 13:44:26 +00:00
James Molloy 5a4d8cd519 [BasicAA] Non-equal indices in a GEP of a SequentialType don't overlap
If the final indices of two GEPs can be proven to not be equal, and
the GEP is of a SequentialType (not a StructType), then the two GEPs
do not alias.

llvm-svn: 251016
2015-10-22 13:28:18 +00:00
Angel Garcia Gomez d8336f3af5 Don't use "auto" on loops over fundamental types in modernize-loop-convert.
Summary: using "auto" on a loop that iterates over ints is kind of an overkill. Use the real type name instead.

Reviewers: klimek

Subscribers: alexfh, cfe-commits

Differential Revision: http://reviews.llvm.org/D13982

llvm-svn: 251015
2015-10-22 13:23:46 +00:00
Gabor Horvath b89658f649 Attempt to fix build bot test failures.
llvm-svn: 251014
2015-10-22 13:23:18 +00:00
Angel Garcia Gomez 37ab7fda4c Correctly print the type in modernize-make-unique.
Summary: Take into account the current LangOptions the check has to add back the template argument.

Reviewers: klimek

Subscribers: alexfh, cfe-commits

Differential Revision: http://reviews.llvm.org/D13983

llvm-svn: 251013
2015-10-22 13:20:49 +00:00
James Molloy 1d88d6f289 [ValueTracking] Add a new predicate: isKnownNonEqual()
isKnownNonEqual(A, B) returns true if it can be determined that A != B.

At the moment it only knows two facts, that a non-wrapping add of nonzero to a value cannot be that value:

A + B != A [where B != 0, addition is nsw or nuw]

and that contradictory known bits imply two values are not equal.

This patch also hooks this up to InstSimplify; InstSimplify had a peephole for the first fact but not the second so this teaches InstSimplify a new trick too (alas no measured performance impact!)

llvm-svn: 251012
2015-10-22 13:18:42 +00:00
Gabor Horvath efec16307c [analyzer] Bug identification
This patch adds hashes to the plist and html output to be able to identfy bugs
for suppressing false positives or diff results against a baseline. This hash
aims to be resilient for code evolution and is usable to identify bugs in two
different snapshots of the same software. One missing piece however is a 
permanent unique identifier of the checker that produces the warning. Once that
issue is resolved, the hashes generated are going to change. Until that point
this feature is marked experimental, but it is suitable for early adoption.

Differential Revision: http://reviews.llvm.org/D10305 

Original patch by: Bence Babati!

llvm-svn: 251011
2015-10-22 11:53:04 +00:00
Manuel Klimek b91bee06de Add %check_clang_tidy and %clang_tidy_diff.
With this, site specific lit configs can inject parameters into the
test scripts if they need site specific parameters.

Next up: enable check_clang_tidy to take a resource dir to enable
non-standard locations for builtin includes.

llvm-svn: 251010
2015-10-22 11:31:44 +00:00
Benjamin Kramer fbfa7a1e14 [AST] Remove redundant template keywords.
GCC complains about them, clang does not.

llvm-svn: 251009
2015-10-22 11:26:35 +00:00
Benjamin Kramer 8e4a17634f [AST] Store Decl* and Stmt* directly into the ParentMap.
These are by far the most common types to be parents in the AST so it makes
sense to optimize for them. Put them directly into the value of the map.
This currently saves 32 bytes per parent in the map and a pointer
indirection at the cost of some additional complexity in the code.

Sadly this means we cannot return an ArrayRef from getParents anymore, add
a proxy class that can own a single DynTypedNode and otherwise behaves
exactly the same as ArrayRef.

For example on a random large file (X86ISelLowering.cpp) this reduces the
size of the parent map by 24 MB.

Differential Revision: http://reviews.llvm.org/D13976

llvm-svn: 251008
2015-10-22 11:21:40 +00:00
Tamas Berghammer 90b4dcecb1 Make SymbolFileDWARF::GetCachedSectionData thread safe
Differential revision: http://reviews.llvm.org/D13942

llvm-svn: 251007
2015-10-22 11:14:37 +00:00
Tamas Berghammer ac47b6e091 Fix some race condition in ConstString around Mangled name handling
Differential revision: http://reviews.llvm.org/D13941

llvm-svn: 251006
2015-10-22 11:14:31 +00:00
Angel Garcia Gomez 146b96dfcb Make string constants in the modernize module static.
Summary: Add static to global variables, if they are not in an anonymous namespace.

Reviewers: klimek

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D13975

llvm-svn: 251005
2015-10-22 09:48:23 +00:00
Pavel Labath 31bcd2bddd [AppleObjCRuntime] Don't bother looking for the runtime on non-apple targets
Summary:
This short-circuits the GetObjCVersion function to avoid iterating through target modules on
non-apple targets. This function is called on every Process::IsDynamicValue call, so this
overhead is not negligible.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13948

llvm-svn: 251004
2015-10-22 09:34:40 +00:00
Ewan Crawford 02f1c5d132 [RenderScript] Support for mips64 runtime hook
Previously we could not hook the RS runtime on mips64 architectures.

Patch implements ABI specific code for inspecting function arguments.

Author: Dean De Leo, dean@codeplay.com
llvm-svn: 251003
2015-10-22 09:01:05 +00:00
Igor Kudrin 0cb1561e42 Fix the buildbot.
test/elf2/gnu-hash-table.s requires ppc target support to run.

llvm-svn: 251002
2015-10-22 08:58:03 +00:00
Manuel Klimek f80abb9ec7 Fix add_llvm_external_project.
r250835 unintentionally discarded the optional parameter to the
add_llvm_external_project() macro that may point to a path when the said
path is different from ${name}. This should fix it by passing ${ARGN} on
to add_llvm_subdirectory(). The problem manifests itself with e.g.
add_llvm_external_project(clang-tools-extra extra) from
clang/tools/CMakeLists.txt

Patch by Luchesar V. Iliev.

llvm-svn: 251001
2015-10-22 08:31:46 +00:00
Igor Kudrin 1b0d7066ff [ELF2] Add support for GNU Hash section
This patch implements --hash-style command line switch.

* By default, or with "sysv" or "both" parameters, the linker generates
  a standard ELF hash section.
* With "gnu" or "both", it produces a GNU-style hash section.

That section requires the symbols in the dynamic symbol table section, which
are referenced in the GNU hash section, to be placed after not hashed ones and
to be sorted to correspond the order of hash buckets in the GNU Hash section.

The division function, as well as estimations for the section's parameters,
are just the first rough attempt and the subjects for further adjustments.

Differential Revision: http://reviews.llvm.org/D13815

llvm-svn: 251000
2015-10-22 08:21:35 +00:00
Pawel Bylica 64d08ff034 Use range-based for loop in sys::path::append(). NFC.
llvm-svn: 250999
2015-10-22 08:12:15 +00:00
Yury Gribov 8da1408277 [asan] Get rid of UB in string tests. Patch by Max Ostapenko.
Differential revision: http://reviews.llvm.org/D13895

llvm-svn: 250998
2015-10-22 08:10:56 +00:00
David Majnemer ee6c4094a0 [MS ABI] Mangle static anonymous unions
We believed that internal linkage variables at global scope which are
not variable template specializations did not have to be mangled.

However, static anonymous unions have no identifier and therefore must
be mangled.

This fixes PR18204.

llvm-svn: 250997
2015-10-22 07:15:56 +00:00
Elena Demikhovsky 5c97dfdc9c AVX-512: Fixed a bug in select_cc for i1 type
Fixed faiure:
LLVM ERROR: Cannot select: t33: i1 = select_cc t25, Constant:i32<0>, t45, t42, seteq:ch

added a test

Differential Revision: http://reviews.llvm.org/D13943

llvm-svn: 250996
2015-10-22 07:10:29 +00:00
Elena Demikhovsky 7ad0d563a5 Partially reverted changes from r250686
Clang runtime failure was reported.
   Assertion failed: (isExtended() && "Type is not extended!"), function getTypeForEVT
I'll need to add a proper handling for PointerType in masked load/store intrinsics.

llvm-svn: 250995
2015-10-22 06:20:29 +00:00
Xinliang David Li 69306c0823 clang driver toolchain refactoring
In this patch, the file static method addProfileRT is
moved to be a virtual member function of base ToolChain class.
This allows derived toolchain to override the default behavior
easily and make it consistent with Darwin toolchain (a TODO was
added for this refactoring - now removed). A new helper method
is also introduced to test if instrumentation profile option
is turned on or not.

Differential Revision: http://reviews.llvm.org/D13326

llvm-svn: 250994
2015-10-22 06:15:31 +00:00
Richard Smith cfd53b4e99 [coroutines] Initial stub Sema functionality for handling coroutine await / yield / return.
llvm-svn: 250993
2015-10-22 06:13:50 +00:00
Richard Smith f8bdb0a9e4 [coroutines] Add forgotten test for lexing coroutines keywords.
llvm-svn: 250992
2015-10-22 05:21:12 +00:00
Richard Smith 9be594e36d [coroutines] Add overloaded unary 'operator co_await'.
llvm-svn: 250991
2015-10-22 05:12:22 +00:00
Craig Topper 0f723bb90b Convert ActOnForwardProtocolDeclaration to take an ArrayRef and use a range-based for loop. NFC
llvm-svn: 250990
2015-10-22 05:00:01 +00:00
Craig Topper b5518246b2 Use an ArrayRef<OffsetOfComponent> instead of pointer and size throughout offsetof handling code. Also use a range-based for loop. NFC
llvm-svn: 250989
2015-10-22 04:59:59 +00:00
Craig Topper a9247eb2b1 Change FindProtocolDeclaration to take an ArrayRef and use a range-based for loop. NFC
llvm-svn: 250988
2015-10-22 04:59:56 +00:00
Craig Topper d96b3f9b2a Change MacroInfo::setArgumentList to take an ArrayRef instead of pointer and size. While there use std::copy intead of a manual loop.
llvm-svn: 250987
2015-10-22 04:59:52 +00:00
NAKAMURA Takumi 6025991fa9 clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-vararg.cpp: Tweak not to depend on out-of-tree header <cstdarg>.
llvm-svn: 250986
2015-10-22 04:51:47 +00:00
Richard Smith 0e304ea8a1 [coroutines] Add parsing support for co_await expression, co_yield expression,
co_await modifier on range-based for loop, co_return statement.

llvm-svn: 250985
2015-10-22 04:46:14 +00:00
Richard Smith 629aaaf143 [coroutines] Fix description of LangOption for coroutines.
llvm-svn: 250984
2015-10-22 04:42:51 +00:00
NAKAMURA Takumi 05063bd4cb clang-tools-extra/test/clang-tidy/modernize-use-default.cpp: Appease MS mode.
llvm-svn: 250983
2015-10-22 04:32:21 +00:00
Richard Smith 3fa73f3602 [coroutines] Add feature-test macro for coroutines, defined to 1 to indicate
the implementation is incomplete.

llvm-svn: 250982
2015-10-22 04:27:47 +00:00
Jason Molenda 76a2d615ad Move the launch-as-root xpc service from lldb to xcode, to
make it easier to run hand-built lldb roots and retain those
entitlements.  This is currently only used by Xcode; command
line lldb doesn't expose the SBLaunchInfo::SetUserID()
launch option.

<rdar://problem/23154486> 

llvm-svn: 250981
2015-10-22 04:17:26 +00:00
Richard Smith eb7927ee8f [coroutines] Add lexer support for co_await, co_yield, and co_return keywords.
Add -fcoroutines flag (just for -cc1 for now) to enable the feature. Early
indications are that this will be part of -std=c++1z.

llvm-svn: 250980
2015-10-22 03:52:15 +00:00
Jason Molenda 9c077cf33d Change ModuleList::GetSharedModule so that it will reject "stub
libraries" altogether.  On Mac/iOS, these are libraries which have
a UUID and nlist records but no text or data.  If one of these
gets into the global module list, every time we try to search
for a given filename/arch/UUID, we'll get this stub library back.
We need to prevent them from getting added to the module list
altogether.

I thought about doing this down in ObjectFileMachO -- just rejecting
the file as a valid binary file altogether -- but Greg didn't want
to take that hard line approach at this point, he wanted to keep
the ability for lldb to read one of these if someone wanted to in
the future.

<rdar://problem/23035075> 

llvm-svn: 250979
2015-10-22 03:50:28 +00:00
Jason Molenda 75f96bcfc4 Add some verbose lldb host logging so lldb will show what SDK
directories it is searching for files.

llvm-svn: 250978
2015-10-22 03:44:51 +00:00
Craig Topper a2a8d9cb0a Fix a couple places where InsertText was being called with a pointer and size when it really expects a StringRef and a normally optional bool argument.
The pointer was being implicitly converted to a StringRef and the size was being passed into the bool. Since the bool has a default value normally, no one noticed that the wrong number of arguments was given.

llvm-svn: 250977
2015-10-22 03:13:10 +00:00
Craig Topper cf2126e2ca Pass an ArrayRef instead of pointer and size. NFC
llvm-svn: 250976
2015-10-22 03:13:07 +00:00