Commit Graph

55390 Commits

Author SHA1 Message Date
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
Daniel Jasper e9ab42df0c clang-format: [Java] Improve line breaks around annotations.
Before:
  @SomeAnnotation("With some really looooooooooooooong text") private static final
      long something = 0L;

  void SomeFunction(@Nullable
                    String something) {}

After:
  @SomeAnnotation("With some really looooooooooooooong text")
  private static final long something = 0L;

  void SomeFunction(@Nullable String something) {}

llvm-svn: 220984
2014-10-31 18:23:49 +00:00
Daniel Jasper f739b0dbfa clang-format: [js] Updates to Google's JavaScript style.
The style guide is changing..

llvm-svn: 220977
2014-10-31 17:50:40 +00:00
Anna Zaks 8a020310b8 [analyzer] Rename NewDeleteLeaks checker in the test script.
Fixup to r220289.

llvm-svn: 220976
2014-10-31 17:40:14 +00:00
David Blaikie 11ab078d80 Fix the build
llvm-svn: 220974
2014-10-31 17:18:09 +00:00
Reid Kleckner e9f6a717dd Fix ARM HVA classification of classes with non-virtual bases
Reuse the PPC64 HVA detection algorithm for ARM and AArch64. This is a
nice code deduplication, since they are roughly identical. A few virtual
method extension points are needed to understand how big an HVA can be
and what element types it can have for a given architecture.

Also make the record expansion code work in the presence of non-virtual
bases.

Reviewed By: uweigand, asl

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

llvm-svn: 220972
2014-10-31 17:10:41 +00:00
David Blaikie 9491a5cd4d Fix unused-function warning differently from r220853
Rather than executing this code only needed for an assertion even in a
non-asserts build, just roll the function into the assert. The assertion
text literally describes the two cases so it doesn't seem like this
benefits much from having a separate function (& have to hassle about
ifndef NDEBUG it out, etc)

llvm-svn: 220970
2014-10-31 17:08:11 +00:00
Argyrios Kyrtzidis 06e8d69ac7 [libclang] Disable spell-checking and warnings during code-completion since they are not needed.
llvm-svn: 220966
2014-10-31 16:44:32 +00:00
Argyrios Kyrtzidis d92da47707 [Makefile] If ENABLE_CLANG_ARCMT=0 it seems we don't build libclang, so the unittests for libclang should be disabled too.
This is a modified patch provided by Vassil Vassilev.

llvm-svn: 220965
2014-10-31 16:44:30 +00:00
Craig Topper c79e5e3432 Remove StorageClass typedefs from VarDecl and FunctionDecl since StorageClass is in the clang namespace.
llvm-svn: 220956
2014-10-31 06:57:13 +00:00
Craig Topper 1a07fd1845 Remove CastKind typedef from CastExpr since CastKind is in the clang namespace.
llvm-svn: 220955
2014-10-31 06:57:10 +00:00
Craig Topper 9ad7e26651 Remove a couple typedefs for things in the clang namespace with the same name. Remove a typedef that matches an identical one in the clang namespace.
llvm-svn: 220954
2014-10-31 06:57:07 +00:00
Hao Liu 6d45b8c385 [AArch64]Add 2 intrinsics vmov_n_p64/vmovq_n_p64, the alias for vdup_n_p64/vdup_n_p64.
As this change is too small, commit it directly.

llvm-svn: 220946
2014-10-31 02:41:37 +00:00
Richard Smith 1e2cf0dd4b [modules] When a .pcm file is explicitly built separately from the translation
unit, allow the -O settings of the two compilations to differ.

llvm-svn: 220943
2014-10-31 02:28:58 +00:00
Richard Smith d5e7ff856c Make QualType::dump() produce a useful dump of the structure of the type,
rather than simply pretty-printing it.

llvm-svn: 220942
2014-10-31 01:17:45 +00:00
NAKAMURA Takumi c73e402ad2 ASTDumper.cpp: Appease g++, for now.
llvm-svn: 220940
2014-10-31 00:30:37 +00:00
Kuba Brecka 2735a02572 Rename 'DarwinStaticLib' to 'DarwinLibName'
The former name doesn't make sense, we are using this parameter for both .a and .dylib libraries.

No functional change.

http://reviews.llvm.org/D6040

llvm-svn: 220939
2014-10-31 00:08:57 +00:00
Richard Smith f7514454a7 Refactor tree printing in AST dumping.
Instead of manually maintaining a flag indicating whether we're about to print
out the last child of the parent node (to determine whether we print "`" or
"|"), capture a callable to print that child and defer printing it until we
either see a next child or finish the parent.

No functionality change intended.

llvm-svn: 220930
2014-10-30 21:02:37 +00:00
Alexey Samsonov 035462c1cf Get rid of SanitizerOptions::Disabled global. NFC.
SanitizerOptions is not even a POD now, so having global variable of
this type, is not nice. Instead, provide a regular constructor and clear()
method, and let each CodeGenFunction has its own copy of SanitizerOptions
it uses.

llvm-svn: 220920
2014-10-30 19:33:44 +00:00