Commit Graph

55408 Commits

Author SHA1 Message Date
Michael J. Spencer 04162eaced [llvm-api-change] Use findProgramByName.
llvm-svn: 221222
2014-11-04 01:30:55 +00:00
Reid Kleckner 8cd0079d16 Use the new LLVM_END_WITH_NULL name
llvm-svn: 221217
2014-11-04 01:13:43 +00:00
Reid Kleckner 06ea7d6213 Lower __builtin_fabs* to @llvm.fabs.*
mingw64's headers implement fabs by calling __builtin_fabs, so using the
library call results in an infinite loop. If the backend legalizes
@llvm.fabs as a call to fabs later, things should work out, as the crt
provides a definition.

llvm-svn: 221206
2014-11-03 23:52:09 +00:00
Reid Kleckner 4cad00abf3 Remove dead AST type argument to EmitFAbs
llvm-svn: 221205
2014-11-03 23:51:40 +00:00
Rafael Espindola 234d3bce01 Remove local handling of ASAN_OPTIONS and UBSAN_OPTIONS.
They are now forwarded by TestingConfig.py.

llvm-svn: 221200
2014-11-03 23:09:25 +00:00
Reid Kleckner 899baf3625 Move the no-prototype calling conv check after decl merging
Now we don't warn on this code:
  void __stdcall f(void);
  void __stdcall f();

My previous commit regressed this functionality because I didn't update
the relevant test case which used a definition.

llvm-svn: 221188
2014-11-03 21:56:03 +00:00
Reid Kleckner 1eaa844f3e Don't diagnose no-prototype callee-cleanup function definitions
We already have a warning on the call sites of code like this:
  void f() { }
  void g() { f(1, 2, 3); }
t.c:2:21: warning: too many arguments in call to 'f'

We can limit ourselves to diagnosing unprototyped forward declarations
of f to cut down on noise.

llvm-svn: 221184
2014-11-03 21:24:50 +00:00
Roman Divacky 1ae35b902b Require asserts to unbreak the buildbots.
llvm-svn: 221174
2014-11-03 19:50:48 +00:00
Fariborz Jahanian e3db7784b6 Further restrict issuance of 'override' warning if method
is argument to a macro which is defined in system header.

llvm-svn: 221172
2014-11-03 19:46:18 +00:00
Roman Divacky 8a12d84264 Implement vaarg lowering for ppc32. Lowering of scalars and aggregates
is supported. Complex numbers are not.

llvm-svn: 221170
2014-11-03 18:32:54 +00:00
Fariborz Jahanian d6efd3e0d0 This patch reverts r220496 which issues warning on comparing
parameters with nonnull attribute when comparison is always
true/false. Patch causes false positive when parameter is
modified in the function.

llvm-svn: 221163
2014-11-03 17:03:07 +00:00
Matt Arsenault 3f6469b4c6 Emit OpenCL local global variables without zeorinitializer
Local variables are not initialized, and every target has
been (incorrectly) ignoring the unnecessary request for
zero initialization.

llvm-svn: 221162
2014-11-03 16:51:53 +00:00
Hans Wennborg 8313c76836 Don't allow dllimport/export on classes with internal linkage (PR21399)
Trying to import or export such classes doesn't make sense, and Clang
would assert trying to export vtables for them.

This is consistent with how we treat functions with internal linkage,
but it is stricter than MSVC so we may have to back down if it breaks
real code.

llvm-svn: 221160
2014-11-03 16:09:16 +00:00
Daniel Jasper 82f9df9eb4 Revert "clang-format: [Java] Allow trailing semicolons after enums."
This reverts commit b5bdb2ef59ab922bcb4d6e843fffaee1f7f68a8c.

This doesn't really seem necessary on second though and causes problems
with C++ enum formatting.

llvm-svn: 221158
2014-11-03 15:42:11 +00:00
Hans Wennborg 606bd6dcc5 Don't dllimport inline functions when targeting MinGW (PR21366)
It turns out that MinGW never dllimports of exports inline functions.
This means that code compiled with Clang would fail to link with
MinGW-compiled libraries since we might try to import functions that
are not imported.

To fix this, make Clang never dllimport inline functions when targeting
MinGW.

llvm-svn: 221154
2014-11-03 14:24:45 +00:00
Craig Topper 54535fb069 [x86] Add cx16 feature to KNL, SKX, and CoreAVXi CPUs.
llvm-svn: 221132
2014-11-03 07:05:28 +00:00
Craig Topper 8dbc58436b [x86] Realphabetize the feature string decoding function since it was mostly in alphabetical order.
llvm-svn: 221131
2014-11-03 07:05:26 +00:00
Craig Topper 8c7f251e98 Add FSGSBASE intrinsics to x86 intrinsic headers.
llvm-svn: 221130
2014-11-03 06:51:41 +00:00
Craig Topper 554797f255 Remove definitions from Intrin.h that already exist in one of the other x86 intrinsic headers. Add a run line with Broadwell as the cpu type to ms-intrin.cpp test to catch some of these in the future.
llvm-svn: 221127
2014-11-03 04:19:58 +00:00
Daniel Jasper 5f2764d886 clang-format: [Java] Allow trailing semicolons after enums.
Before:
  enum SomeThing { ABC, CDE }
  ;

After:
  enum SomeThing { ABC, CDE };

llvm-svn: 221125
2014-11-03 03:00:42 +00:00
Daniel Jasper f056f45b77 clang-format: [Java] Fix more generics formatting.
Before:
  < T extends B > T getInstance(Class<T> type);

After:
  <T extends B> T getInstance(Class<T> type);

llvm-svn: 221124
2014-11-03 02:45:58 +00:00
Daniel Jasper db9a7a2f5f clang-format: [Java] Fix static generic methods.
Before:
  public static<R> ArrayList<R> get() {}

After:
  public static <R> ArrayList<R> get() {}

llvm-svn: 221122
2014-11-03 02:35:14 +00:00
Daniel Jasper 39af6cd5a4 clang-format: [Java] Fix class declaration formatting.
Before:
  @SomeAnnotation()
  abstract
      class aaaaaaaaaaaa extends bbbbbbbbbbbbbbb implements cccccccccccc {
  }

After:
  @SomeAnnotation()
  abstract class aaaaaaaaaaaa extends bbbbbbbbbbbbbbb
      implements cccccccccccc {
  }

llvm-svn: 221121
2014-11-03 02:27:28 +00:00
Daniel Jasper 8022226db7 clang-format: Fix false positive in lambda detection.
Before:
  delete [] a -> b;

After:
  delete[] a->b;

This fixes part of llvm.org/PR21419.

llvm-svn: 221114
2014-11-02 22:46:42 +00:00
Daniel Jasper df2ff002f0 clang-format: [Java] Support enums without trailing semicolon.
Before:
  class SomeClass {
    enum SomeThing { ABC, CDE } void f() {
    }
  }

After:
  class SomeClass {
    enum SomeThing { ABC, CDE }
    void f() {
    }
  }

This fixed llvm.org/PR21458.

llvm-svn: 221113
2014-11-02 22:31:39 +00:00
Daniel Jasper 5e7be1d536 clang-format: [Java] Don't break imports.
This fixes llvm.org/PR21453.

llvm-svn: 221112
2014-11-02 22:13:03 +00:00
Daniel Jasper b9d3db6b1b clang-format: [Java] Add space between "synchronized" and "(".
Before:
  synchronized(mData) {
    // ...
  }

After:
  synchronized (mData) {
    // ...
  }

This fixes llvm.org/PR21455.

llvm-svn: 221110
2014-11-02 22:00:57 +00:00
Daniel Jasper 7bd618f5aa clang-format: [Java] Support generics with "?".
Before:
  @Override
  public Map < String,
          ? > getAll() {
    // ...
  }

After:
  @Override
  public Map<String, ?> getAll() {
    // ...
  }

This fixes llvm.org/PR21454.

llvm-svn: 221109
2014-11-02 21:52:57 +00:00
Saleem Abdulrasool 4d195ed4b2 clang-format: permit setting the path to clang in vimrc
If g:clang_format_path is set in the vimrc, that path will take precedence over
the hard coded path (which is reliant on the PATH environment variable).  This
provides an easy mechanism for switching the selected clang-format binary during
development.

llvm-svn: 221108
2014-11-02 21:27:59 +00:00
Saleem Abdulrasool 8bbed0b63a docs: remove double carriage-return
The double carriage return would silence a warning due to a missing
.clang-format.  Permit the error to bubble through.

llvm-svn: 221107
2014-11-02 21:27:52 +00:00
Daniel Jasper a3ddf86dd4 clang-format: [Java] Support try/catch/finally blocks.
llvm-svn: 221104
2014-11-02 19:21:48 +00:00
Daniel Jasper 50b4bd7c0e clang-format: [Java] Don't break after extends/implements.
Before:
  abstract class SomeClass extends SomeOtherClass implements
      SomeInterface {}

After:
  abstract class SomeClass extends SomeOtherClass
      implements SomeInterface {}

llvm-svn: 221103
2014-11-02 19:16:41 +00:00
Bill Schmidt e6e9d15d5f [PowerPC] Change PPCTargetInfo::hasFeature() to use StringSwitch
Implement post-commit comment on r220989 from Eric Christopher.

llvm-svn: 221099
2014-11-02 14:56:41 +00:00
Craig Topper e1c664b136 Add _lzcnt_u32 and _lzcnt_u64 to lzcntintrin.h to match Intel documentation names for these intrinsics.
llvm-svn: 221066
2014-11-01 22:50:57 +00:00
Craig Topper a52e0d7cc0 Avoid undefined behavior in the x86 bmi header file by explicitly checking for 0 before calling __builtin_ctz. Without this the optimizers may take advantage of the undefined behavior and produce incorrect results. LLVM itself still needs to be taught to merge the zero check into the llvm.cttz with defined zero behavior.
llvm-svn: 221065
2014-11-01 22:50:54 +00:00
Craig Topper 3ca55d9c41 Avoid undefined behavior in the x86 lzcnt header file by explicitly checking for 0 before calling __builtin_clz. Without this the optimizers may take advantage of the undefined behavior and produce incorrect results. LLVM itself still needs to be taught to merge the zero check into the llvm.ctlz with defined zero behavior.
llvm-svn: 221064
2014-11-01 22:25:23 +00:00
David Majnemer 0868137ac8 CodeGen: Declutter the emitVirtualObjectDelete interface
No functionality change intended.

llvm-svn: 221043
2014-11-01 07:37:17 +00:00
David Majnemer b9bd6fb397 CodeGen: Virtual dtor thunks shouldn't have this marked as 'returned'
The ARM ABI virtual destructor thunks cannot be marked as 'returned'
because they return undef.

llvm-svn: 221042
2014-11-01 05:42:23 +00:00
NAKAMURA Takumi 8c89496d47 clang/lib/CodeGen/TargetInfo.cpp: Fix a couple of warnings. [-Winconsistent-missing-override]
llvm-svn: 221039
2014-11-01 01:32:27 +00:00
Richard Trieu 46847425c5 Fix a bug where -Wuninitialized would skip arguments to a function call.
llvm-svn: 221030
2014-11-01 00:46:54 +00:00
Reid Kleckner c311aba247 Silence a warning from MSVC "14" by making an enum unsigned
It says there is a narrowing conversion when we assign it to an unsigned
3 bit bitfield.

Also, use unsigned instead of size_t for the Size field of the struct in
question. Otherwise they won't run together in MSVC or clang-cl.

llvm-svn: 221019
2014-10-31 23:33:56 +00:00
Kaelyn Takata 4e43de4fad Fix an accidental self-assignment using std::move in r220723.
llvm-svn: 221008
2014-10-31 22:25:09 +00:00
Reid Kleckner 80944df6f4 Implement IRGen for the x86 vectorcall convention
The most complex aspect of the convention is the handling of homogeneous
vector and floating point aggregates.  Reuse the homogeneous aggregate
classification code that we use on PPC64 and ARM for this.

This convention also has a C mangling, and we apparently implement that
in both Clang and LLVM.

Reviewed By: majnemer

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

llvm-svn: 221006
2014-10-31 22:00:51 +00:00
Fariborz Jahanian a6556f7295 Objective-C SDK modernization tool. Use its own option
,-objcmt-migrate-property-dot-syntax, when migarting to use
property-dot syntax in place of messaging expression.
rdar://18839124

llvm-svn: 221001
2014-10-31 21:19:45 +00:00
Richard Trieu d4a0136002 Have -Wuninitialized catch uninitalized use in overloaded operator arguments.
llvm-svn: 221000
2014-10-31 21:10:22 +00:00
Anton Yartsev 5ad0169855 [analyzer] Helpful hints for Windows users of scan-build.
llvm-svn: 220999
2014-10-31 20:57:57 +00:00
David Majnemer 0c0b6d9ac6 MS ABI: Properly call global delete when invoking virtual destructors
Summary:
The Itanium ABI approach of using offset-to-top isn't possible with the
MS ABI, it doesn't have that kind of information lying around.

Instead, we do the following:
- Call the virtual deleting destructor with the "don't delete the object
  flag" set.  The virtual deleting destructor will return a pointer to
  'this' adjusted to the most derived class.
- Call the global delete using the adjusted 'this' pointer.

Reviewers: rnk

Subscribers: cfe-commits

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

llvm-svn: 220993
2014-10-31 20:09:12 +00:00
Fariborz Jahanian 6e21338abb C++-11 [qoi]. Do not warn on missing 'verride' on use of
macros in user code when macros themselves are defined
in a system header. rdar://18295240

llvm-svn: 220992
2014-10-31 19:56:27 +00:00
Bill Schmidt 691e01d94e [PowerPC] Initial VSX intrinsic support, with min/max for vector double
Now that we have initial support for VSX, we can begin adding
intrinsics for programmer access to VSX instructions.  This patch
performs the necessary enablement in the front end, and tests it by
implementing intrinsics for minimum and maximum using the vector
double data type.

The main change in the front end is to no longer disallow "vector" and
"double" in the same declaration (lib/Sema/DeclSpec.cpp), but "vector"
and "long double" must still be disallowed.  The new intrinsics are
accessed via vec_max and vec_min with changes in
lib/Headers/altivec.h.  Note that for v4f32, we already access
corresponding VMX builtins, but with VSX enabled we should use the
forms that allow all 64 vector registers.

The new built-ins are defined in include/clang/Basic/BuiltinsPPC.def.

I've added a new test in test/CodeGen/builtins-ppc-vsx.c that is
similar to, but much smaller than, builtins-ppc-altivec.c.  This
allows us to test VSX IR generation without duplicating CHECK lines
for the existing bazillion Altivec tests.

Since vector double is now legal when VSX is available, I've modified
the error message, and changed where we test for it and for vector
long double, since the target machine isn't visible in the old place.
This serendipitously removed a not-pertinent warning about 'long'
being deprecated when used with 'vector', when "vector long double" is
encountered and we just want to issue an error.  The existing tests
test/Parser/altivec.c and test/Parser/cxx-altivec.cpp have been
updated accordingly, and I've added test/Parser/vsx.c to verify that
"vector double" is now legitimate with VSX enabled.

There is a companion patch for LLVM.

llvm-svn: 220989
2014-10-31 19:19:24 +00:00
Kostya Serebryany 5f1b4e8f58 ignore -mconstructor-aliases when adding field paddings for asan
Summary:
When we are adding field paddings for asan even an empty dtor has to remain in the code,
so we ignore -mconstructor-aliases if the paddings are going to be added.

Test Plan: added a test

Reviewers: rsmith, rnk, rafael

Reviewed By: rafael

Subscribers: cfe-commits

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

llvm-svn: 220986
2014-10-31 19:01:02 +00:00