| Commit message (Collapse) | Author | Age | Files | Lines | 
| ... |  | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
C allows for some implicit conversions that C++ does not, e.g. void* ->
char*. This patch teaches clang that these conversions are okay when
dealing with overloads in C.
Differential Revision: http://reviews.llvm.org/D13604
llvm-svn: 249995
 | 
| | 
| 
| 
| 
| 
| 
|  | 
This is important to keep the information in IDE or other tools
even if the code contains a few errors
llvm-svn: 249982
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
The inference of _Nullable for weak Objective-C properties was broken
in several ways:
* It was back-patching the type information very late in the process
  of checking the attributes for an Objective-C property, which is
  just wrong.
* It was using ad hoc checks to try to suppress the warning about
  missing nullability specifiers (-Wnullability-completeness), which
  didn't actual work in all cases (rdar://problem/22985457)
* It was inferring _Nullable even outside of assumes-nonnull regions,
  which is wrong.
Putting the inference of _Nullable for weak Objective-C properties in
the same place as all of the other inference logic fixes all of these
ills.
llvm-svn: 249896
 | 
| | 
| 
| 
|  | 
llvm-svn: 249893
 | 
| | 
| 
| 
| 
| 
|  | 
TargetInfo class.
llvm-svn: 249872
 | 
| | 
| 
| 
| 
| 
|  | 
change the set of features.
llvm-svn: 249871
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
like __ and ____.
Patch by Adrian Zgorzalek!
llvm-svn: 249833
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
classes
Hopefully fixes the MSVC build. NFC intended.
llvm-svn: 249832
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
Sadly I don't currently have a way to tests this as the driver is always
initialized with the default triple and finding system headers is system
specific.
llvm-svn: 249831
 | 
| | 
| 
| 
| 
| 
|  | 
This simplifies the code and gets us support for .. for free.
llvm-svn: 249830
 | 
| | 
| 
| 
| 
| 
|  | 
This lets a VFSified driver actually validate the GCC paths.
llvm-svn: 249829
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
This means file remappings can now be managed by ClangTool (or a
ToolInvocation user) instead of by ToolInvocation itself. The
ToolInvocation remapping is still in place so users can migrate.
Differential Revision: http://reviews.llvm.org/D13474
llvm-svn: 249815
 | 
| | 
| 
| 
|  | 
llvm-svn: 249801
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Summary:
Currently when a function annotated with __attribute__((nonnull)) is called in an unevaluated context with a null argument a -Wnonnull warning is emitted. 
This warning seems like a false positive unless the call expression is potentially evaluated. Change this behavior so that the non-null warnings use DiagRuntimeBehavior so they wont emit when they won't be evaluated.
Reviewers: majnemer, rsmith
Subscribers: mclow.lists, cfe-commits
Differential Revision: http://reviews.llvm.org/D13408
llvm-svn: 249787
 | 
| | 
| 
| 
|  | 
llvm-svn: 249751
 | 
| | 
| 
| 
| 
| 
| 
|  | 
We were only doing this for SEH as a special case. Generalize it to all
cleanups.
llvm-svn: 249748
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
CGBlocks.cpp.
This commit fixes a bug in clang's code-gen where it creates the
following functions but doesn't attach function attributes to them:
__copy_helper_block_
__destroy_helper_block_
__Block_byref_object_copy_
__Block_byref_object_dispose_
rdar://problem/20828324
Differential Revision: http://reviews.llvm.org/D13525
llvm-svn: 249735
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Rationale :
// sse3
__m128d test_mm_addsub_pd(__m128d A, __m128d B) {
  return _mm_addsub_pd(A, B);
}
// mmx
void shift(__m64 a, __m64 b, int c) {
  _mm_slli_pi16(a, c);
  _mm_slli_pi32(a, c);
  _mm_slli_si64(a, c);
  _mm_srli_pi16(a, c);
  _mm_srli_pi32(a, c);
  _mm_srli_si64(a, c);
  _mm_srai_pi16(a, c);
  _mm_srai_pi32(a, c);
}
clang -msse3 -mno-mmx file.c -c
For this code we should be able to explicitly turn off MMX
without affecting the compilation of the SSE3 function and then
diagnose and error on compiling the MMX function.
This is a preparatory patch to the actual diagnosis code which is
coming in a future patch. This sets us up to have the correct information
where we need it and verifies that it's being emitted for the backend
to handle.
llvm-svn: 249733
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
that we can build up an accurate set of features rather than relying on
TargetInfo initialization via handleTargetFeatures to munge the list
of features.
llvm-svn: 249732
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
early.
This is needed in a patch I plan to commit later, in which a null Decl
pointer is passed to SetLLVMFunctionAttributesForDefinition.
Relevant discussion is in http://reviews.llvm.org/D13525.
llvm-svn: 249722
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
GNU-style formatting that involves prefix and suffix underscores. Cleans up other usages of similar functionality.
Patch by Adrian Zgorzalek!
llvm-svn: 249721
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
C++ exceptions are still off by default, which is similar to how C++
cleanups are off by default in MSVC.
If you use clang instead of clang-cl, exceptions are also still off by
default. In the future, when C++ EH is proven to be stable, we may flip
the default for that driver to be consistent with other platforms.
llvm-svn: 249704
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Simplifying the convoluted CPU handling in ARMTargetInfo.
The default base CPU on ARM is ARM7TDMI, arch ARMv4T, and
ARMTargetInfo had a different one. This wasn't visible from
Clang because the driver selects the defaults and sets the
Arch/CPU features directly, but the constructor depended
on the CPU, which was never used.
This patch corrects the mistake and greatly simplifies
how CPU is dealt with (essentially by removing the duplicated
DefaultCPU field).
Tests updated.
llvm-svn: 249699
 | 
| | 
| 
| 
|  | 
llvm-svn: 249698
 | 
| | 
| 
| 
|  | 
llvm-svn: 249692
 | 
| | 
| 
| 
| 
| 
|  | 
No need to construct temporary std::strings here.
llvm-svn: 249676
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
consider the following:
enum E *p;
enum E { e };
The above snippet is not ANSI C because 'enum E' has not bee defined
when we are processing the declaration of 'p'; however, it is a popular
extension to make the above work.  This would fail using the Microsoft
enum semantics because the definition of 'E' would implicitly have a
fixed underlying type of 'int' which would trigger diagnostic messages
about a mismatch between the declaration and the definition.
Instead, treat fixed underlying types as not fixed for the purposes of
the diagnostic.
llvm-svn: 249674
 | 
| | 
| 
| 
| 
| 
|  | 
OpenMP 4.1 adds support for array sections/subscripts in 'reduction' clause. Patch adds codegen for this feature.
llvm-svn: 249672
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
|  | 
Enums without an explicit, fixed, underlying type are implicitly given a
fixed 'int' type for ABI compatibility with MSVC.  However, we can
enforce the standard-mandated rules on these types as-if we didn't know
this fact if the tag is not part of a definition.
llvm-svn: 249667
 | 
| | 
| 
| 
|  | 
llvm-svn: 249658
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
-fms-compatibility
No ABI for C++ currently makes it possible to implement the standard
100% perfectly.  We wrongly hid some of our compatible behavior behind
-fms-compatibility instead of tying it to the compiler ABI.
llvm-svn: 249656
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
With this change, most 'g' options are rejected by CompilerInvocation.
They remain only as Driver options. The new way to request debug info
from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}"
and "-dwarf-version={2|3|4}". In the absence of a command-line option
to specify Dwarf version, the Toolchain decides it, rather than placing
Toolchain-specific logic in CompilerInvocation.
Also fix a bug in the Windows compatibility argument parsing
in which the "rightmost argument wins" principle failed.
Differential Revision: http://reviews.llvm.org/D13221
llvm-svn: 249655
 | 
| | 
| 
| 
| 
| 
| 
|  | 
Testing has shown that it is at least as reliable as the old landingpad
pattern matching code.
llvm-svn: 249647
 | 
| | 
| 
| 
| 
| 
| 
|  | 
the "" and the suffix; that breaks names such as 'operator""if'. For symmetry,
also remove the space between the 'operator' and the '""'.
llvm-svn: 249641
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
The backend restores the stack pointer after recovering from an
exception.  This is similar to r245879, but it doesn't try to use the
normal cleanup mechanism, so hopefully it won't cause the same breakage.
llvm-svn: 249640
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
|  | 
We don't have a good place to put them. Our previous spot was causing us
to optimize loads from the exception object to undef, because it was
after the catchpad instruction that models the write to the catch
object.
llvm-svn: 249616
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
AllCallbacks is currently only used to call onStartOfTranslationUnit and
onEndOfTranslationUnit on them. In this (and any other scenario I can
come up with), it is important (or at least better) not to have
duplicates in this container. E.g. currently onEndOfTranslationUnit is
called repeatedly on the same callback for every matcher that is
registered with it.
llvm-svn: 249598
 | 
| | 
| 
| 
| 
| 
| 
|  | 
There are still some loose ends here but it's sufficient so we can detect
GCC headers that are inside of a VFS.
llvm-svn: 249556
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Fixes this bug: https://llvm.org/bugs/show_bug.cgi?id=24504
TokenAnnotator::spaceRequiredBetween was handling TT_ForEachMacro but
not TT_ObjCForIn, so lines that look like:
  for (id nextObject in (NSArray *)myArray)
would incorrectly turn into:
  for (id nextObject in(NSArray *)myArray)
Patch by Kent Sutherland, thank you.
llvm-svn: 249553
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
aligning assignments.
This was done correctly when aligning the declarations, but not when
aligning assignments.
FIXME: The code between assignments and declarations alignment is
roughly duplicated and
would benefit from factorization.
Bug 25090: https://llvm.org/bugs/show_bug.cgi?id=25090
Patch by Beren Minor. Thank you.
llvm-svn: 249552
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
Currently codegen crashes trying to emit casting to bool &. It happens because bool type is converted to i1 and later then lvalue for reference is converted to i1*. But when codegen tries to load this lvalue it crashes trying to load value from this i1*.
Differential Revision: http://reviews.llvm.org/D13325
llvm-svn: 249534
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
- Rename it to RedirectingFileSystem. This is what it does, YAML is just a
  serialization format for it.
- Consistently use unique_ptr for memory management.
No functional change intended.
llvm-svn: 249532
 | 
| | 
| 
| 
| 
| 
|  | 
Otherwise we won't be able to find them later.
llvm-svn: 249525
 | 
| | 
| 
| 
| 
| 
|  | 
This fixes llvm.org/PR25073.
llvm-svn: 249519
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Before:
  inline A operator^(const A &lhs, const A &rhs) {} int i;
After:
  inline A operator^(const A &lhs, const A &rhs) {}
  int i;
llvm-svn: 249517
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Before:
  void f(Type(¶meter)[10]) {}
  void f(Type (*parameter)[10]) {}
After:
  void f(Type (¶meter)[10]) {}
  void f(Type (*parameter)[10]) {}
llvm-svn: 249502
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Before:
  return options != nullptr &&operator==(*options);
After:
  return options != nullptr && operator==(*options);
llvm-svn: 249501
 | 
| | 
| 
| 
| 
| 
| 
|  | 
Use llvm.eh.exceptioncode to get the code out of EAX for x64. For
32-bit, the filter is responsible for storing it to memory for us.
llvm-svn: 249497
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
minor cleanups
Patch by Eugene Zelenko!
Differential Revision: http://reviews.llvm.org/D13406
llvm-svn: 249484
 | 
| | 
| 
| 
| 
| 
|  | 
Fixes a crash regression from r249410.
llvm-svn: 249413
 |