Commit Graph

57058 Commits

Author SHA1 Message Date
Richard Smith 4a7e390c12 [modules] Don't write out name lookup table entries merely because the module
happened to query them; only write them out if something new was added.

llvm-svn: 230727
2015-02-27 03:40:09 +00:00
David Majnemer 5bc883f39e MS ABI: Simplify the code which performs base adjustments
llvm-svn: 230722
2015-02-27 02:38:02 +00:00
Nico Weber 5339a52c9a Add last missing __leave test.
llvm-svn: 230720
2015-02-27 02:26:14 +00:00
Nico Weber 497bf5587e Add another __leave test.
llvm-svn: 230717
2015-02-27 01:58:08 +00:00
Richard Smith f81c2cc6ca [modules] For an inheriting constructor, the inherited constructor is stored in
a map keyed off the canonical declaration. Don't try to set it if we're loading
some non-canonical merged declaration.

llvm-svn: 230716
2015-02-27 01:57:00 +00:00
Richard Smith 0b88437ebd [modules] When loading in multiple canonical definitions of a template,
accumulate the set of specializations rather than overwriting one list
with another.

llvm-svn: 230712
2015-02-27 00:25:58 +00:00
Nico Weber ff62a6a0b7 Don't crash on leaving nested __finally blocks through an EH edge.
The __finally emission block tries to be clever by removing unused continuation
edges if there's an unconditional jump out of the __finally block. With
exception edges, the EH continuation edge isn't always unused though and we'd
crash in a few places.

Just don't be clever. That makes the IR for __finally blocks a bit longer in
some cases (hence small and behavior-preserving changes to existing tests), but
it makes no difference in general and it fixes the last crash from PR22553.

http://reviews.llvm.org/D7918

llvm-svn: 230697
2015-02-26 22:34:33 +00:00
Nico Weber 6307cf0aa3 Wrap to 80 columns. No behavior change.
llvm-svn: 230682
2015-02-26 20:43:00 +00:00
Reid Kleckner 3c6963b806 Add myself as a code owner for Microsoft C++ ABI code and general Windows support
Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 230681
2015-02-26 20:37:49 +00:00
Reid Kleckner 9fde2e013e Win64: Silently ignore __stdcall, __fastcall, and __thiscall
MSVC doesn't warn on this. Users are expected to apply the WINAPI macro
to functions passed by pointer to the Win32 API, and this macro expands
to __stdcall. This means we end up with a lot of useless noisy warnings
about ignored calling conventions when compiling code with clang for
Win64.

llvm-svn: 230668
2015-02-26 19:43:46 +00:00
Filipe Cabecinhas a076430ba9 Add -frtti/-fexceptions to some more tests that assume they're on
llvm-svn: 230656
2015-02-26 18:29:41 +00:00
Petar Jovanovic d55ae6ba37 Add support for generating MIPS legacy NaN
Currently, the NaN values emitted for MIPS architectures do not cover
non-IEEE754-2008 compliant case. This change fixes the issue.

Patch by Vladimir Radosavljevic.

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

llvm-svn: 230653
2015-02-26 18:19:22 +00:00
Fariborz Jahanian 947efbc138 Patch to prevent crash when default argument expression
is null due to its previous bad declaration, etc.
rdar://19871240

llvm-svn: 230649
2015-02-26 17:59:54 +00:00
Evgeniy Stepanov 6e09bca0ef [msan] Change track-origins default mode from 1 to 2.
Change -fsanitize-memory-track-origins to be equivalent to
-fsanitize-memory-track-origins=2.

Track-origins=2 provides a lot more detailed reports at the cost of
some additional slowdown (ranging from none to, sometimes, 3x; ~3% average on
SPEC2006).

llvm-svn: 230644
2015-02-26 15:59:30 +00:00
Daniel Jasper b812e323fa clang-format: Make braced list formatting more consistent.
Before:
  Aaaa aaaaaaaaaaa{
      {
       a, // +1 indent weird.
       b, // trailing comma signals one per line.
      },  // trailing comma signals one per line.
  };

After:
  Aaaa aaaaaaaaaaa{
      {
          a, // better!?
          b, // trailing comma signals one per line.
      },     // trailing comma signals one per line.
  };

Interesting that this apparently was entirely untested :-(.

llvm-svn: 230627
2015-02-26 11:46:29 +00:00
Daniel Jasper beaa322c36 clang-format: Fix space of arrays of pointers to templated types.
Before:
  vector<int>(*foo_)[6];

After:
  vector<int> (*foo_)[6];

llvm-svn: 230625
2015-02-26 11:30:50 +00:00
Alexey Bataev 8cbe0a6b62 [OPENMP] Fixed codegen for directives without function outlining.
Fixed crash on codegen for directives like 'omp for', 'omp single' etc. inside of the 'omp parallel', 'omp task' etc. regions.

llvm-svn: 230621
2015-02-26 10:27:34 +00:00
Daniel Jasper a42de763ac clang-format: Allow breaking after "else if(" as a last resort.
This isn't generally nice, but better than violating the column limit.

llvm-svn: 230620
2015-02-26 09:49:08 +00:00
Craig Topper ac0d58bc4c [X86] Remove the blendps/blendpd builtins. They aren't used by the intrinsic headers. We use appropriate shuffle vector instead.
llvm-svn: 230616
2015-02-26 08:09:05 +00:00
Craig Topper 1e2f885a03 [X86] Correct immediate range checking for blendps/blendpd/blendpd256 builtins.
llvm-svn: 230615
2015-02-26 06:23:15 +00:00
Simon Atanasyan 59b25cbeaa [Mips] Handle -mips32r[3|5] / -mips64r[3|5] options while selecting lib/headers paths
There is no supported toolchain which provides headers / libs / object
files specific to the mips32r[3|5] and mips64r[3|5] ISA. So select "r2"
specific folders when they are available.

http://reviews.llvm.org/D7879

llvm-svn: 230611
2015-02-26 04:45:57 +00:00
Duncan P. N. Exon Smith a346e03084 CGDebugInfo: Use DIImportedEntity default constructor, NFC
Use the newly minted `DIImportedEntity` default constructor (r230609)
rather than explicitly specifying `nullptr`.  The latter will become
ambiguous when the new debug info hierarchy is committed, since we'll
have both of the following:

    explicit DIImportedEntity(const MDNode *);
    DIImportedEntity(const MDImportedEntity *);

(Currently we just have the former.)

A default constructor is just as clear.

llvm-svn: 230610
2015-02-26 04:44:27 +00:00
Richard Trieu 555c9673fd Update assumption in template diffing about integer template arguments.
Fix for PR22017.  Integer template arguments are automatically bit extended to
the size of the integer type.  In template diffing, evaluated expressions were
not having their results extending, leading to comparing two APSInt's with
different widths.  Apply the proper bit extending when evaluating template
arguments.  This mainly affected bool template arguments.

llvm-svn: 230603
2015-02-26 02:40:48 +00:00
Richard Smith f609a1db58 Split StaticAnalyzer module into three to fix a cyclic dependency. Dependencies
are now:

  FrontendTool -> StaticAnalyzer/Frontend -> Frontend -> StaticAnalyzer/Core

The final dependency edge here is probably removable: AnalyzerOptions (and
Analyses.def) should probably live in Basic rather than StaticAnalyzer/Core.

llvm-svn: 230600
2015-02-26 01:11:08 +00:00
Reid Kleckner bd92dbacee clang-cl: Expose -fcolor-diagnostics and -fansi-escape-codes
They don't conflict with MSVC flags.

llvm-svn: 230598
2015-02-26 01:10:15 +00:00
David Majnemer 5123664431 Sema: __assume with side effects shouldn't result in invalid AST nodes
We'd diagnose an __assume expression which contained a function call.
This would result in us wrongly returning ExprError, causing mysterious
failures later on.

llvm-svn: 230597
2015-02-26 00:57:33 +00:00
Reid Kleckner d6aab731e0 Silence unused variable warning in NDEBUG build
llvm-svn: 230590
2015-02-26 00:33:41 +00:00
Eric Christopher 8213f7f87d Fix a [-Werror,-Wreorder] initialization ordering error.
llvm-svn: 230589
2015-02-26 00:29:54 +00:00
Peter Collingbourne 4b0924dad6 docs: Document CFI padding and all-ones optimizations. Link to viewvc.
llvm-svn: 230588
2015-02-26 00:18:04 +00:00
Reid Kleckner 1df0fea593 Add -fuse-line-directive flag to control usage of #line with -E
Currently -fms-extensions controls this behavior, which doesn't make
much sense. It means we can't identify what is and isn't a system header
when compiling our own preprocessed output, because #line doesn't
represent this information.

If someone is feeding Clang's preprocessed output to another compiler,
they can use this flag.

Fixes PR20553.

Reviewers: rsmith

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

llvm-svn: 230587
2015-02-26 00:17:25 +00:00
Richard Smith ebdfc00995 Remove some unused includes of llvm/IR headers from parts of Clang that really
shouldn't depend on LLVM IR.

llvm-svn: 230586
2015-02-26 00:01:03 +00:00
Larisse Voufo 697b32a0cb Improvement on sized deallocation from r230160:
Do not declare sized deallocation functions dependently on whether it is found in global scope. Instead, enforce the branching in emitted code by (1) declaring the functions extern_weak and (2) emitting sized delete expressions as a branching between both forms delete.

llvm-svn: 230580
2015-02-25 23:48:43 +00:00
Larisse Voufo 17151eba64 Fix typo.
llvm-svn: 230579
2015-02-25 23:48:35 +00:00
Larisse Voufo 351f309dab Move -fdefine-sized-deallocation and -fno-sized-deallocation options from driver into CC1 for now.
llvm-svn: 230577
2015-02-25 23:48:25 +00:00
Peter Collingbourne 69b004d987 UBSan: Use the correct function prologue for x32.
llvm-svn: 230571
2015-02-25 23:18:42 +00:00
David Majnemer dbdab4037e MS ABI: Turn throw into std::terminate for now, make try/catch "work"
This lets us compile programs which make use of exceptional constructs
statically without executing any of them dynamically.

llvm-svn: 230568
2015-02-25 23:01:21 +00:00
Richard Smith 8cebe37fe9 [modules] Even if we already have a definition of a class, loading in another
one can give us more lookup results (due to implicit special members). Be sure
to complete the redecl chain for every kind of DeclContext before performing a
lookup into it, rather than only doing so for NamespaceDecls.

llvm-svn: 230558
2015-02-25 22:20:13 +00:00
Richard Smith 4a2ceea193 Remove non-existent file from module map.
llvm-svn: 230538
2015-02-25 20:20:39 +00:00
Ben Langmuir 443aa4b4b0 Allow (Object *)kMyGlobalCFObj casts without bridging
Previously we allowed these casts only for constants declared in system
headers, which we assume are retain/release-neutral. Now also allow them
for constants in user headers, treating them as +0.  Practically, this
means that we will now allow:
id x = (id)kMyGlobalConst;

But unlike with system headers we cannot mix them with +1 values:
id y = (id)(b ? kMyGlobalConst : [Obj newValAtPlusOne]); // error
id z = (id)(b ? kSystemGlobalConst: [Obj newValAtPlusOne]); // OK

Thanks to John for suggesting this improvement.

llvm-svn: 230534
2015-02-25 20:09:06 +00:00
Richard Smith f42e1eca9f Add missing #include found by modules buildbot.
llvm-svn: 230532
2015-02-25 19:55:49 +00:00
Reid Kleckner c00927cd20 clang-cl: Ignore /Fd silently
While it's true that we don't create the PDB as requested on the command
line, this is a well-documented limitation. Warning about it doesn't
help people using legacy build systems with clang-cl, and it makes the
clang-cl self-host very noisy.

llvm-svn: 230527
2015-02-25 19:17:50 +00:00
Reid Kleckner 1cbd9aa96d Reland (2x) r230314, "Fix codegen for virtual methods that are (re-) exported from multiple modules."
This reverts commits r230477 and r230478.

llvm-svn: 230526
2015-02-25 19:17:48 +00:00
Reid Kleckner 8b6d034cab Reland r230446, "MS ABI: Try to respect external AST source record layouts"
It broke test/PCH/headersearch.cpp because it was using -Wpadding, which
only works for Itanium layout. Before this commit, we would use Itanium
record layout when using PCH, which is crazy. Now that the test uses an
explicit Itanium triple, we can reland.

llvm-svn: 230525
2015-02-25 19:17:45 +00:00
Reid Kleckner c22fe1299a Use Itanium triple in test using -Wpadding
-Wpadding is not implemented in the Microsoft record layout builder.
This test only passes on Windows because PCH forces us to use the
Itanium record layout builder. I'm about to fix that, so change the
test to not rely on that ridiculous behavior.

llvm-svn: 230524
2015-02-25 19:04:51 +00:00
Nico Weber d9b8bd6b86 Make __leave test pass in -Asserts builds.
llvm-svn: 230514
2015-02-25 17:44:04 +00:00
David Majnemer ced8bdf74a Sema: Parenthesized bound destructor member expressions can be called
We would wrongfully reject (a.~A)() in both the destructor and
pseudo-destructor cases.

This fixes PR22668.

llvm-svn: 230512
2015-02-25 17:36:15 +00:00
Nico Weber e68b9f3e0a Reland r230460 with a test fix for -Asserts builds.
Original CL description:
Produce less broken basic block sequences for __finally blocks.

The way cleanups (such as PerformSEHFinally) get emitted is that codegen
generates some initialization code, then calls the cleanup's Emit() with the
insertion point set to a good place, then the cleanup is supposed to emit its
stuff, and then codegen might tack in a jump or similar to where the insertion
point is after the cleanup.

The PerformSEHFinally cleanup tries to just stash away the block it's supposed
to codegen into, and then does codegen later, into that stashed block.  However,
after codegen'ing the __finally block, it used to set the insertion point to
the finally's continuation block (where the __finally cleanup goes when its body
is completed after regular, non-exceptional control flow).  That's not correct,
as that block can (and generally does) already ends in a jump.  Instead,
remember the insertion point that was current before the __finally got emitted,
and restore that.

Fixes two of the crashes in PR22553.

llvm-svn: 230503
2015-02-25 16:25:00 +00:00
Alexander Kornienko a9b01eb776 Add support for inserting ArrayRef<FixItHint> into DiagnosticBuilder.
This is going to be needed in clang-tidy as more checks add complex fixits.

llvm-svn: 230495
2015-02-25 14:40:56 +00:00
NAKAMURA Takumi b01d86b315 Fix UTF8 chars to ASCII.
llvm-svn: 230479
2015-02-25 11:02:00 +00:00
NAKAMURA Takumi 073f2b4795 Whitespace.
llvm-svn: 230478
2015-02-25 10:50:06 +00:00