Commit Graph

208094 Commits

Author SHA1 Message Date
Rafael Espindola 5c546a1437 COFF: In chunks, store the offset from the start of the output section. NFC.
This is more convenient than the offset from the start of the file as we
don't have to worry about it changing when we move the output section.

This is a port of r245008 from ELF.

llvm-svn: 245018
2015-08-14 03:30:59 +00:00
Chandler Carruth f9cbd039bd [PM/AA] Run clang-format over TBAA code to normalize the formatting
before making substantial changes.

llvm-svn: 245017
2015-08-14 03:26:15 +00:00
Chandler Carruth d30e45c35c [PM/AA] Remove a stray #include that snuck in via copy/paste when
creating this header.

llvm-svn: 245016
2015-08-14 03:16:11 +00:00
Chandler Carruth 55eec8be9e [PM/AA] Clean up the SCEV-AA comment formatting and typos.
llvm-svn: 245015
2015-08-14 03:14:50 +00:00
Chandler Carruth 79687faee6 [PM/AA] Run clang-format over the SCEV-AA code to normalize the
formatting.

llvm-svn: 245014
2015-08-14 03:12:16 +00:00
Chandler Carruth ed23528fb2 [PM/AA] Hoist the SCEV-AA interface to its own header and pull the
creation function into that header.

llvm-svn: 245013
2015-08-14 03:11:16 +00:00
Chandler Carruth 42ff448fe4 [PM/AA] Hoist ScopedNoAliasAA's interface into a header and move the
creation function there.

Same basic refactoring as the other alias analyses. Nothing special
required this time around.

llvm-svn: 245012
2015-08-14 02:55:50 +00:00
Chandler Carruth 29109f5b1e [PM/AA] Hoist the value handle definition for CFLAA into the header to
satisfy libc++'s std::forward_list which requires the value type to be
complete.

llvm-svn: 245011
2015-08-14 02:50:34 +00:00
Chandler Carruth 496b7fb569 [PM/AA] Run clang-format over the ScopedNoAliasAA pass prior to making
substantial changes to normalize any formatting.

llvm-svn: 245010
2015-08-14 02:46:07 +00:00
Chandler Carruth 8b046a42f4 [PM/AA] Extract a minimal interface for CFLAA to its own header file.
I've used forward declarations and reorderd the source code some to make
this reasonably clean and keep as much of the code as possible in the
source file, including all the stratified set details. Just the basic AA
interface and the create function are in the header file, and the header
file is now included into the relevant locations.

llvm-svn: 245009
2015-08-14 02:42:20 +00:00
Rafael Espindola f763ca3c9c ELF: Create a symbol table.
For now it is empty. I will add the symbols in a followup patch.

llvm-svn: 245008
2015-08-14 02:42:20 +00:00
Chandler Carruth f4616a4084 [PM/AA] Delete two pointlessly overridden methods on the AA interface by
the AA counter pass.

For pointsToConstantMemory, I think this is a "bug fix" as I think the
code as written will actually infloop if ever reached. For the
getModRefInfo, this is a no-op change but with a significantly simpler
form.

llvm-svn: 245007
2015-08-14 02:16:12 +00:00
Chandler Carruth 1b179e1102 [PM/AA] Sink all the actual code from AliasAnalysisCounter back into the
.cpp file to make the header much less noisy.

Also makes it easy to use a static helper rather than a public method
for printing lines of stats.

llvm-svn: 245006
2015-08-14 02:12:12 +00:00
Chandler Carruth fafee839d9 [PM/AA] Run clang-format over this code to establish a clean baseline
for subsequent changes.

llvm-svn: 245005
2015-08-14 02:07:05 +00:00
Chandler Carruth 7a9ba04809 [PM/AA] Hoist the AA counter pass into a header to match the analysis
pattern.

Also hoist the creation routine out of the generic header and into the
pass header now that we have one.

I've worked to not make any changes, even formatting ones here. I'll
clean up the formatting and other things in a follow-up patch now that
the code is in the right place.

llvm-svn: 245004
2015-08-14 02:05:41 +00:00
Jingyue Wu 1238f341ba [SeparateConstOffsetFromGEP] sext(a)+sext(b) => sext(a+b) when a+b can't sign-overflow.
Summary:
This patch implements my promised optimization to reunites certain sexts from
operands after we extract the constant offset. See the header comment of
reuniteExts for its motivation.

One key building block that enables this optimization is Bjarke's poison value
analysis (D11212). That helps to prove "a +nsw b" can't overflow.

Reviewers: broune

Subscribers: jholewinski, sanjoy, llvm-commits

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

llvm-svn: 245003
2015-08-14 02:02:05 +00:00
Chandler Carruth 45cf0bf117 [PM/AA] Remove the function names and class names from doxygen comments
and generally clean up their formatting.

llvm-svn: 245002
2015-08-14 01:43:46 +00:00
Chandler Carruth 4ac50b08e3 [PM/AA] Move the LibCall AA creation routine declaration to that
analysis's header file to be more consistent with other analyses.

llvm-svn: 245001
2015-08-14 01:43:02 +00:00
Chandler Carruth cf76e57dd8 [PM/AA] Run clang-format over LibCallAliasAnalysis prior to making
substantial changes needed for the new pass manager's AA integration.

llvm-svn: 245000
2015-08-14 01:38:25 +00:00
Jim Ingham 55828080a0 I was assuming that when a bit of inlined code was followed by code from the inlining site, it was going to execute to the inlining site code, but apparently that's not always true. So we need to be a bit more careful getting past the inlining, and use a StepOverRange plan not a RunToAddress plan.
<rdar://problem/22191804>

llvm-svn: 244999
2015-08-14 01:38:21 +00:00
David Blaikie 86d8cf3502 unique_ptrify ConsumedBlockInfo analysis to make it move assignable
ConsumedBlockInfo objects were move assigned, but only in a state where
the dtor was a no-op anyway. Subtle and easily could've happened in ways
that wouldn't've been safe - so this change makes it safe no matter what
state the ConsumedBlockInfo object is in.

llvm-svn: 244998
2015-08-14 01:26:19 +00:00
David Blaikie 08964cade1 Update ExceptionDemo for exception handling API changes (personality function call->function move)
The ExceptionDemo now compiles, but doesn't link... undefined type
references to various typeinfo.

llvm-svn: 244997
2015-08-14 00:37:16 +00:00
Alex Lorenz 9846167816 Update MIRLangRef for MIR syntax change from r244982.
llvm-svn: 244996
2015-08-14 00:36:10 +00:00
David Blaikie f4057fec55 Fix -Wformat warnings in ExceptionDemo
llvm-svn: 244995
2015-08-14 00:31:49 +00:00
David Blaikie 3b20b04072 Fix up the ExceptionDemo for some API changes over the past <time>
This still doesn't build -Werror clean, but other than that it should at
least build.

llvm-svn: 244994
2015-08-14 00:24:56 +00:00
Chandler Carruth bf143e2a20 [LIR] Re-instate r244880, reverted in r244884, factoring the handling of
AliasAnalysis in LoopIdiomRecognize.

The previous commit to LIR, r244879, exposed some scary bug in the loop
pass pipeline with an assert failure that showed up on several bots.
This patch got reverted as part of getting that revision reverted, but
they're actually independent and unrelated. This patch has no functional
change and should be completely safe. It is also useful for my current
work on the AA infrastructure.

llvm-svn: 244993
2015-08-14 00:21:10 +00:00
Greg Clayton 5da0dde965 Add a better fix for searching for spaces in BSD archive object names where we only trim trailing spaces.
I made an example where I had a file named "testtesttestt .o" (16 chars) that I was able to put into a .a file and we would previously truncate the object name to "testtesttestt" since we searched for any space in the name. I believe the BSD archive docs say that filenames with spaces will use the extended format, but our current libtool doesn't so I wanted to fix it by only removing trailing spaces.

llvm-svn: 244992
2015-08-14 00:18:52 +00:00
Richard Smith 34fa813d9b This test was still failing for me after r244925, fix it harder.
llvm-svn: 244991
2015-08-14 00:16:05 +00:00
David Blaikie 9255161665 Wdeprecated: ByrefHelpers are copy constructed by the ::buildByrefHelpers helper, make sure they're safely copyable
Make the copy/move ctors protected and defaulted in the base, make the
derived classes final to avoid exposing any slicing-prone APIs.

Also, while I'm here, simplify the use of buildByrefHelpers by taking
the parameter by value instead of non-const ref. None of the callers
care aobut observing the state after the call.

llvm-svn: 244990
2015-08-13 23:53:09 +00:00
David Majnemer 2dcef9e0a4 Avoid iteration invalidation issues around MaterializedTemporaryExpr
We risk iterator invalidation issues if we use a DenseMap to hold the
backing storage for an APValue.  Instead, BumpPtrAllocate them and
use APValue * as our DenseMap value.

Also, don't assume that MaterializedGlobalTemporaryMap won't regrow
between when we initially perform a lookup and later on when we actually
try to insert into it.

This fixes PR24289.

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

llvm-svn: 244989
2015-08-13 23:50:15 +00:00
Richard Smith f7b41371d9 [modules] When writing a module file built with -fmodule-map-file-home-is-cwd,
via a module map found by -fmodule-map-file=, the home directory of the module
is the current working directory, even if that's a different directory on
reload.

llvm-svn: 244988
2015-08-13 23:47:44 +00:00
Jeroen Ketema d7be603ab1 Remove files accidentally not removed in r244310
llvm-svn: 244987
2015-08-13 23:43:12 +00:00
David Blaikie 8b0e915144 Wdeprecated: Ensure CheckNames are copy assignable (used in setCurrentCheckName) by removing the unnecessary copy ctor
llvm-svn: 244986
2015-08-13 23:38:46 +00:00
Ivan Krasin 9cc0420211 Remove test cases, which rely on the default sanitizer blacklists.
Summary:
The default blacklists may vary across different architectures and
configurations. It was not wise to include into http://reviews.llvm.org/D11968

Reviewers: chapuni, pcc

Subscribers: cfe-commits, pcc

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

llvm-svn: 244985
2015-08-13 23:37:28 +00:00
Greg Clayton 1202881f9a Don't crash when we have a .a file that contains an object with a 16 character name. Any calls to std::string::erase must be bounds checked.
<rdar://problem/22260988>

llvm-svn: 244984
2015-08-13 23:16:15 +00:00
David Blaikie aa0d51f062 Wdeprecated: Make Filter safely move constructible.
makeFilter returns Filters by value which seems to be only safe when the
copy doesn't occur and RVO kicks in. Make the object safely movable to
support this more reliably.

llvm-svn: 244983
2015-08-13 23:15:20 +00:00
Alex Lorenz 5022f6bb81 MIR Serialization: Change MIR syntax - use custom syntax for MBBs.
This commit modifies the way the machine basic blocks are serialized - now the
machine basic blocks are serialized using a custom syntax instead of relying on
YAML primitives. Instead of using YAML mappings to represent the individual
machine basic blocks in a machine function's body, the new syntax uses a single
YAML block scalar which contains all of the machine basic blocks and
instructions for that function.

This is an example of a function's body that uses the old syntax:

    body:
      - id: 0
        name: entry
        instructions:
          - '%eax = MOV32r0 implicit-def %eflags'
          - 'RETQ %eax'
    ...

The same body is now written like this:

    body: |
      bb.0.entry:
        %eax = MOV32r0 implicit-def %eflags
        RETQ %eax
    ...

This syntax change is motivated by the fact that the bundled machine
instructions didn't map that well to the old syntax which was using a single
YAML sequence to store all of the machine instructions in a block. The bundled
machine instructions internally use flags like BundledPred and BundledSucc to
determine the bundles, and serializing them as MI flags using the old syntax
would have had a negative impact on the readability and the ease of editing
for MIR files. The new syntax allows me to serialize the bundled machine
instructions using a block construct without relying on the internal flags,
for example:

   BUNDLE implicit-def dead %itstate, implicit-def %s1 ... {
      t2IT 1, 24, implicit-def %itstate
      %s1 = VMOVS killed %s0, 1, killed %cpsr, implicit killed %itstate
   }

This commit also converts the MIR testcases to the new syntax. I developed
a script that can convert from the old syntax to the new one. I will post the
script on the llvm-commits mailing list in the thread for this commit.

llvm-svn: 244982
2015-08-13 23:10:16 +00:00
David Blaikie 2038b54eae Wdeprecated: Make the SecKeychainBugVisitor copyable (for the clone support in the CRTP base) my removing the user-declared dtor
The implicit dtor is just as good, and avoid suppressing implicit
copy/move ops.

llvm-svn: 244981
2015-08-13 23:09:18 +00:00
David Blaikie 78f7fc7e57 Fix the MSVC build which cannot manifest default move ops
llvm-svn: 244980
2015-08-13 23:05:58 +00:00
David Blaikie 6951e3e406 Wdeprecated: BugReporterVisitors are copied for cloning (BugReporterVisitorImpl), make sure such copies are safe
Make the copy/move ctors defaulted in the base class and make the
derived classes final to avoid any intermediate hierarchy slicing if
these types were further derived.

llvm-svn: 244979
2015-08-13 22:58:37 +00:00
David Blaikie 048f975e2b Follow up r244975: The ctors of an abstract class don't need to be protected - the object isn't directly constructible/doesn't present a slicing risk
llvm-svn: 244978
2015-08-13 22:58:35 +00:00
Sanjay Patel a75c41e5f3 don't repeat function names in comments; NFC
llvm-svn: 244977
2015-08-13 22:53:20 +00:00
David Blaikie 903c29347a Wdeprecated: CollectReachableSymbolsCallback are move constructed/returned by value, so make sure they're copy/moveable
(return by value is in ExprEngine::processPointerEscapedOnBind and any
other call to the scanReachableSymbols function template used there)

Protect the special members in the base class to avoid slicing, and make
derived classes final so these special members don't accidentally become
public on an intermediate base which would open up the possibility of
slicing again.

llvm-svn: 244975
2015-08-13 22:50:09 +00:00
David Blaikie 01cd46abae Wdeprecated: RegionBindingsRef are copy constructed, make sure that's safe by removing the unnecessary user-declared copy assignment operator
The user-defined copy assignment looks like it was working around the
presence of a reference member (that probably doesn't change in the copy
assignment cases present in the program). Rather than continuing this - just
change the reference to a pointer and let all the special members be
defined implicitly.

llvm-svn: 244974
2015-08-13 22:33:24 +00:00
David Blaikie 55477463d6 Wdeprecated: PathPieces are copied, make them safely implicitly copyable by removing the unnecessary user declared dtor.
llvm-svn: 244973
2015-08-13 22:23:53 +00:00
Rafael Espindola 83b0dc6392 ELF: Drop the Chunk base class.
With OutputSection being a virtual interface, each concrete OutputSection
handles only one type of chunk and we don't need a base Chunk class.

So for we have a class that handles input sections and one that handles
the string table, but this extends naturally for other outputs (symbol table,
merging of SHF_MERGE sections, etc.).

llvm-svn: 244972
2015-08-13 22:21:37 +00:00
David Blaikie 210ea0b31a Wdeprecated: StoredDiagnostics are stored in a SmallVector, so make sure they're copy/movable
Removing the no-op dtor makes these objects safely implicitly
copyable/movable/etc.

(& tidy up the ctor, while I'm here)

llvm-svn: 244971
2015-08-13 22:20:14 +00:00
NAKAMURA Takumi a137bf9386 clang/test/Frontend/dependency-gen.c: Add explicit -target x86_64-linux-gnu for -fsanitize.
llvm-svn: 244970
2015-08-13 22:17:34 +00:00
Rafael Espindola ebd2108215 Make OutputSection virtual and use that for creating the string table.
We were creating the string table in a completely ad hoc way. Now the
string table is an output section and gets its output offset set just like
any other section.

This opens the way for other linker created sections like the symbol table.

llvm-svn: 244969
2015-08-13 22:14:37 +00:00
David Blaikie c1334cc17d Wdeprecated: Make BumpVectorContext movable
Turns out the one place that relied on the implicit copy ctor was safe
because it created an object in a state where the dtor was a no-op, but
that's more luck that good management.

Sure up the API by defining move construction and using it, which
implicitly disallows the unreliable copy operations.

llvm-svn: 244968
2015-08-13 22:12:21 +00:00