Commit Graph

58270 Commits

Author SHA1 Message Date
Pete Cooper 2f1637ad85 Use Intrinsic::ID instead of unsigned. NFC.
This is after LLVM r237810 which made Function::getIntrinsicID() return an Intrinsic::ID.

llvm-svn: 237811
2015-05-20 17:17:45 +00:00
Justin Bogner 98ceec5725 InstrProf: Change this triple back to %itanium_abi_triple
In my rush to fix the linux bots in r237805, I accidentally committed
a change to the triple. Revert that part.

llvm-svn: 237806
2015-05-20 16:25:35 +00:00
Justin Bogner c49e5aadb9 InstrProf: Remove darwin-specific section names from this test
llvm-svn: 237805
2015-05-20 16:21:26 +00:00
Justin Bogner fb29822bf4 InstrProf: Increment the profile counter for all types of destructor
-fprofile-instr-generate does not emit counter increment intrinsics
for Dtor_Deleting and Dtor_Complete destructors with assigned
counters. This causes unnecessary [-Wprofile-instr-out-of-date]
warnings during profile-use runs even if the source has never been
modified since profile collection.

Patch by Betul Buyukkurt. Thanks!

llvm-svn: 237804
2015-05-20 16:16:23 +00:00
Justin Bogner 1cd11f159e CodeGen: Remove some trailing whitespace. NFC
llvm-svn: 237802
2015-05-20 15:53:59 +00:00
Alexey Bataev d7589ffe1d [OPENMP] Fix codegen for ordered loop directives.
loops with ordered clause must be generated the same way as dynamic loops, but with static scheduleing.

llvm-svn: 237788
2015-05-20 13:12:48 +00:00
Alexey Bataev 15413ea02b [MSVC] Handle out-of-line definition of static data member correctly (fix for http://llvm.org/PR21164), by Alexey Frolov
There are 3 cases of defining static const member:

initialized inside the class, not defined outside the class.
initialized inside the class, defined outside the class.
not initialized inside the class, defined outside the class.
Revision r213304 was supposed to fix the linkage problem of case (1), but mistakenly it made case (2) behave the same.
As a result, out-of-line definition of static data member is not handled correctly.
Proposed patch distinguishes between cases (1) and (2) and allows to properly emit static const members under –fms-compatibility option.

This fixes http://llvm.org/PR21164.
Differential Revision: http://reviews.llvm.org/D9850

llvm-svn: 237787
2015-05-20 11:57:02 +00:00
Manuel Klimek 9eff8b1426 Allow skipping imports in the module visitor.
Skip imports when we know that we do not need to visit any imports
because we've already deserialized the redecls from a module.

llvm-svn: 237782
2015-05-20 10:29:23 +00:00
Michael Kuperstein 7619004211 [X86] Add _mm256_set_m128 and its 5 variants.
Differential Revision: http://reviews.llvm.org/D9855

llvm-svn: 237778
2015-05-20 07:46:52 +00:00
Yaron Keren 627ba89bb1 Fix CGRecordLayouts description to say it maps clang types not llvm types
and de-duplicate data fields names from comments according to the coding
standard.

llvm-svn: 237776
2015-05-20 07:15:28 +00:00
David Majnemer e95f3bd0fd [clang-cl] Map /GA to -ftls-model=local-exec
The /GA switch informs the compiler that it may assume that all TLS
access refers to the executable's index: 0.

llvm-svn: 237771
2015-05-20 04:39:56 +00:00
Alexey Bataev db39021cee [OPENMP] -fopenmp enables OpenMP support (fix for http://llvm.org/PR23492)
-fopenmp turns on OpenMP support and links libiomp5 as OpenMP library. Also there is -fopenmp={libiomp5|libgomp} option that allows to override effect of -fopenmp and link libgomp library (if -fopenmp=libgomp is specified).
Differential Revision: http://reviews.llvm.org/D9736

llvm-svn: 237769
2015-05-20 04:24:19 +00:00
Alexey Bataev 16dc7b68c4 Fix for aggregate copying of variable length arrays.
Patch fixes codegen for aggregate copying of VLAs. Currently method CodeGenFunction::EmitAggregateCopy() does not support copying of VLAs. Patch checks if the size of the type is 0, then checks if the type is actually a variable-length array. Then it calculates total length for this array and calculates total size of the array in bytes:

<total number of elements in array> * aligned_sizeof(ElementType) (if copy assignment is requested).
If simple copying is requested, size is calculated like:

<total number of elements in array> * aligned_sizeof(ElementType) - aligned_sizeof(ElementType) + sizeof(ElementType).
memcpy() is used with this calculated size of the VLA.
Differential Revision: http://reviews.llvm.org/D9851

llvm-svn: 237768
2015-05-20 03:46:04 +00:00
David Blaikie bf178d3eb7 [opaque pointer type] Pass the explicit call type when creating calls from LazyRuntimeFunctions
The implicit conversion was causing issues for a helper being added that
would take an llvm::Function rather than an llvm::Value to make the
CallInst. Since we'll eventually need to specify the type of the call
explicitly anyway, fix these up to avoid the future ambiguity.

llvm-svn: 237729
2015-05-19 21:31:34 +00:00
Richard Smith 54ef4c3bb3 Revert r237609 for now.
glibc's headers use __need_* macros to selectively export parts of themselves
to each other. This requires us to enter those files repeatedly when building
a glibc module.

This can be unreverted once we have a better mechanism to deal with that
non-modular aspect of glibc (possibly some way to mark a header as "textual if
this macro is defined").

llvm-svn: 237718
2015-05-19 19:58:11 +00:00
Jonathan Roelofs 99bdd98a2b Fix 'CFG graph' typo. NFC
Patch by Jon Eyolfson!

llvm-svn: 237713
2015-05-19 18:51:56 +00:00
Anders Waldenborg b09075a240 clang-format: Add space in function pointers with SpaceBeforeParens=Always
"void (*my_function)(void)" should become "void (*my_function) (void)" when
SpaceBeforeParens is set to 'Always'

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

llvm-svn: 237704
2015-05-19 16:54:26 +00:00
Michael Kuperstein 877f3cbe84 [X86] Add _mm_broadcastsd_pd intrinsic
_mm_broadcastsd_pd is basically an alias for _mm_movedup_pd, however the alias is only available from AVX2 forward.

llvm-svn: 237698
2015-05-19 14:49:14 +00:00
Michael Kuperstein 6168183e04 [X86] Added _mm256_bslli_epi128 and _mm256_bsrli_epi128.
These two intrinsics are alternative names for _mm256_slli_si256 and _mm256_srli_si256, respectively.

llvm-svn: 237693
2015-05-19 13:05:46 +00:00
Alexey Bataev 1d9c15cf18 [OPENMP] Fixed codegen for copying/initialization of array variables/parameters.
This modification generates proper copyin/initialization sequences for array variables/parameters. Before they were considered as pointers, not arrays.

llvm-svn: 237691
2015-05-19 12:31:28 +00:00
Daniel Jasper 9310166a63 clang-format: Improve *-detection.
Before:
  S << a *(10);

After:
  S << a * (10);

This fixes llvm.org/PR16500.

llvm-svn: 237690
2015-05-19 12:29:27 +00:00
Daniel Jasper d6e09e85f9 clang-format: Improve for-loop formatting.
Before:
  for (SmallVectorImpl<TemplateIdAnnotationn *>::iterator I =
           Container.begin(),
                                                          E = Container.end();
       I != E; ++I)

After:
  for (SmallVectorImpl<TemplateIdAnnotationn *>::iterator
           I = Container.begin(),
           E = Container.end();
       I != E; ++I)

This fixes llvm.org/PR23544.

llvm-svn: 237688
2015-05-19 11:51:39 +00:00
Daniel Jasper fa3f8fbed8 clang-format: Support #include_next
Before:
  #include_next < test.h >

After:
  #include_next <test.h>

This fixes llvm.org/PR23500

llvm-svn: 237686
2015-05-19 11:22:29 +00:00
Daniel Jasper f5e5ee6d69 clang-format: Correctly detect casts to qualified types.
Before:
  ns::E f() { return (ns::E) - 1; }

After:
  ns::E f() { return (ns::E)-1; }

This fixes llvm.org/PR23503.

llvm-svn: 237684
2015-05-19 11:18:39 +00:00
Daniel Jasper ed41f774fc clang-format: Fix regression caused by r237244.
Before:
  [call aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.
          aaaaaaaa];

After:
  [call aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa
          .aaaaaaaa];

This merely papers over the fact that we aren't parsing ObjC method calls
correctly. Also, the indentation is weird.

llvm-svn: 237681
2015-05-19 11:06:33 +00:00
Alexey Bataev ccb59ec9b5 [OPENMP] Prohibit VLAs in 'private/firstprivate' clauses of 'task' directive.
Currently runtime does not allow to support variably modified types for 'private' and 'firstprivate' clauses in 'task' directives.

llvm-svn: 237674
2015-05-19 08:44:56 +00:00
Alexey Bataev 7a3e5853df [OPENMP] Prohibit variably modified types in 'copyprivate' clause.
Runtime does not allow to work with VLAs in copyprivate clause.

llvm-svn: 237672
2015-05-19 08:19:24 +00:00
Alexey Bataev f120c0d6f2 [OPENMP] Fixed analysis of function arguments and their data sharing attributes.
Added proper analysis for types of function arguments.

llvm-svn: 237670
2015-05-19 07:46:42 +00:00
NAKAMURA Takumi 4bd67d8f46 SemaExprCXX.cpp: Try to fix \param in r237608. [-Wdocumentation]
llvm-svn: 237668
2015-05-19 06:47:23 +00:00
Richard Smith 86dec39c0a PR20073: promote "dereference of 'void*'" from Extension to ExtWarn.
llvm-svn: 237652
2015-05-19 01:41:12 +00:00
David Majnemer fa7bc78e0a [AST] Put VarDeclBitfields on a diet
VarDeclBitfields contained bits which are never present in parameters.
Split these out so that ParmVarDeclBitfields wouldn't grow past 32-bits
if another field was added.

llvm-svn: 237648
2015-05-19 00:57:16 +00:00
Richard Smith 82e57fb1e8 [modules] Support for merging a parsed definition of a static data member of a class template into an imported but hidden definition.
llvm-svn: 237647
2015-05-19 00:49:29 +00:00
David Blaikie 7d9e79249d Fix indentation
llvm-svn: 237631
2015-05-18 22:51:39 +00:00
Reid Kleckner ac385068f9 Revert changes to DefaultABIInfo accidentally introduced in r208733
Also add trivial handling of transparent unions.

PPC32, MSP430, and XCore apparently all rely on DefaultABIInfo. This
should worry you, because DefaultABIInfo is not implementing the rules
of any particular ABI.

Fixes PR23097, patch by Andy Gibbs.

llvm-svn: 237630
2015-05-18 22:46:30 +00:00
David Blaikie 43f9bb7371 API update for streamlining of IRBuilder::CreateCall to just use ArrayRef/initializer_list+braced init
llvm-svn: 237625
2015-05-18 22:14:03 +00:00
Ismail Pazarbasi 8904d6bb17 Added missing 'override' to `ReadMismatchingDeleteExpressions`
llvm-svn: 237613
2015-05-18 20:46:12 +00:00
Richard Smith c7e6ff02d5 [modules] Support for merging a parsed class template specialization definition into an imported but hidden definition.
llvm-svn: 237612
2015-05-18 20:36:47 +00:00
Richard Trieu db36469554 Create new diagnostic group -Wmove
-Wmove includes the three existing warnings for std::move calls, self move,
reduntant move, and pessimizing move.  -Wmove is included in -Wmost, so that
it can be discoverable to people using that or -Wall.

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

llvm-svn: 237610
2015-05-18 20:25:44 +00:00
Richard Smith 2d4a11fba6 [modules] When a file is listed as a non-textual header in a module map, don't
enter it more than once, even if it doesn't have #include guards -- we already
know that it is intended to have the same effect every time it's included, and
it's already had that effect. This particularly helps with local submodule
visibility builds, where the include guard macro may not be visible in the
includer, but will become visible the moment we enter the included file.

llvm-svn: 237609
2015-05-18 20:02:41 +00:00
Ismail Pazarbasi e5768d1717 Detect uses of mismatching forms of 'new' and 'delete'
Emit warning when operand to `delete` is allocated with `new[]` or
operand to `delete[]` is allocated with `new`.

rev 2 update:
`getNewExprFromInitListOrExpr` should return `dyn_cast_or_null`
instead of `dyn_cast`, since `E` might be null.

Reviewers: rtrieu, jordan_rose, rsmith

Subscribers: majnemer, cfe-commits

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

llvm-svn: 237608
2015-05-18 19:59:11 +00:00
Richard Trieu 1d4911bc99 Have -Wredundant-move ignore reference types.
Don't give a warning when the type being moved is a reference type.  Also
uncomment two lines in the test case.

llvm-svn: 237607
2015-05-18 19:54:08 +00:00
Daniel Jasper 3c883d1dcc clang-format: Fix another regression caused by r237565.
Before:
  class C : test {
    class D : test{void f(){int i{2};
  }
  }
  ;
  }
  ;

After:
  class C : test {
    class D : test {
      void f() { int i{2}; }
    };
  };

llvm-svn: 237569
2015-05-18 14:49:19 +00:00
Daniel Jasper cec9ffd2a2 clang-format: Fix regression introduced by r237565.
Before:
  class C : public D {
    SomeClass SC { 2 };
  };

After:
  class C : public D {
    SomeClass SC{2};
  };

llvm-svn: 237568
2015-05-18 14:12:24 +00:00
Daniel Jasper 47bbda0939 clang-format: Improve detection of macros annotating functions.
Before:
  ASSERT("aaaaaaaaaaaaaaa")
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
      << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

After:
  ASSERT("aaaaaaaaaaaaaaa") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                            << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

Also cleanup implementation a bit and only mark closing parenthesis of
these annotations.

llvm-svn: 237567
2015-05-18 13:47:23 +00:00
Daniel Jasper adba2aadf2 clang-format: Allow braced initializers in template arguments of class
specializations.

Before:
  template <class T>
      struct S < std::is_arithmetic<T> {
  } > {};

After:
  template <class T> struct S<std::is_arithmetic<T>{}> {};

llvm-svn: 237565
2015-05-18 12:52:00 +00:00
Daniel Jasper f090f031bc clang-format: Support function annotations in macros.
Before:
  DEPRECATED("Use NewClass::NewFunction instead.") string
      OldFunction(const string &parameter) {}

After:
  DEPRECATED("Use NewClass::NewFunction instead.")
  string OldFunction(const string &parameter) {}

llvm-svn: 237562
2015-05-18 09:47:22 +00:00
Alexey Bataev 8fc69dcf42 [OPENMP] Fix for '#pragma omp task' codegen.
Internal task structure must be generated like
typedef struct kmp_task {
  void *              shareds;
  kmp_routine_entry_t routine;
  kmp_int32           part_id;
  kmp_routine_entry_t destructors;
} kmp_task_t;

struct kmp_task_t_with_privates {
  kmp_task_t task_data;
  .kmp_private. privates;
};
to avoid possible additional alignment bytes in first fields (shareds, routine, part_id and destructors). Runtime library is not aware of such kind additional alignment bytes.

llvm-svn: 237561
2015-05-18 07:54:53 +00:00
Richard Smith bca31b731b [modules] Move implicit creation of ImportDecls for #includes transformed into module imports from the frontend into Sema where it belongs.
llvm-svn: 237555
2015-05-18 05:35:52 +00:00
David Majnemer 8db9176d68 [clang-cl] Enable C++14 when targeting 2015 compatibility
llvm-svn: 237553
2015-05-18 04:49:30 +00:00
Richard Smith 63b6fcef96 [modules] Refactor and simplify #include handling.
Fix a tiny bug where we'd try to load a module file for the module we're in
the middle of building.

llvm-svn: 237552
2015-05-18 04:45:41 +00:00