Commit Graph

41617 Commits

Author SHA1 Message Date
Alexey Bataev d14d1e6f25 [OPENMP 4.1] Add 'simd' clause for 'ordered' directive.
Parsing and sema analysis for 'simd' clause in 'ordered' directive.
Description
If the simd clause is specified, the ordered regions encountered by any thread will use only a single SIMD lane to execute the ordered
regions in the order of the loop iterations.
Restrictions
An ordered construct with the simd clause is the only OpenMP construct that can appear in the simd region

llvm-svn: 248696
2015-09-28 06:39:35 +00:00
Craig Topper c005cc06cd Use llvm::makeArrayRef. NFC.
llvm-svn: 248678
2015-09-27 03:44:08 +00:00
Craig Topper 19e1261043 Revert part of r248660 as using None didn't work with the ArrayRef being returned as an Optional.
llvm-svn: 248661
2015-09-26 05:42:17 +00:00
Craig Topper 5b7183551f Use None to avoid re-mentioning the ArrayRef type to call the default constructor.
llvm-svn: 248660
2015-09-26 05:22:17 +00:00
Craig Topper f36a5c4af7 Remove move constructor and assignment operator from SourceMappingRegion. The types of the fields are trivially copyable. NFC
llvm-svn: 248659
2015-09-26 05:10:16 +00:00
Craig Topper 462c77b40c Fix a couple other places that were returning SourceLocation by reference. NFC
llvm-svn: 248658
2015-09-26 05:10:14 +00:00
Saleem Abdulrasool d44901f21b Driver: support ARM/HF on a single toolchain
ARM EABI adds target attributes to the object file.  Amongst the attributes that
are emitted is the VFP argument passing (Hard vs Soft).  The linker is
responsible for checking these attributes and erroring on mismatches.  This
causes problems for the compiler-rt builtins when targeting both hard and
soft.  Because both of these options name the builtins compiler-rt component
the same (libclang_rt.builtins-arm.a or libclang_rt.builtins-arm-android).  GCC
is able to get away with this as it does one target per toolchain.  This
changes the naming convention for the ARM compiler-rt builtins to differentiate
between HF and Soft.  Although this means that compiler-rt may be duplicated, it
enables supporting both variants from a single toolchain.  A similar approach is
taken by the Darwin toolchain, naming the library to differentiate between the
calling conventions.

llvm-svn: 248649
2015-09-26 03:26:44 +00:00
Eric Christopher 583a1f72c7 Replace a loop and temporary string copying with llvm::join.
llvm-svn: 248645
2015-09-26 01:25:08 +00:00
George Burgess IV aea6ade63a Make incomplete type errors better with enable_if
This patch fixes the order in which we evaluate the different ways that
a function call could be disallowed. Now, if you call a non-overloaded
function with an incomplete type and failing enable_if, we'll prioritize
reporting the more obvious error (use of incomplete type) over reporting
the failing enable_if.

Thanks to Ettore Speziale for the patch!

llvm-svn: 248595
2015-09-25 17:53:16 +00:00
Eric Christopher 74a7c5dc16 The Clang gcc-compatible driver (clang/tools/driver/driver.cpp) has some
logic to select an alternate target based on the executable it was
called as. For instance, if you symlink i686-linux-android-gcc to clang
and invoke it, the driver will act as though it were called with another
argument ("-target i686-linux-android"). This leads to visible effects
even in syntax-only compilations (like the ANDROID preprocessor symbol
being defined).

This behavior is not replicated for tool invocations--for instance,
clang::createInvocationFromCommandLine will not choose an alternate
target based on ArgList[0]. This means that configurations stored in
compilation databases aren't accurately replayed.

This patch separates the logic for selecting a mode flag and target from
the executable name into a new member function on ToolChain. It should
have no functional effects (but will allow other code to reuse the
target/mode selection logic).

Patch by Luke Zarko!

llvm-svn: 248592
2015-09-25 17:44:31 +00:00
Greg Bedwell 80b325c799 Revert "This patch adds missing pieces to clang, including the PS4 toolchain definition, added warnings, PS4 defaults, and Driver changes needed for our compiler."
This reverts commit r248546 to get our bot green again while we discuss the best way forward.

llvm-svn: 248578
2015-09-25 16:11:00 +00:00
Alexey Bataev 346265e3bc [OPENMP 4.1] Add 'threads' clause for '#pragma omp ordered'.
OpenMP 4.1 extends format of '#pragma omp ordered'. It adds 3 additional clauses: 'threads', 'simd' and 'depend'.
If no clause is specified, the ordered construct behaves as if the threads clause had been specified. If the threads clause is specified, the threads in the team executing the loop region execute ordered regions sequentially in the order of the loop iterations.
The loop region to which an ordered region without any clause or with a threads clause binds must have an ordered clause without the parameter specified on the corresponding loop directive.

llvm-svn: 248569
2015-09-25 10:37:12 +00:00
Ekaterina Romanova c52c30a78e This patch adds missing pieces to clang, including the PS4 toolchain
definition, added warnings, PS4 defaults, and Driver changes needed for
our compiler.

A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova!

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

llvm-svn: 248546
2015-09-24 22:06:52 +00:00
Eric Christopher 7d0c7255c5 Move the darwin define static function to be close to the OS define.
llvm-svn: 248539
2015-09-24 21:17:04 +00:00
Eric Christopher d8eb961b0f Use just one larger anonymous namespace instead of a lot of smaller ones.
llvm-svn: 248538
2015-09-24 21:17:02 +00:00
Artyom Skrobov d3ae09bcc8 Recommit r248154: [ARM] Handle DSP feature as an ArchExtKind
Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in
a hand-rolled tricky condition block in lib/Basic/Targets.cpp, with a FIXME:
attached.

http://reviews.llvm.org/D12937 moved the handling of the DSP feature over to
ARMTargetParser.def in LLVM, to be in line with other architecture extensions.

This is the corresponding patch to clang, to clear the FIXME: and update
the tests.

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

llvm-svn: 248521
2015-09-24 17:34:05 +00:00
Evgeniy Stepanov 299238a67b Enable SafeStack on all Linux platforms.
llvm-svn: 248518
2015-09-24 17:22:46 +00:00
Devin Coughlin 0da2e93345 [analyzer] When memcpy'ing into a fixed-size array, do not invalidate entire region.
Change the analyzer's modeling of memcpy to be more precise when copying into fixed-size
array fields. With this change, instead of invalidating the entire containing region the
analyzer now invalidates only offsets for the array itself when it can show that the
memcpy stays within the bounds of the array.

This addresses false positive memory leak warnings of the kind reported by
krzysztof in https://llvm.org/bugs/show_bug.cgi?id=22954

(This is the second attempt, now with assertion failures resolved.)

A patch by Pierre Gousseau!

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

llvm-svn: 248516
2015-09-24 16:52:56 +00:00
Adrian Prantl 835e6633ab Module Debugging: Emit submodules as nested DW_TAG_modules.
llvm-svn: 248511
2015-09-24 16:10:10 +00:00
Adrian Prantl eb66a263c2 Debug Info: Use the module pointer as key for the module cache.
This way we don't need to rebuild the full module name for every decl.

llvm-svn: 248510
2015-09-24 16:10:04 +00:00
Adrian Prantl 6083b08580 Refactor ASTSourceDescriptor to not store copies of all strings. (NFC)
llvm-svn: 248509
2015-09-24 16:10:00 +00:00
Benjamin Kramer 72e64317a7 Drop useless const in for-range loops.
StringRefs always point to immutable memory so the const doesn't add value
here. Also quiets clang's -Wrange-loop-analysis which warns about the implicit
copying.

llvm-svn: 248496
2015-09-24 14:48:49 +00:00
Benjamin Kramer e8b764144e [Driver] Don't implicitly copy std::strings in for-range loop.
Found by -Wrange-loop-analysis.

llvm-svn: 248495
2015-09-24 14:48:37 +00:00
Daniel Sanders e0395a7f7f [mips] Relax -mnan=2008 acceptance to permit MIPS32R2 and MIPS64R2.
Summary:
Strictly speaking, the MIPS*R2 ISA's should not permit -mnan=2008 since this
feature was added in MIPS*R3. However, other toolchains permit this and we
should do the same.

Reviewers: atanasyan

Subscribers: cfe-commits

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

llvm-svn: 248481
2015-09-24 10:22:17 +00:00
Vladimir Sukharev a317dfb767 [ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="
Fix of dangling StringRef after temporary std::string is destroyed

Follow-up to: http://reviews.llvm.org/rL248479

Reviewers: alexfh

Subscribers: cfe-commits
llvm-svn: 248480
2015-09-24 10:06:44 +00:00
Vladimir Sukharev 2eef4b52cd [ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="
Fix of dangling StringRef after temporary std::string is destroyed

Follow-up to: http://reviews.llvm.org/rL248370

Reviewers: alexfh

Subscribers: cfe-commits
llvm-svn: 248479
2015-09-24 09:55:08 +00:00
Igor Kudrin f2e7524356 [Driver] Add support for Windows 10 SDK
Summary:
With Windows 10 SDK, Include and Lib directories now contain an additional subfolder with the name that corresponds to the full version of the SDK, for example:
  - C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um
  - C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x64


Reviewers: ruiu, rnk

Subscribers: majnemer, cfe-commits

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

llvm-svn: 248463
2015-09-24 05:16:36 +00:00
NAKAMURA Takumi 0c8decd108 cuda-path: StringRef cannot be used here.
llvm-svn: 248459
2015-09-24 03:15:44 +00:00
Richard Trieu c3096249c1 Improve the printing of ranges when macros are involved.
Trace the ranges through the macro backtrace better.  This allows better
range highlighting through all levels of the macro bracktrace.  Also some
improvements to backtrace printer for omitting different backtraces.

Patch by Zhengkai Wu.

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

llvm-svn: 248454
2015-09-24 01:21:01 +00:00
Devin Coughlin 683dfd3124 [analyzer] Discard malloc-overflow bug-report when a known size is malloc'ed.
This patch ignores malloc-overflow bug in two cases:
Case1:
x = a/b; where n < b
malloc (x*n); Then x*n will not overflow.

Case2:
x = a; // when 'a' is a known value.
malloc (x*n);

Also replaced isa with dyn_cast.

Reject multiplication by zero cases in MallocOverflowSecurityChecker
Currently MallocOverflowSecurityChecker does not catch cases like:
malloc(n * 0 * sizeof(int));

This patch rejects such cases.

Two test cases added. malloc-overflow2.c has an example inspired from a code
in linux kernel where the current checker flags a warning while it should not.

A patch by Aditya Kumar!

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

llvm-svn: 248446
2015-09-23 23:27:55 +00:00
Chris Bieneman 25bc0debf3 [darwin] [builtins] Stop generating cc_kext_ios5 and move iOS architectures out of cc_kext into cc_kext_ios
Summary:
This corresponds to a patch to compiler-rt (D13112).

Xcode 7 doesn't support targeting iOS5 and earlier. Instead of just dropping cc_kext_ios5, I've repurposed it to cc_kext_ios, and I'm pulling the iOS architectures out of cc_kext. Putting OS X and iOS slices inside the same archive was just odd.

Reviewers: bogner, bob.wilson

Subscribers: cfe-commits

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

llvm-svn: 248442
2015-09-23 22:52:35 +00:00
John McCall 6997525eaa Forbid qualifiers on ObjC generic parameters and arguments, but
silently ignore them on arguments when they're provided indirectly
(.e.g behind a template argument or typedef).

This is mostly just good language design --- specifying that a
generic argument is __weak doesn't actually do anything --- but
it also prevents assertions when trying to apply a different
ownership qualifier.

rdar://21612439

llvm-svn: 248436
2015-09-23 22:14:21 +00:00
Richard Smith d209967a68 Remove warning on over-wide bit-field of boolean type; there's no risk that
someone thought all the bits would be value bits in this case.

Also fix the wording of the warning -- it claimed that the width of 'bool' is
8, which is not correct; the width is 1 bit, whereas the size is 8 bits in our
implementation.

llvm-svn: 248435
2015-09-23 22:07:44 +00:00
Artem Belevich 98607b6757 [CUDA] Added CUDA installation detector class.
Added new option --cuda-path=<path> which allows
overriding default search paths.
If it's not specified we look for CUDA installation in
/usr/include/cuda and /usr/include/cuda-7.0.

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

llvm-svn: 248433
2015-09-23 21:49:39 +00:00
Devin Coughlin 9f21f68bfe [analyzer] Improve localizability checks for iOS / OS X.
Various improvements to the localization checker:
* Adjusted copy to be consistent with diagnostic text in other Apple
  API checkers.
* Added in ~150 UIKit / AppKit methods that require localized strings in
  UnlocalizedStringsChecker.
* UnlocalizedStringChecker now checks for UI methods up the class hierarchy and
  UI methods that conform for a certain Objective-C protocol.
* Added in alpha version of PluralMisuseChecker and some regression tests. False
  positives are still not ideal.

(This is the second attempt, with the memory issues on Linux resolved.)

A patch by Kulpreet Chilana!

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

llvm-svn: 248432
2015-09-23 21:43:21 +00:00
Richard Smith d784e6893c PR14858: Initial support for proper sizeof... handling within alias templates.
This doesn't quite get alias template equivalence right yet, but handles the
egregious cases where we would silently give the wrong answers.

llvm-svn: 248431
2015-09-23 21:41:42 +00:00
Richard Smith ed9b8f0a37 Remove wrong implication that value-dependent implies instantiation-dependent,
and fix the only code that was depending on this so that it sets all the
relevant flags appropriately.

No functionality change intended.

llvm-svn: 248430
2015-09-23 21:30:47 +00:00
Joerg Sonnenberger 27a69a2ba0 Support linking against OpenMP runtime on NetBSD.
llvm-svn: 248426
2015-09-23 20:11:00 +00:00
Joerg Sonnenberger 5c3f9d516d Push OpenMP linker flags after linker input on Darwin. Don't add any
libraries if -nostdlib is specified. Test.

llvm-svn: 248424
2015-09-23 20:07:56 +00:00
Artem Belevich 8d20bd3917 Reverted r248408 "[CUDA] Added CUDA installation detector class."
because included test fails on some platforms.

llvm-svn: 248413
2015-09-23 18:28:30 +00:00
Artem Belevich e75405b4ea [CUDA] Added CUDA installation detector class.
Added new option --cuda-path=<path> which allows
overriding default search paths.
If it's not specified we look for CUDA installation in
/usr/include/cuda and /usr/include/cuda-7.0.

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

llvm-svn: 248408
2015-09-23 18:13:25 +00:00
Artem Belevich 7b41f70e6c [CUDA] __global__ functions should always be visible externally.
Adjust __global__ functions with DiscardableODR linkage to use
StrongODR linkage instead, so they are visible externally.

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

llvm-svn: 248400
2015-09-23 17:44:53 +00:00
David Majnemer 54bbae5c0f [Lex] A source-file new-line in a raw string literal results in a new-line
Our string literal parser copied any source-file new-line characters
into the execution string-literal.  This is incorrect if the source-file
new-line character was a \r\n sequence because new-line characters are
merely \n.

llvm-svn: 248392
2015-09-23 16:04:47 +00:00
Benjamin Kramer c4284e3aad [Sema] Don't create an invalid source range for overlong initializer lists.
We took both source locations from the end of the initializer list what
the code below doesn't expect. This can lead to a crash when rendering
the diagnostic (PR24816). Assert that we have more than one element in
a scalar initializer with too many elements.

llvm-svn: 248391
2015-09-23 16:03:53 +00:00
Joerg Sonnenberger 95a90134ac Refactor library decision for -fopenmp support from Darwin into a
function for sharing with other platforms.

llvm-svn: 248379
2015-09-23 14:06:52 +00:00
John Brawn ad31ace8c8 Add -fplugin=name.so option to the driver
This translates to -load name.so in the cc1 command. We can't name the driver
option -load, as that means "link against oad", so instead we follow GCC's lead
and name the option -fplugin.

llvm-svn: 248378
2015-09-23 13:55:40 +00:00
Benjamin Kramer 36d514e687 [DeclPrinter] Don't crash when printing a using decl with a special name
Fixes PR24872.

llvm-svn: 248376
2015-09-23 13:43:16 +00:00
Daniel Jasper a3e553a22c Fix bad iterator access.
llvm-svn: 248375
2015-09-23 12:47:50 +00:00
Vladimir Sukharev 64f68248cd [ARM] Fix crash "-target arm -mcpu=generic", without "-march="
An assertion hit has been fixed for cmdlines like

$ clang --target=arm-linux-gnueabi -mcpu=generic hello.c

Related to: http://reviews.llvm.org/rL245445

Reviewers: rengolin

Subscribers: cfe-commits

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

llvm-svn: 248370
2015-09-23 09:29:32 +00:00
Daniel Jasper d89ae9d3ac clang-format: Add initial #include sorting capabilities.
To implement this nicely, add a function that merges two sets of
replacements that are meant to be done in sequence. This functionality
will also be useful for other applications, e.g. formatting the result
of clang-tidy fixes.

llvm-svn: 248367
2015-09-23 08:30:47 +00:00
Devin Coughlin 749de2355c Revert "[analyzer] Improve localizability checks for iOS / OS X."
This reverts commit r248350. The pluralization checks are failing on some bots.

llvm-svn: 248351
2015-09-23 00:17:52 +00:00
Devin Coughlin ab58314357 [analyzer] Improve localizability checks for iOS / OS X.
Various improvements to the localization checker:
* Adjusted copy to be consistent with diagnostic text in other Apple
  API checkers.
* Added in ~150 UIKit / AppKit methods that require localized strings in
  UnlocalizedStringsChecker.
* UnlocalizedStringChecker now checks for UI methods up the class hierarchy and
  UI methods that conform for a certain Objective-C protocol.
* Added in alpha version of PluralMisuseChecker and some regression tests. False
  positives are still not ideal.

A patch by Kulpreet Chilana!

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

llvm-svn: 248350
2015-09-22 23:58:04 +00:00
Adrian Prantl a5206ce72a Module Debugging: Use the clang module signature as the module's dwo_id
when building a module. Clang already records the module signature when
building a skeleton CU to reference a clang module.

Matching the id in the skeleton with the one in the module allows a DWARF
consumer to verify that they found the correct version of the module
without them needing to know about the clang module format.

llvm-svn: 248345
2015-09-22 23:26:43 +00:00
Adrian Prantl adbd2b1f32 Serialization: Let ASTWriter return the signature of the written module.
NFC

llvm-svn: 248344
2015-09-22 23:26:31 +00:00
Devin Coughlin 8177173757 [analyzer] Make realloc(ptr, 0) handling equivalent to malloc(0).
Currently realloc(ptr, 0) is treated as free() which seems to be not correct. C
standard (N1570) establishes equivalent behavior for malloc(0) and realloc(ptr,
0): "7.22.3 Memory management functions calloc, malloc, realloc: If the size of
the space requested is zero, the behavior is implementation-defined: either a
null pointer is  returned, or the behavior is as if the size were some nonzero
value, except that the returned pointer shall not be used to access an object."
The patch equalizes the processing of malloc(0) and realloc(ptr,0). The patch
also enables unix.Malloc checker to detect references to zero-allocated memory
returned by realloc(ptr,0) ("Use of zero-allocated memory" warning).

A patch by Антон Ярцев!

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

llvm-svn: 248336
2015-09-22 22:47:14 +00:00
Devin Coughlin eb538abfbd [analyzer] Create one state for a range switch case instead of multiple.
This fixes PR16833, in which the analyzer was using large amounts of memory
for switch statements with large case ranges.

rdar://problem/14685772

A patch by Aleksei Sidorin!

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

llvm-svn: 248318
2015-09-22 20:31:19 +00:00
Ismail Pazarbasi d60db64e7d Analyzer: Teach analyzer how to handle TypeTraitExpr
Summary:
`TypeTraitExpr`s are not supported by the ExprEngine today. Analyzer
creates a sink, and aborts the block. Therefore, certain bugs that
involve type traits intrinsics cannot be detected (see PR24710).

This patch creates boolean `SVal`s for `TypeTraitExpr`s, which are
evaluated by the compiler.

Test within the patch is a summary of PR24710.

Reviewers: zaks.anna, dcoughlin, krememek

Subscribers: cfe-commits

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

llvm-svn: 248314
2015-09-22 19:33:15 +00:00
Artem Belevich b5bc923af4 [CUDA] Allow parsing of host and device code simultaneously.
* adds -aux-triple option to specify target triple
 * propagates aux target info to AST context and Preprocessor
 * pulls in target specific preprocessor macros.
 * pulls in target-specific builtins from aux target.
 * sets appropriate host or device attribute on builtins.

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

llvm-svn: 248299
2015-09-22 17:23:22 +00:00
Artem Belevich ccf0d699f0 Augmented CudaHostAction to carry device-side triple.
Differential Revision: http://reviews.llvm.org/D12893

llvm-svn: 248298
2015-09-22 17:23:13 +00:00
Artem Belevich 2325675143 [CUDA] Fixes minor cuda-related issues in the driver
* Only the last of the --cuda-host-only/--cuda-device-only options has effect.
* CudaHostAction always wraps host-side compilation now.
* Fixed printing of empty action lists.

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

llvm-svn: 248297
2015-09-22 17:23:09 +00:00
Artem Belevich 9674a64cd9 [CUDA] Add appropriate host/device attribute to builtins.
The changes are part of attribute-based CUDA function overloading (D12453)
and as such are only enabled when it's in effect (-fcuda-target-overloads).

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

llvm-svn: 248296
2015-09-22 17:23:05 +00:00
Artem Belevich 94a55e8169 [CUDA] Allow function overloads in CUDA based on host/device attributes.
The patch makes it possible to parse CUDA files that contain host/device
functions with identical signatures, but different attributes without
having to physically split source into host-only and device-only parts.

This change is needed in order to parse CUDA header files that have
a lot of name clashes with standard include files.

Gory details are in design doc here: https://goo.gl/EXnymm
Feel free to leave comments there or in this review thread.

This feature is controlled with CC1 option -fcuda-target-overloads
and is disabled by default.

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

llvm-svn: 248295
2015-09-22 17:22:59 +00:00
Artem Belevich c3fa25def7 [CUDA] Add implicit __attribute__((used)) to all __global__ functions.
This makes sure that we emit kernels that were instantiated from the
host code and which would never be explicitly referenced by anything
else on device side.

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

llvm-svn: 248293
2015-09-22 17:22:51 +00:00
Argyrios Kyrtzidis 64f67be319 [tooling] Provide the compile commands of the JSON database in the order that they were provided in the JSON file.
This is useful for debugging of issues and reduction of test cases.
For example, an issue may show up due to the order that some commands were processed.
It is convenient to be able to remove commands from the file and still preserve the order
that they are returned, instead of getting a completely different order when removing a few commands.

llvm-svn: 248292
2015-09-22 17:22:33 +00:00
Daniel Sanders 63f2826361 [mips] Added support for using the command line options -Wa,-msoft-float and -Wa,-mhard-float.
Patch by Scott Egerton.

Reviewers: vkalintiris, dsanders

Subscribers: cfe-commits

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

llvm-svn: 248276
2015-09-22 13:52:32 +00:00
Daniel Jasper bbfd20d7dd clang-format: Fix alignConsecutiveAssignments.
It wasn't correctly handling this case:

  int oneTwoThree = 123;
  int oneTwo      = 12;
  method();

Review: http://reviews.llvm.org/D12369
Patch by Beren Minor. Thank you!

llvm-svn: 248254
2015-09-22 09:32:00 +00:00
Nico Weber 1f22a34409 ms Intrin.h: Fix __movsw's and __stosw's inline asm.
Before, clang's internal assembler would reject the inline asm in clang's
Intrin.h.  To make sure this doesn't happen for other Intrin.h functions using
__asm__ blocks, add 32-bit and 64-bit codegen tests for Intrin.h.

Sadly, these tests discovered that __readcr3 and __writecr3 have bad
implementations in 64-bit builds.  This will have to be fixed in a follow-up.

llvm-svn: 248234
2015-09-22 00:46:21 +00:00
Nico Weber d1a9125cdd clang-format: Remove ChromiumStyle.MacroBlockBegin.
We prefer setting these in our .clang-format file as the macros change over
time.  (Also, the code was setting MacroBlockBegin twice and didn't set
MacroBlockEnd, so it wasn't doing what it tried to do anyways.)

llvm-svn: 248205
2015-09-21 20:06:42 +00:00
Akira Hatanaka 510d7c71e2 Remove attributes minsize and optsize, which conflict with optnone.
This commit fixes an assert that is triggered when optnone is being
added to an IR function that is already marked with minsize and optsize.

rdar://problem/22723716

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

llvm-svn: 248191
2015-09-21 18:52:24 +00:00
Adrian Prantl 85d938aadb Debug Info: When building a module, emit skeleton CUs for imported modules.
llvm-svn: 248184
2015-09-21 17:48:37 +00:00
James Molloy 93bd4e9979 Revert "[ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.def"
This was committed without the code review (http://reviews.llvm.org/D12938) being approved.

This reverts commit r248154.

llvm-svn: 248173
2015-09-21 16:34:58 +00:00
Alexander Musman 8e261be911 Fix assertion in inline assembler IR gen
Several inputs may not refer to one output constraint in inline assembler
insertions, clang was failing on assertion on such test case.

llvm-svn: 248158
2015-09-21 14:41:00 +00:00
Michael Kuperstein a10dff946e [X86] Make f16c intrinsics accessible through emmintrin.h, per Intel docs
Differential Revision: http://reviews.llvm.org/D13015

llvm-svn: 248156
2015-09-21 13:34:47 +00:00
Artyom Skrobov 7428f1ef64 [ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.def
Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in
a hand-rolled tricky condition block in lib/Basic/Targets.cpp, with a FIXME:
attached.

http://reviews.llvm.org/D12937 moved the handling of +t2dsp over to
ARMTargetParser.def in LLVM, to be in line with other architecture extensions.

This is the corresponding patch to clang, to clear the FIXME: and update
the tests.

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

llvm-svn: 248154
2015-09-21 13:19:25 +00:00
Michael Kuperstein 5c2cb0eee2 [X86] Fix some non-reserved parameter names in intrinsic headers
Differential Revision: http://reviews.llvm.org/D13009

llvm-svn: 248150
2015-09-21 11:45:27 +00:00
Daniel Jasper 368369b453 clang-format: Fix merging short case labels with comments.
This fixes llvm.org/PR24877.

Patch by Benjamin Daly, thank you!

llvm-svn: 248145
2015-09-21 09:50:01 +00:00
Craig Topper 9cd5e4f080 Pass SourceLocation by value instead of by const reference since its just a 32-bit integer. NFC
llvm-svn: 248138
2015-09-21 01:23:32 +00:00
Craig Topper 3db9ba4248 Don't pass StringRefs around by const reference. Pass by value instead per coding standards. NFC
llvm-svn: 248137
2015-09-21 00:20:04 +00:00
Adrian Prantl 9402cef0ae Module debugging: Support submodules in the PCM/PCH debug info.
llvm-svn: 248127
2015-09-20 16:51:35 +00:00
Adrian Prantl 1e63b2bdc3 Further simplify the interface of PCHContainerGenerator
by dropping the const qualifier on the CI.

NFC

llvm-svn: 248101
2015-09-19 21:42:52 +00:00
Nico Weber fb80f961df Convert two loops to range-based loops. No behavior change.
llvm-svn: 248100
2015-09-19 21:36:51 +00:00
Saleem Abdulrasool 06f6f995a1 Driver: alter the getARMFloatABI signature
This changes getARMFloatABI to use the ToolChain and Args instead of Driver,
Args, Triple.  Although this pushes the Triple calculation/parsing into the
function itself, it enables the use of the function for a future change.  The
reason to sink the triple calculation here is to avoid threading the Triple
through multiple layers in a future change.

llvm-svn: 248095
2015-09-19 20:40:16 +00:00
Saleem Abdulrasool ce63ce947e Driver: tweak ARM target feature calculation
Rather than using re-calculating the effective triple, thread the already
calculated value down into AddARMTargetArgs.  This avoids both recreating the
triple, as well as re-parsing the triple as it was already done in the previous
frame.

llvm-svn: 248094
2015-09-19 18:19:44 +00:00
Simon Pilgrim 12919f7e49 [X86][SSE] Replace 128-bit SSE41 PMOVSX intrinsics with native IR
128-bit vector integer sign extensions correctly lower to the pmovsx instructions even for debug builds.

This patch removes the builtins and reimplements the _mm_cvtepi*_epi* intrinsics __using builtin_shufflevector (to extract the bottom most subvector) and __builtin_convertvector (to actually perform the sign extension).

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

llvm-svn: 248092
2015-09-19 15:12:38 +00:00
Serge Pavlov c4e04a2964 [Modules] More descriptive diagnostics for misplaced import directive
If an import directive was put into wrong context, the error message was obscure,
complaining on misbalanced braces. To get more descriptive messages, annotation
tokens related to modules are processed where they must not be seen.

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

llvm-svn: 248085
2015-09-19 05:32:57 +00:00
Saleem Abdulrasool d5556e34e4 Driver: avoid unnecessary string ops
Use an enumeration for the Floating Point ABIs supported on MIPS.  This is
replicating the ARM change to avoid string based tracking of the floating point
ABI.  NFC.

llvm-svn: 248083
2015-09-19 04:33:38 +00:00
Adrian Prantl 2f957ac092 Further simplify CGDebugInfo::getOrCreateModuleRef().
DIBuilder ignoers DICompileUnits that are passed in as scopes anyway.

llvm-svn: 248077
2015-09-19 00:59:22 +00:00
Adrian Prantl 2d3d6dfe1c Rename ASTSourceDescriptor::ModuleName to FullModuleName for clarity.
llvm-svn: 248070
2015-09-19 00:10:37 +00:00
Adrian Prantl c6458d6a4d Refactor ASTReader::getSourceDescriptor(const Module &) into a constructor
of ASTSourceDescriptor. It was effectively a static function.

NFC.

llvm-svn: 248069
2015-09-19 00:10:32 +00:00
Adrian Prantl 8bd4c13f67 Eliminate a redundant check.
llvm-svn: 248068
2015-09-19 00:10:25 +00:00
Gabor Horvath 659842d0fc [Static Analyzer] Fixed a false positive case in DynamicTypeChecker when dealing with forward declarations.
llvm-svn: 248065
2015-09-18 23:38:57 +00:00
Adrian Prantl 666892051c CGDebugInfo: Make creating a skeleton CU in getOrCreateModuleRef optional.
We don't want a skeleton CU when generating debug info for the module
itself.

NFC.

llvm-svn: 248062
2015-09-18 23:01:45 +00:00
Adrian Prantl 0391406e95 Simplify the interface of PCHContainerGenerator and friends
by passing in a CompilerInstance instead of all its individual members.

NFC.

llvm-svn: 248053
2015-09-18 22:10:59 +00:00
Ismail Pazarbasi d347e7a920 Analyzer: Fix a crasher in UbigraphViz
Summary:
Name `Out` refers to the parameter. It is moved into the member `Out`
in ctor-init. Dereferencing null pointer will crash clang, if user
passes '-analyzer-viz-egraph-ubigraph' argument.

Reviewers: zaks.anna, krememek

Subscribers: cfe-commits

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

llvm-svn: 248050
2015-09-18 21:54:47 +00:00
Eric Christopher c48497a2f8 Reduce indentation in the TargetInfo implementations and fix up
a couple of macro builtin redefines.

llvm-svn: 248046
2015-09-18 21:26:24 +00:00
Gabor Horvath dce40c518d [Static Analyzer] General type checker based on dynamic type information.
Differential Revision: http://reviews.llvm.org/D12973

llvm-svn: 248041
2015-09-18 21:15:37 +00:00
Adrian Prantl 201e10d007 Debug Info: Use the full module name as a key when caching DIModules.
The signature may not have been computed at the time the module reference
is generated (e.g.: in the future while emitting debug info for a clang
module). Using the full module name is safe because each clang module may
only have a single definition.

NFC.

llvm-svn: 248037
2015-09-18 21:06:14 +00:00
Gabor Horvath c4b28a8f74 [analyzer] A fix for substraction of an integer from a pointer.
Patch by Artem Dergachev!

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

llvm-svn: 248021
2015-09-18 19:13:22 +00:00
Hans Wennborg 0f0e8d624c clang-cl: Use 'pc' for the vendor field in the default triple
Leaving it unset can make the triple look confusing, especially
when using -m32 or -m64.

llvm-svn: 248005
2015-09-18 17:11:50 +00:00
Gabor Horvath 6165d31a83 [Static Analyzer] Use generics related information to infer dynamic types.
Differential Revision: http://reviews.llvm.org/D12916

llvm-svn: 248002
2015-09-18 16:43:27 +00:00
Douglas Katzman 8c39e6aee8 Use None instead of an explicit constructor.
And remove a needless 'const' since ArrayRef is immutable.
Both as suggested by dblaikie on cfe-commits.

llvm-svn: 247995
2015-09-18 15:23:16 +00:00
Joerg Sonnenberger 924f6ad63d Pass the relocation model to LLVM for assembler files.
llvm-svn: 247981
2015-09-18 11:13:43 +00:00
Alexey Bataev 87933c7ced [OPENMP 4.0] Add 'if' clause for 'cancel' directive.
Add parsing, sema analysis and codegen for 'if' clause in 'cancel' directive.

llvm-svn: 247976
2015-09-18 08:07:34 +00:00
Alexander Musman fbbc0b8cec Fix for assertion fail for pragma weak on typedef.
Example:
typedef int __td3;
#pragma weak td3 = __td3

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

llvm-svn: 247975
2015-09-18 07:40:22 +00:00
Saleem Abdulrasool eee54b4d7c Driver: avoid unnecessary string based operations
Use an enumeration and change the use of the FloatABI from a string to the
enumeration.  This avoids the use of string values to represent an enumeration.
NFC.

llvm-svn: 247967
2015-09-18 05:32:23 +00:00
Douglas Katzman b1278f3349 [Myriad]: add "<sysroot>/include" to standard search path
llvm-svn: 247948
2015-09-17 21:20:16 +00:00
Charles Davis c7d5c94f78 Support __builtin_ms_va_list.
Summary:
This change adds support for `__builtin_ms_va_list`, a GCC extension for
variadic `ms_abi` functions. The existing `__builtin_va_list` support is
inadequate for this because `va_list` is defined differently in the Win64
ABI vs. the System V/AMD64 ABI.

Depends on D1622.

Reviewers: rsmith, rnk, rjmccall

CC: cfe-commits

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

llvm-svn: 247941
2015-09-17 20:55:33 +00:00
Piotr Padlewski b83278687d Using MD_invariant_group
http://reviews.llvm.org/D12927

llvm-svn: 247933
2015-09-17 20:25:46 +00:00
Douglas Katzman e793f19831 Try to unbreak windows compiler after r247926.
It might not like {} implicitly cast to an Arrayref.
That's the theory, since I can't test it.

llvm-svn: 247932
2015-09-17 20:25:09 +00:00
Douglas Katzman d6e597c2be [Shave]: Drive sparc-myriad-elf-ld directly rather than via gcc.
Differential Revision: http://reviews.llvm.org/D12541

llvm-svn: 247924
2015-09-17 19:56:40 +00:00
Reid Kleckner 01485654db Use the MSVC SEH personalities on Mingw
Mingw generally wraps an old copy of msvcrt.dll which has these
personalities, so things should work out, or so I hear. I haven't tested
it.

llvm-svn: 247902
2015-09-17 17:04:13 +00:00
Douglas Katzman 8bfac2c553 createOutputFile should set Error to something if it returns null.
This is not portably unit-testable because the only visible
effect is a change from one random message string to another.

llvm-svn: 247900
2015-09-17 16:45:12 +00:00
Asaf Badouh 2718051dd7 re-apply r.247881
fixed the tests.

llvm-svn: 247892
2015-09-17 14:53:37 +00:00
Aaron Ballman 512fb64765 Rename AST node matchers to match the AST node names directly. Part of this rename also splits recordDecl() (which used to match CXXRecordDecl) into recordDecl() (that matches RecordDecl) and cxxRecordDecl (that matches CXXRecordDecl). Also adds isStruct(), isUnion(), and isClass() narrowing matchers for RecordDecl objects.
llvm-svn: 247885
2015-09-17 13:30:52 +00:00
Asaf Badouh 8a61250709 revert r.247881 due to tests failures
llvm-svn: 247883
2015-09-17 13:09:33 +00:00
Asaf Badouh a0e5e71ef1 [X86][AVX512DQ] add new intrinsics
convert i64 to FP and vice versa
reduceps & reducepd
rangeps & rangepd
all in their 512bit versions


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

llvm-svn: 247881
2015-09-17 11:56:04 +00:00
Gabor Horvath 3ef9ef2227 [Static Analyzer] Generics Checker: When an ObjC method returns a specialized object, track it properly.
Differential Revision: http://reviews.llvm.org/D12889

llvm-svn: 247861
2015-09-16 22:44:36 +00:00
Devin Coughlin e39bd407ba [analyzer] Add generateErrorNode() APIs to CheckerContext.
The analyzer trims unnecessary nodes from the exploded graph before reporting
path diagnostics. However, in some cases it can trim all nodes (including the
error node), leading to an assertion failure (see
https://llvm.org/bugs/show_bug.cgi?id=24184).

This commit addresses the issue by adding two new APIs to CheckerContext to
explicitly create error nodes. Unless the client provides a custom tag, these
APIs tag the node with the checker's tag -- preventing it from being trimmed.
The generateErrorNode() method creates a sink error node, while
generateNonFatalErrorNode() creates an error node for a path that should
continue being explored.

The intent is that one of these two methods should be used whenever a checker
creates an error node.

This commit updates the checkers to use these APIs. These APIs
(unlike addTransition() and generateSink()) do not take an explicit Pred node.
This is because there are not any error nodes in the checkers that were created
with an explicit different than the default (the CheckerContext's Pred node).

It also changes generateSink() to require state and pred nodes (previously
these were optional) to reduce confusion.

Additionally, there were several cases where checkers did check whether a
generated node could be null; we now explicitly check for null in these places.

This commit also includes a test case written by Ying Yi as part of
http://reviews.llvm.org/D12163 (that patch originally addressed this issue but
was reverted because it introduced false positive regressions).

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

llvm-svn: 247859
2015-09-16 22:03:05 +00:00
Reid Kleckner 8be1847b09 [WinEH] Fix a build issue in CGException.cpp
I was constructing an object without filling in all the fields.

llvm-svn: 247851
2015-09-16 21:06:09 +00:00
Reid Kleckner 10aa77032d [WinEH] Pass the catch adjectives to catchpad directly
This avoids building a fake LLVM IR global variable just to ferry an i32
down into LLVM codegen. It also puts a nail in the coffin of using MS
ABI C++ EH with landingpads, since now we'll assert in the lpad code
when flags are present.

llvm-svn: 247843
2015-09-16 20:15:55 +00:00
Adhemerval Zanella 567b9260fa [sanitizers] Enable memory sanitizer on clang
This patch enables MSan for aarch64/linux

llvm-svn: 247808
2015-09-16 15:11:21 +00:00
NAKAMURA Takumi ee82b497f8 CGClass.cpp: Fix a warning in -Asserts. [-Wunused-private-field]
llvm-svn: 247778
2015-09-16 06:26:56 +00:00
Richard Smith 938d701fad [modules] Fix a corner case in the macro override rules: properly handle overridden leaf module macros.
llvm-svn: 247765
2015-09-16 00:55:50 +00:00
Naomi Musgrave 703835c7f3 Implementation and testing for poisoning vtable
ptr in dtor.

Summary:
After destruction, invocation of virtual functions prevented
by poisoning vtable pointer.

Reviewers: eugenis, kcc

Subscribers: cfe-commits

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

Fixed testing callback emission order to account for vptr.
Poison vtable in either complete or base dtor, depending on
if virtual bases exist. If virtual bases exist, poison in
complete dtor. Otherwise, poison in base.
Remove commented-out block.

llvm-svn: 247762
2015-09-16 00:38:22 +00:00
Nico Weber 4f11349028 clang-format: In Java, `assert` is followed by an expression.
Before: assert a&& b;
Now:    assert a && b;
llvm-svn: 247750
2015-09-15 23:48:17 +00:00
Nico Weber 9677562c8f Don't crash when passing &@selector to a _Nonnull parameter. Fixes PR24774.
The root cause here is that ObjCSelectorExpr is an rvalue, yet it can have its
address taken.  That's kind of awkward, but fixing this is awkward in other
ways, see https://llvm.org/bugs/show_bug.cgi?id=24774#c16 .  For now, just
fix the crash.

llvm-svn: 247740
2015-09-15 23:17:17 +00:00
Piotr Padlewski 4b1ac72cd4 Decorating vptr load & stores with !invariant.group
Adding !invariant.group to vptr load/stores for devirtualization purposes.
For more goto:
http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html

http://reviews.llvm.org/D12026

llvm-svn: 247725
2015-09-15 21:46:55 +00:00
Piotr Padlewski 9d0ecf27a7 Added llvm.module flag for strict vtable pointers
It is dangerous to do LTO on code with strict-vtable-pointers, because
one module has invariant.group.barriers, and the other one not.

In the future I want to just strip all invariant.group metadata from
vptrs loads/stores and get rid of invariant.group.barrier calls.

http://reviews.llvm.org/D12580

llvm-svn: 247724
2015-09-15 21:46:50 +00:00
Piotr Padlewski 338c9d0ade Emiting llvm.invariant.group.barrier when dynamic type changes
For more goto:
http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html

http://reviews.llvm.org/D12312

llvm-svn: 247723
2015-09-15 21:46:47 +00:00
Hans Wennborg 5869ec4c6c MS ABI: Don't allow dllexport/import on lambdas
This is to follow up on David's comment in
http://reviews.llvm.org/D12422#235509

llvm-svn: 247718
2015-09-15 21:05:30 +00:00
Kelvin Li 4eea8c6b82 Allow static local variables specified on data-sharing attribute clauses.
http://reviews.llvm.org/D11619

llvm-svn: 247715
2015-09-15 18:56:58 +00:00
Alexey Bataev ecb156aba2 [OPENMP] Emit an additional note during analysis of 'if' clause.
Patch adds emission of additional note for 'if' clauses with name modifiers in case if 'if' clause without name modified was specified or 'if' clause with the same name modifier was specified.

llvm-svn: 247706
2015-09-15 17:23:56 +00:00
Daniel Sanders 50f17235dd Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Eric has replied and has demanded the patch be reverted.

llvm-svn: 247702
2015-09-15 16:17:27 +00:00
Aaron Ballman 02c6abc5dc Silencing a -Wreturn-type warning; NFC.
llvm-svn: 247693
2015-09-15 14:11:32 +00:00
Daniel Sanders 153010c52d Re-commit r247683: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Summary:
This is the first patch in the series to migrate Triple's (which are ambiguous)
to TargetTuple's (which aren't).

For the moment, TargetTuple simply passes all requests to the Triple object it
holds. Once it has replaced Triple, it will start to implement the interface in
a more suitable way.

This change makes some changes to the public C++ API. In particular,
InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer()
now take TargetTuples instead of Triples. The other public C++ API's have
been left as-is for the moment to reduce patch size.

This commit also contains a trivial patch to clang to account for the C++ API
change. Thanks go to Pavel Labath for fixing LLDB for me.

Reviewers: rengolin

Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin

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

llvm-svn: 247692
2015-09-15 14:08:28 +00:00
Daniel Sanders c40de48041 Revert r247684 - Replace Triple with a new TargetTuple ...
LLDB needs to be updated in the same commit.

llvm-svn: 247686
2015-09-15 13:46:21 +00:00
Daniel Sanders 18d4b0dab7 Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Summary:
This is the first patch in the series to migrate Triple's (which are ambiguous)
to TargetTuple's (which aren't).

For the moment, TargetTuple simply passes all requests to the Triple object it
holds. Once it has replaced Triple, it will start to implement the interface in
a more suitable way.

This change makes some changes to the public C++ API. In particular,
InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer()
now take TargetTuples instead of Triples. The other public C++ API's have
been left as-is for the moment to reduce patch size.

This commit also contains a trivial patch to clang to account for the C++ API
change.

Reviewers: rengolin

Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin

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

llvm-svn: 247683
2015-09-15 13:17:40 +00:00
Alexey Bataev 25e5b44654 [OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only if 'cancel' is found.
Patch improves codegen for OpenMP constructs. If the OpenMP region does not have internal 'cancel' construct, a call to 'void __kmpc_barrier()' runtime function is generated for all implicit/explicit barriers. If the region has inner 'cancel' directive, then
```
if (__kmpc_cancel_barrier())
  exit from outer construct;
```
code is generated.
Also, the code for 'canellation point' directive is not generated if parent directive does not have 'cancel' directive.

llvm-svn: 247681
2015-09-15 12:52:43 +00:00
Alexey Bader bdf7c846f9 Run clang-format to unify the switch statement style as suggest here: http://reviews.llvm.org/D12855#246073.
NFC.

llvm-svn: 247678
2015-09-15 12:18:29 +00:00
Alexey Bader 9c8453fb4b [OpenCL] Add new types for OpenCL 2.0.
Patch by Pedro Ferreira.
Reviewers: pekka.jaaskelainen
Differential Revision: http://reviews.llvm.org/D12855

llvm-svn: 247676
2015-09-15 11:18:52 +00:00
Ismail Donmez a8d3a2e9a1 Doxygen fix InitializeBuiltins -> initializeBuiltins
llvm-svn: 247668
2015-09-15 09:53:14 +00:00
Devin Coughlin 676a58c9b2 [analyzer] Restore behavior change introduced by r247657.
r247657 fixed warnings about unused variables when compiling without asserts
but changed behavior. This commit restores the old behavior but still suppresses
the warnings.

llvm-svn: 247660
2015-09-15 03:28:27 +00:00
David Majnemer 1cbe80408d [MS ABI] Restore our warning for overwide bitfields using the MS ABI
This restores a diagnostic lost in r247651.

llvm-svn: 247659
2015-09-15 02:36:41 +00:00
NAKAMURA Takumi f14c2508e4 ExprEngineObjC.cpp: Fix warnings. [-Wunused-variable]
llvm-svn: 247657
2015-09-15 01:53:27 +00:00
NAKAMURA Takumi e9621040e5 ItaniumCXXABI.cpp: Fix a warning. [-Wunused-variable]
llvm-svn: 247655
2015-09-15 01:39:27 +00:00
Richard Smith f091e129db [modules] A using-declaration doesn't introduce a new entity, just a new name
for an existing entity, and as such a using-declaration doesn't need to
conflict with a hidden entity (nor vice versa).

llvm-svn: 247654
2015-09-15 01:28:55 +00:00
Devin Coughlin ca5ab2b0d4 [analyzer] Skip Pre/Post handlers for ObjC calls when receiver is nil.
In Objective-C, method calls with nil receivers are essentially no-ops. They
do not fault (although the returned value may be garbage depending on the
declared return type and architecture). Programmers are aware of this
behavior and will complain about a false alarm when the analyzer
diagnoses API violations for method calls when the receiver is known to
be nil.

Rather than require each individual checker to be aware of this behavior
and suppress a warning when the receiver is nil, this commit
changes ExprEngineObjC so that VisitObjCMessage skips calling checker
pre/post handlers when the receiver is definitely nil. Instead, it adds a
new event, ObjCMessageNil, that is only called in that case.

The CallAndMessageChecker explicitly cares about this case, so I've changed it
to add a callback for ObjCMessageNil and moved the logic in PreObjCMessage
that handles nil receivers to the new callback.

rdar://problem/18092611

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

llvm-svn: 247653
2015-09-15 01:13:53 +00:00
David Majnemer d558aa8627 [MS ABI] Overwide bool bitfields should be permitted
Overwide bool bitfields have eight bits of storage size, make sure we
take the padding into account when determining whether or not they are
problematic.

llvm-svn: 247651
2015-09-15 01:00:55 +00:00
Piotr Padlewski d679d7e924 Generating assumption loads of vptr after ctor call (fixed)
Generating call assume(icmp %vtable, %global_vtable) after constructor
call for devirtualization purposes.

For more info go to:
http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html

Edit:
Fixed version because of PR24479 and other bug caused in chrome.
After this patch got reverted because of ScalarEvolution bug (D12719)
Merged after John McCall big patch (Added Address).

http://reviews.llvm.org/D11859
http://reviews.llvm.org/D12865

llvm-svn: 247646
2015-09-15 00:37:06 +00:00
Stephen Canon ca8eefddb7 Prevent implicit re-interpret casts between ExtVector and Scalar types.
Previously, in certain cases lax vector conversions could occur between scalar floating-point values and ExtVector types; these conversions would be simple bitcasts.  We need to allow them with other vector types to support some common headers, but we don't need them for ExtVector.  Preventing them here makes them behave like other operations involving scalars and ExtVectors.

llvm-svn: 247643
2015-09-15 00:21:56 +00:00