Ed Maste [Mon, 26 May 2014 13:57:15 +0000 (13:57 +0000)]
Use MIUtilSystemLinux on FreeBSD as well
We should later rename this file (probably MIUtilSystemPOSIX), but
more clean-up is still needed here, and we can wait until we better
understand how this code may be shared between FreeBSD, Linux, and OS X.
llvm-svn: 209631
Ed Maste [Mon, 26 May 2014 13:48:38 +0000 (13:48 +0000)]
Add missing header
Presumably included by header leakage on other platforms.
llvm-svn: 209630
Timur Iskhodzhanov [Mon, 26 May 2014 13:44:57 +0000 (13:44 +0000)]
[ASan tests] Use ASAN_OPTIONS in a portable way
llvm-svn: 209629
Rafael Espindola [Mon, 26 May 2014 13:38:51 +0000 (13:38 +0000)]
Convert a few loops to use ranges.
llvm-svn: 209628
Tilmann Scheller [Mon, 26 May 2014 13:36:47 +0000 (13:36 +0000)]
[AArch64] Add store + add folding regression tests for the load/store optimization pass.
Add tests for the following transform:
str X, [x0, #32]
...
add x0, x0, #32
->
str X, [x0, #32]!
with X being either w1, x1, s0, d0 or q0.
llvm-svn: 209627
Daniel Jasper [Mon, 26 May 2014 13:10:39 +0000 (13:10 +0000)]
clang-format: Split up moveStateToNextToken.
No functional changes intended.
llvm-svn: 209626
Sergey Matveev [Mon, 26 May 2014 13:08:08 +0000 (13:08 +0000)]
[MSan] Implement __sanitizer_print_stack_trace().
llvm-svn: 209625
Tilmann Scheller [Mon, 26 May 2014 12:15:51 +0000 (12:15 +0000)]
[AArch64] Add more regression tests for the load/store optimization pass.
Cover the following cases:
ldr X, [x0, #32]
...
add x0, x0, #32
->
ldr X, [x0, #32]!
with X being either w1, x1, s0, d0 or q0.
llvm-svn: 209624
Kostya Serebryany [Mon, 26 May 2014 11:57:16 +0000 (11:57 +0000)]
[asan] decrease asan-instrumentation-with-call-threshold from 10000 to 7000, see PR17409
llvm-svn: 209623
Timur Iskhodzhanov [Mon, 26 May 2014 11:54:20 +0000 (11:54 +0000)]
[ASan/Win tests] Remove the extra 'cat' in front of FileCheck now that it's clear we should use GnuWin32 rather than Cygwin on the PATH on Windows (see PR19744)
llvm-svn: 209622
Tim Northover [Mon, 26 May 2014 11:25:33 +0000 (11:25 +0000)]
AArch64: remove empty ARM64 directories from svn.
llvm-svn: 209621
Timur Iskhodzhanov [Mon, 26 May 2014 11:25:32 +0000 (11:25 +0000)]
[ASan/Win tests] Use the env keyword in the SUAR tests to work with gnuwin/lit correctly
llvm-svn: 209620
Tilmann Scheller [Mon, 26 May 2014 09:40:40 +0000 (09:40 +0000)]
Remove accidentally committed whitespace.
llvm-svn: 209619
Tilmann Scheller [Mon, 26 May 2014 09:37:19 +0000 (09:37 +0000)]
[AArch64] Add a regression test for the load store optimizer.
We have a couple of regression tests for load/store pairing, but (to my knowledge) there are no regression tests for the load/store + add/sub folding.
As a first step towards increased test coverage of this area, this commit adds a test for one instance of a load + add to pre-indexed load transformation.
llvm-svn: 209618
Owen Anderson [Mon, 26 May 2014 08:58:51 +0000 (08:58 +0000)]
Make the LoopRotate pass's maximum header size configurable both programmatically
and via the command line, mirroring similar functionality in LoopUnroll. In
situations where clients used custom unrolling thresholds, their intent could
previously be foiled by LoopRotate having a hardcoded threshold.
llvm-svn: 209617
Simon Atanasyan [Mon, 26 May 2014 08:32:38 +0000 (08:32 +0000)]
[Mips] Do not count global GOT entries using the separate variable. Use
size of global GOT entries map for that.
llvm-svn: 209616
Daniel Jasper [Mon, 26 May 2014 07:24:34 +0000 (07:24 +0000)]
clang-format: Keep '{' of dict literals on the same line in Allman style
Before:
void f()
{
[object
someMethod:@
{ @"a" : @"b" }];
}
After:
void f()
{
[object someMethod:@{ @"a" : @"b" }];
}
This fixes llvm.org/PR19854.
llvm-svn: 209615
David Blaikie [Mon, 26 May 2014 06:44:52 +0000 (06:44 +0000)]
DebugInfo: Test linkonce-odr functions under LTO.
This was previously regressed/broken by r192749 (reverted due to this
issue in r192938) and I was about to break it again by accident with
some more invasive changes that deal with the subprogram lists. So to
avoid that and further issues - here's a test.
It's a pretty basic test - in both r192749 and my impending case, this
test would crash, but checking the basics (that we put a subprogram in
just one of the two CUs) seems like a good start.
We still get this wrong in weird ways if the linkonce-odr function
happens to not be identical in the metadata (because it's defined in two
different files (hence the # line directives in this test), etc) even
though it meets the language requirements (identical token stream) for
such a thing. That results in two subprogram DIEs, but only one of them
gets the parameter and high/low pc information, etc. We probably need to
use the DIRef infrastructure to deduplicate functions as we do types to
address this issue - or perhaps teach the BC linker to remove the
duplicate entries in subprogram lists?
llvm-svn: 209614
Craig Topper [Mon, 26 May 2014 06:22:03 +0000 (06:22 +0000)]
[C++11] Use 'nullptr'. Sema edition.
llvm-svn: 209613
Craig Topper [Mon, 26 May 2014 06:21:51 +0000 (06:21 +0000)]
[C++11] Use 'nullptr'.
llvm-svn: 209612
David Blaikie [Mon, 26 May 2014 05:32:21 +0000 (05:32 +0000)]
DwarfUnit: Remove some misleading no-op code introduced in r204162.
Post commit review feedback from Manman called this out, but it looks
like it slipped through the cracks.
llvm-svn: 209611
Rafael Espindola [Mon, 26 May 2014 04:08:51 +0000 (04:08 +0000)]
Just check the entire string.
Thanks to David Blaikie for the suggestion.
llvm-svn: 209610
NAKAMURA Takumi [Mon, 26 May 2014 00:25:26 +0000 (00:25 +0000)]
Reformat linefeeds.
llvm-svn: 209609
NAKAMURA Takumi [Mon, 26 May 2014 00:25:09 +0000 (00:25 +0000)]
Trailing whitespace.
llvm-svn: 209608
Saleem Abdulrasool [Sun, 25 May 2014 21:37:59 +0000 (21:37 +0000)]
tools: avoid use of std::function
Remove the use of the std::function and replace the capturing lambda with a
non-capturing one, opting to pass the user data down to the context. This is
needed as std::function is not yet available on all hosted platforms (it
requires RTTI, which breaks on Windows).
Thanks to Nico Rieck for pointing this out!
llvm-svn: 209607
Saleem Abdulrasool [Sun, 25 May 2014 20:26:45 +0000 (20:26 +0000)]
tools: split out Win64EHDumper from COFFDumper
Move the implementation of the Win64 EH printer from the COFFDumper into its own
class. This is in preparation for adding support to print ARM EH information.
The only real change here is in printUnwindInfo where we now lambda lift the
implicit this parameter for the resolveFunction. Also setup the printing to
handle ARM. This now has set the stage to introduce ARM EH printing.
llvm-svn: 209606
Saleem Abdulrasool [Sun, 25 May 2014 20:26:40 +0000 (20:26 +0000)]
tools: inline simple single-use function
This inlines the single use function in preparation for splitting the Win64EH
printing out of the COFFDumper into its own entity.
llvm-svn: 209605
Saleem Abdulrasool [Sun, 25 May 2014 20:26:37 +0000 (20:26 +0000)]
tools: refactor COFFDumper symbol resolution logic
Make the use of the cache more transparent to the users. There is no reason
that the cached entries really need to be passed along. The overhead for doing
so is minimal: a single extra parameter. This requires that some standalone
functions be brought into the COFFDumper class so that they may access the
cache.
llvm-svn: 209604
Saleem Abdulrasool [Sun, 25 May 2014 20:26:33 +0000 (20:26 +0000)]
tools: use references rather than out pointers in COFFDumper
Switch to use references for parameters that are guaranteed to be non-null.
Simplifies the code a slight bit in preparation for another change.
llvm-svn: 209603
David Blaikie [Sun, 25 May 2014 18:11:35 +0000 (18:11 +0000)]
DebugInfo: Fix inlining with #file directives a little harder
Seems my previous fix was insufficient - we were still not adding the
inlined function to the abstract scope list. Which meant it wasn't
flagged as inline, didn't have nested lexical scopes in the abstract
definition, and didn't have abstract variables - so the inlined variable
didn't reference an abstract variable, instead being described
completely inline.
llvm-svn: 209602
David Blaikie [Sun, 25 May 2014 15:38:52 +0000 (15:38 +0000)]
Streamline test case by avoiding a temporary file and piping llc output straight to llvm-dwarfdump
We still do temporary files in many cases, just updating this particular
one because I was debugging it and made this change while doing so.
llvm-svn: 209601
Rafael Espindola [Sun, 25 May 2014 12:49:07 +0000 (12:49 +0000)]
Emit data or code export directives based on the type.
Currently we look at the Aliasee to decide what type of export
directive to use. It seems better to use the type of the alias
directly. This is similar to how we handle the alias having the
same address but other attributes (linkage, visibility) from the
aliasee.
With this patch it is now possible to do things like
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"
@foo = global [6 x i8] c"\B8*\00\00\00\C3", section ".text", align 16
@f = dllexport alias i32 (), [6 x i8]* @foo
!llvm.module.flags = !{!0}
!0 = metadata !{i32 6, metadata !"Linker Options", metadata !1}
!1 = metadata !{metadata !2, metadata !3}
!2 = metadata !{metadata !"/DEFAULTLIB:libcmt.lib"}
!3 = metadata !{metadata !"/DEFAULTLIB:oldnames.lib"}
llvm-svn: 209600
Rafael Espindola [Sun, 25 May 2014 12:43:13 +0000 (12:43 +0000)]
Make these CHECKs a bit more strict.
The " at the end of the line makes sure we matched the entire directive.
llvm-svn: 209599
Nico Rieck [Sun, 25 May 2014 10:35:03 +0000 (10:35 +0000)]
Sema: Add dll attribute tests for member functions
llvm-svn: 209598
Nico Rieck [Sun, 25 May 2014 10:34:36 +0000 (10:34 +0000)]
Sema: Add dll attribute tests for variable templates
llvm-svn: 209597
Nico Rieck [Sun, 25 May 2014 10:34:16 +0000 (10:34 +0000)]
IRGen: Add more tests for dll attributes
llvm-svn: 209596
Peter Collingbourne [Sun, 25 May 2014 10:27:02 +0000 (10:27 +0000)]
Add an extension point for peephole optimizers.
This extension point allows adding passes that perform peephole optimizations
similar to the instruction combiner. These passes will be inserted after
each instance of the instruction combiner pass.
Differential Revision: http://reviews.llvm.org/D3905
llvm-svn: 209595
Simon Atanasyan [Sun, 25 May 2014 10:07:04 +0000 (10:07 +0000)]
[Mips] Reduce code duplication. Join relocation handling functions which
perform calculations for R_MIPS_GOT16 and R_MIPS_CALL16 relocations.
llvm-svn: 209594
Simon Atanasyan [Sun, 25 May 2014 09:05:06 +0000 (09:05 +0000)]
[Mips] Factor out the code assign a value to the absolute atom into the
separate function.
llvm-svn: 209593
Simon Atanasyan [Sun, 25 May 2014 09:04:57 +0000 (09:04 +0000)]
[Mips] Factor out the code create Mips specific runtime file into
the MipsELFWriters member function.
llvm-svn: 209592
Simon Atanasyan [Sun, 25 May 2014 09:04:45 +0000 (09:04 +0000)]
[Mips] Remove unused class member declaration.
llvm-svn: 209591
Simon Atanasyan [Sun, 25 May 2014 09:04:15 +0000 (09:04 +0000)]
[Mips] Reduce code duplication. Join relocation handling functions which
perform similar calculations.
llvm-svn: 209590
Hans Wennborg [Sat, 24 May 2014 20:19:40 +0000 (20:19 +0000)]
Fix some misplaced spaces around 'override'
llvm-svn: 209589
Hans Wennborg [Sat, 24 May 2014 20:18:32 +0000 (20:18 +0000)]
Fix some misplaced spaces around 'override'
llvm-svn: 209588
Saleem Abdulrasool [Sat, 24 May 2014 20:04:21 +0000 (20:04 +0000)]
build: sort llvm-readobj sources
Sort the source files. NFC.
llvm-svn: 209587
Saleem Abdulrasool [Sat, 24 May 2014 19:54:28 +0000 (19:54 +0000)]
llvm-readobj: remove some dead code
llvm-svn: 209586
Tim Northover [Sat, 24 May 2014 19:45:41 +0000 (19:45 +0000)]
AArch64: disable FastISel for large code model.
The code emitted is what would be expected for the small model, so it
shouldn't be used when objects can be the full 64-bits away.
This fixes MCJIT tests on Linux.
llvm-svn: 209585
Andreas Simbuerger [Sat, 24 May 2014 18:51:14 +0000 (18:51 +0000)]
ScopDetectionDiagnostic: Update Makefile
llvm-svn: 209584
NAKAMURA Takumi [Sat, 24 May 2014 17:22:01 +0000 (17:22 +0000)]
ClangTidyOptionsTest.cpp: Rewrite literals. Raw string literals are unavailable on msc17.
llvm-svn: 209583
Simon Atanasyan [Sat, 24 May 2014 16:45:31 +0000 (16:45 +0000)]
[Mips] Handle R_MIPS_TLS_TPREL_HI16 / R_MIPS_TLS_TPREL_LO16 relocations.
llvm-svn: 209582
Benjamin Kramer [Sat, 24 May 2014 13:31:10 +0000 (13:31 +0000)]
MachineVerifier: Clean up some syntactic weirdness left behind by find&replace.
No functionality change.
llvm-svn: 209581
Benjamin Kramer [Sat, 24 May 2014 13:13:17 +0000 (13:13 +0000)]
CodeGen: Make MachineBasicBlock::back skip to the beginning of the last bundle.
This makes front/back symmetric with begin/end, avoiding some confusion.
Added instr_front/instr_back for the old behavior, corresponding to
instr_begin/instr_end. Audited all three in-tree users of back(), all
of them look like they don't want to look inside bundles.
Fixes an assertion (PR19815) when generating debug info on mips, where a
delay slot was bundled at the end of a branch.
llvm-svn: 209580
Tim Northover [Sat, 24 May 2014 12:52:07 +0000 (12:52 +0000)]
AArch64/ARM64: rename ARM64 components to AArch64
This keeps Clang consistent with backend naming conventions.
llvm-svn: 209579
Tim Northover [Sat, 24 May 2014 12:51:25 +0000 (12:51 +0000)]
AArch64/ARM64: update Clang after AArch64 removal.
A few (mostly CodeGen) parts of Clang were tightly coupled to the
AArch64 backend. Now that it's gone, they will not even compile.
I've also deduplicated RUN lines in many of the AArch64 tests. This
might improve "make check-all" time noticably: some of those NEON
tests were monsters.
llvm-svn: 209578
Tim Northover [Sat, 24 May 2014 12:50:23 +0000 (12:50 +0000)]
AArch64/ARM64: move ARM64 into AArch64's place
This commit starts with a "git mv ARM64 AArch64" and continues out
from there, renaming the C++ classes, intrinsics, and other
target-local objects for consistency.
"ARM64" test directories are also moved, and tests that began their
life in ARM64 use an arm64 triple, those from AArch64 use an aarch64
triple. Both should be equivalent though.
This finishes the AArch64 merge, and everyone should feel free to
continue committing as normal now.
llvm-svn: 209577
Tim Northover [Sat, 24 May 2014 12:42:26 +0000 (12:42 +0000)]
AArch64/ARM64: remove AArch64 from tree prior to renaming ARM64.
I'm doing this in two phases for a better "git blame" record. This
commit removes the previous AArch64 backend and redirects all
functionality to ARM64. It also deduplicates test-lines and removes
orphaned AArch64 tests.
The next step will be "git mv ARM64 AArch64" and rewire most of the
tests.
Hopefully LLVM is still functional, though it would be even better if
no-one ever had to care because the rename happens straight
afterwards.
llvm-svn: 209576
Andreas Simbuerger [Sat, 24 May 2014 09:25:14 +0000 (09:25 +0000)]
Expose diagnostic info to users
llvm-svn: 209575
Andreas Simbuerger [Sat, 24 May 2014 09:25:10 +0000 (09:25 +0000)]
ScopDetection: Support keep-going
Support a 'keep-going' mode for the ScopDetection. In this mode, we just keep
on detecting, even if we encounter an error.
This is useful for diagnosing SCoP candidates. Sometimes you want all the
errors. Invalid SCoPs will still be refused in the end, we just refuse to
abort on the first error.
llvm-svn: 209574
Andreas Simbuerger [Sat, 24 May 2014 09:25:06 +0000 (09:25 +0000)]
Substitue LastError & InvalidRegions with RejectLogs
Use the new ScopDetectionDiagnostics to implement
the same functionality.
llvm-svn: 209573
Andreas Simbuerger [Sat, 24 May 2014 09:25:01 +0000 (09:25 +0000)]
Store all RejectReasons that occurred in a log.
This stores all RejectReasons created for one region
in a RejectLog inside the DetectionContext. For now
this only keeps track of the last error.
A separate patch will enable the tracking of all errors.
This patch itself does no harm (yet).
llvm-svn: 209572
Andreas Simbuerger [Sat, 24 May 2014 09:24:53 +0000 (09:24 +0000)]
Split implementation from ScopDetectionDiagnostic.h
We don't want the Statistic variables in every module that
includes the diagnostics.
llvm-svn: 209571
NAKAMURA Takumi [Sat, 24 May 2014 08:47:11 +0000 (08:47 +0000)]
llvm/test/Object/ar-error.test: Don't check the message "No such file or directory".
It didn't match on non-English version of Windows.
llvm-svn: 209570
NAKAMURA Takumi [Sat, 24 May 2014 08:42:12 +0000 (08:42 +0000)]
clang-tools-extra/test/clang-tidy/line-filter.cpp: Tweak line-filter.
On win32, %s is expanded to X:\path\to\test\line-filter.cpp. It was incompatible to yaml.
Although "%/s" could be available in Lit, ClangTidyDiagnosticConsumer::passesLineFilter() is unaware of comparision between '/' and '\\'.
llvm-svn: 209569
Michael Zolotukhin [Sat, 24 May 2014 08:09:57 +0000 (08:09 +0000)]
Implement sext(C1 + C2*X) --> sext(C1) + sext(C2*X) and
sext{C1,+,C2} --> sext(C1) + sext{0,+,C2} transformation in Scalar
Evolution.
That helps SLP-vectorizer to recognize consecutive loads/stores.
<rdar://problem/
14860614>
llvm-svn: 209568
Yaron Keren [Sat, 24 May 2014 07:19:25 +0000 (07:19 +0000)]
CXXInfo memory should be released after calling the destructor
instead of before. The wrong order had no effect since Deallocate()
does nothing right now, but we may replace allocator in the future.
llvm-svn: 209567
Tim Northover [Sat, 24 May 2014 07:05:42 +0000 (07:05 +0000)]
ARM64: extract a 32-bit subreg when selecting an inreg extend
After the load/store refactoring, we were sometimes trying to feed a
GPR64 into a 32-bit register offset operand. This failed in
copyPhysReg.
llvm-svn: 209566
Hans Wennborg [Fri, 23 May 2014 23:29:44 +0000 (23:29 +0000)]
This test doesn't need -O2 -disable-llvm-optzns
I forgot to fix this one in r209145. We use these flags on dllimport tests
to make sure we emit code for available_externaly functions and don't inline
the IR.
llvm-svn: 209564
Jason Molenda [Fri, 23 May 2014 23:11:27 +0000 (23:11 +0000)]
Add a lock ivar to the Platform so that multiple Targets
trying to populate the list of trap handler names at
the same time don't conflict with one another.
<rdar://problem/
17011969>
llvm-svn: 209563
Todd Fiala [Fri, 23 May 2014 22:33:42 +0000 (22:33 +0000)]
Remove some unnecessary comments from previous check-in.
Removed a "done" TODO comment.
Moved some helper methods to the top of the unit test.
Removed some commented out code I was considering implementing
before I came up with a better overall approach.
llvm-svn: 209561
Todd Fiala [Fri, 23 May 2014 22:25:29 +0000 (22:25 +0000)]
Added gdb remote tests to verify $Hg{thread-id}.
Added test to check that each thread reported by $q{f,s}ThreadInfo
can be switched to by $Hg, verified by a follow-up $qC.
Modified test exe to accept "thread:new" to create a new thread
that runs and sleeps for 5 seconds.
@llgs_test/@debugserver_test now buffer output.
llgs and debugserver gdbremote protocol tests now collect $O notification
output into the context returned from expect_lldb_gdbserver_replay.
context["O_count"] is an integer indicating the number of $O packets
collected during the replay, and context["O_content"] contains the
accumulated hex-decoded text output by the inferior (stdout and stderr).
Modified the $O check test to check the accumulated output rather than
a direct $O packet.
llvm-svn: 209560
Akira Hatanaka [Fri, 23 May 2014 22:12:01 +0000 (22:12 +0000)]
Recommit r209532 with -ffreestanding.
This is a test case for r209489.
llvm-svn: 209559
Akira Hatanaka [Fri, 23 May 2014 21:35:50 +0000 (21:35 +0000)]
Remove test while I investigate why the test is breaking the bots.
llvm-svn: 209558
Richard Smith [Fri, 23 May 2014 21:31:59 +0000 (21:31 +0000)]
Recompute the injected class name type for a class template specialization
rather than saving and restoring it.
llvm-svn: 209557
Akira Hatanaka [Fri, 23 May 2014 21:24:24 +0000 (21:24 +0000)]
XFAIL test which is breaking some of the build bots.
llvm-svn: 209556
Reid Kleckner [Fri, 23 May 2014 21:13:45 +0000 (21:13 +0000)]
Use comdats to avoid double initialization of weak data
Initializers of global data that can appear multiple TUs (static data
members of class templates or __declspec(selectany) data) are now in a
comdat group keyed on the global variable being initialized. On
non-Windows platforms, this is a code size and startup time
optimization. On Windows, this is necessary for ABI compatibility with
MSVC.
Fixes PR16959.
Reviewers: rsmith
Differential Revision: http://reviews.llvm.org/D3811
llvm-svn: 209555
David Blaikie [Fri, 23 May 2014 21:11:46 +0000 (21:11 +0000)]
DebugInfo: Generalize some tests to handle variations in attribute ordering.
In an effort to fix inlined debug info in situations where the out of
line definition of a function preceeds any inlined usage, the order in
which some attributes are added to subprogram DIEs may change. (in
essence, definition-necessary attributes like DW_AT_low_pc/high_pc will
be added immediately, but the names, types, and other features will be
delayed to module end where they may either be added to the subprogram
DIE or instead reference an abstract definition for those values)
These tests can be generalized to be resilient to this change. 5 or so
tests actually have to be incompatibly changed to cope with this
reordering and will go along with the change that affects the order.
llvm-svn: 209554
David Blaikie [Fri, 23 May 2014 21:07:01 +0000 (21:07 +0000)]
DebugInfo: Generalize a test case to not depend on abbreviation numbering.
It's an unnecessary detail for this test and just gets in the way when
making unrelated changes to the output in this test.
llvm-svn: 209553
Richard Smith [Fri, 23 May 2014 21:00:28 +0000 (21:00 +0000)]
[modules] If a referenced-but-not-instantiated class template specialization
gets explicitly specialized, don't reuse the previous class template
specialization declaration as a new declaration. The benefit here is fairly
marginal, it harms source fidelity, and this is horrible to model if the
specialization was imported from another module (without this change, it
asserts or worse).
llvm-svn: 209552
Andrew Trick [Fri, 23 May 2014 20:46:21 +0000 (20:46 +0000)]
Test case comments. Fix sloppiness.
llvm-svn: 209551
Rafael Espindola [Fri, 23 May 2014 20:39:23 +0000 (20:39 +0000)]
clang-format function.
llvm-svn: 209550
Hans Wennborg [Fri, 23 May 2014 20:37:38 +0000 (20:37 +0000)]
Emit used/dllexport inline method definitions in nested classes (PR19743, PR11170)
The previous code that was supposed to handle this didn't work
since parsing of inline method definitions is delayed to the end
of the outer class definition. Thus, when HandleTagDeclDefinition()
got called for the inner class, the inline functions in that class
had not been parsed yet.
Richard suggested that the way to do this is by handling inline
method definitions through a new ASTConsumer callback.
I really wanted to call ASTContext::DeclMustBeEmitted() instead of
checking for attributes, but doing that causes us to compute linkage,
and then we fail with "error: unsupported: typedef changes linkage
of anonymous type, but linkage was already computed" on tests like
this: (from SemaCXX/undefined-internal.cpp) :-/
namespace test7 {
typedef struct {
void bar();
void foo() { bar(); }
} A;
}
Differential Revision: http://reviews.llvm.org/D3809
llvm-svn: 209549
Rafael Espindola [Fri, 23 May 2014 20:35:47 +0000 (20:35 +0000)]
Remove a confusing use of a static method.
No functionality change.
llvm-svn: 209548
David Blaikie [Fri, 23 May 2014 20:25:15 +0000 (20:25 +0000)]
DebugInfo: Put concrete definitions referencing abstract definitions in the same scope as the abstract definition.
This seems like a simple cleanup/improved consistency, but also helps
lay the foundation to fix the bug mentioned in the test case: concrete
definitions preceeding any inlined usage aren't properly split into
concrete + abstract (because they're not known to need it until it's too
late).
Once we start deferring this choice until later, we won't have the
choice to put concrete definitions for inlined subroutines in a
different scope from concrete definitions for non-inlined subroutines
(since we won't know at time-of-construction which one it'll be). This
change brings those two cases into alignment ahead of that future
chaneg/fix.
llvm-svn: 209547
Hans Wennborg [Fri, 23 May 2014 20:16:41 +0000 (20:16 +0000)]
Don't suppress warning about dllimport on typedefs etc. in MicrosoftExt mode
It's true the MSVC doesn't warn about dllimport when applied to e.g. a typedef,
but that applies to dllexport too. I'd like us to be consistent, and I think
the right thing to do is to warn.
The original test that came with implementing the old behaviour doesn't provide
a good motivation, and it said it was checking that we're not repoting an *error*,
which is still true since this is just a warning.
There are plenty of tests e.g. in Sema/dllimport.c to check that we do warn
about dllimport on non functions or variables.
Differential Revision: http://reviews.llvm.org/D3832
llvm-svn: 209546
Andrew Trick [Fri, 23 May 2014 19:47:13 +0000 (19:47 +0000)]
Fix and improve SCEV ComputeBackedgeTankCount.
This is a follow-up to r209358: PR19799: Indvars miscompile due to an
incorrect max backedge taken count from SCEV.
That fix was incomplete as pointed out by Arnold and Michael Z. The
code was also too confusing. It needed a careful rewrite with more
unit tests. This version will also happen to optimize more cases.
<rdar://
17005101> PR19799: Indvars miscompile...
llvm-svn: 209545
Nico Rieck [Fri, 23 May 2014 19:33:49 +0000 (19:33 +0000)]
Revert part of "Fix broken FileCheck prefixes"
This reverts part of commit r209538.
llvm-svn: 209544
Rafael Espindola [Fri, 23 May 2014 19:16:56 +0000 (19:16 +0000)]
Use alias linkage and visibility to decide tls access mode.
This matches both what we do for the non-thread case and what gcc does.
With this patch clang would match gcc's behaviour in
static __thread int a = 42;
extern __thread int b __attribute__((alias("a")));
int *f(void) { return &a; }
int *g(void) { return &b; }
if not for pr19843. Manually writing the IL does produce the same access modes.
It is also a step in the direction of fixing pr19844.
llvm-svn: 209543
Nico Rieck [Fri, 23 May 2014 19:07:49 +0000 (19:07 +0000)]
Sema: Add more tests for dll attributes on inline functions
llvm-svn: 209542
Nico Rieck [Fri, 23 May 2014 19:07:25 +0000 (19:07 +0000)]
Fix broken FileCheck prefix
llvm-svn: 209541
Nico Rieck [Fri, 23 May 2014 19:07:09 +0000 (19:07 +0000)]
Fix typo
llvm-svn: 209540
Nico Rieck [Fri, 23 May 2014 19:06:44 +0000 (19:06 +0000)]
Remove unused CHECK lines
llvm-svn: 209539
Nico Rieck [Fri, 23 May 2014 19:06:24 +0000 (19:06 +0000)]
Fix broken FileCheck prefixes
llvm-svn: 209538
Jingyue Wu [Fri, 23 May 2014 18:39:40 +0000 (18:39 +0000)]
Add the extracted constant offset using GEP
Fixed a TODO in r207783.
Add the extracted constant offset using GEP instead of ugly
ptrtoint+add+inttoptr. Using GEP simplifies future optimizations and makes IR
easier to understand.
Updated all affected tests, and added a new test in split-gep.ll to cover a
corner case where emitting uglygep is necessary.
llvm-svn: 209537
Lang Hames [Fri, 23 May 2014 18:35:44 +0000 (18:35 +0000)]
[RuntimeDyld] Remove relocation bounds check introduced in r208375 (MachO only).
We do all of our address arithmetic in 64-bit, and operations involving
logically negative 32-bit offsets (actually represented as unsigned 64 bit ints)
often overflow into higher bits. The overflow check could be preserved by
casting to uint32 at the callsite for applyRelocationValue, but this would
eliminate the value of the check.
The right way to handle overflow in relocations is to make relocation processing
target specific, and compute the values for RelocationEntry objects in the
appropriate types (32-bit for 32-bit targets, 64-bit for 64-bit targets). This
is coming as part of the cleanup I'm working on.
This fixes another i386 regression test.
<rdar://problem/
16889891>
llvm-svn: 209536
Ben Langmuir [Fri, 23 May 2014 18:15:47 +0000 (18:15 +0000)]
Stopgap fix for finding module for a file mapped in the VFS
If we lookup a path using its 'real' path first, we need to ensure that
when we run header search we still use the VFS-mapped path or we will
not be able to find the corresponding module for the header.
The real problem is that we tie the name of a file to its underlying
FileEntry, which is uniqued by inode, so we only ever get the first name
it is looked up by. This doesn't work with modules, which rely on a
specific file system structure. I'm hoping to have time to write up a
proposal for fixing this more permanently soon, but as a stopgap this
patch updates the name of the file's directory if it comes from a VFS
mapping.
llvm-svn: 209534
Manuel Klimek [Fri, 23 May 2014 17:49:03 +0000 (17:49 +0000)]
Add the hasRangeInit() matcher for range-based for loop.
llvm-svn: 209533
Akira Hatanaka [Fri, 23 May 2014 17:35:08 +0000 (17:35 +0000)]
Test case for r209489.
llvm-svn: 209532
Manuel Klimek [Fri, 23 May 2014 17:09:56 +0000 (17:09 +0000)]
Make dead return statement detection more robust against changes in the CFG.
This change is a precondition to the proposed change to handle temporary
dtors correctly.
The idea is to explicitly search for the next return that doesn't have other
paths into it (that is, if the current block is dead, the block containing the
return must be dead, too). Thus, introducing non-control-flow block
transitions will not break the logic.
llvm-svn: 209531
Manuel Klimek [Fri, 23 May 2014 16:58:18 +0000 (16:58 +0000)]
Make the ParentVector default to size 2.
As Jordan noted, it makes more sense when we store it in the ParentMap,
and doesn't really make a difference when we return it from getParents.
llvm-svn: 209530
David Blaikie [Fri, 23 May 2014 16:53:14 +0000 (16:53 +0000)]
Add FIXME comment based on code review feedback by Hal Finkel on r209338
llvm-svn: 209529