Commit Graph

2833 Commits

Author SHA1 Message Date
Chandler Carruth
33d568124e [PM] Change the static object whose address is used to uniquely identify
analyses to have a common type which is enforced rather than using
a char object and a `void *` type when used as an identifier.

This has a number of advantages. First, it at least helps some of the
confusion raised in Justin Lebar's code review of why `void *` was being
used everywhere by having a stronger type that connects to documentation
about this.

However, perhaps more importantly, it addresses a serious issue where
the alignment of these pointer-like identifiers was unknown. This made
it hard to use them in pointer-like data structures. We were already
dodging this in dangerous ways to create the "all analyses" entry. In
a subsequent patch I attempted to use these with TinyPtrVector and
things fell apart in a very bad way.

And it isn't just a compile time or type system issue. Worse than that,
the actual alignment of these pointer-like opaque identifiers wasn't
guaranteed to be a useful alignment as they were just characters.

This change introduces a type to use as the "key" object whose address
forms the opaque identifier. This both forces the objects to have proper
alignment, and provides type checking that we get it right everywhere.
It also makes the types somewhat less mysterious than `void *`.

We could go one step further and introduce a truly opaque pointer-like
type to return from the `ID()` static function rather than returning
`AnalysisKey *`, but that didn't seem to be a clear win so this is just
the initial change to get to a reliably typed and aligned object serving
is a key for all the analyses.

Thanks to Richard Smith and Justin Lebar for helping pick plausible
names and avoid making this refactoring many times. =] And thanks to
Sean for the super fast review!

While here, I've tried to move away from the "PassID" nomenclature
entirely as it wasn't really helping and is overloaded with old pass
manager constructs. Now we have IDs for analyses, and key objects whose
address can be used as IDs. Where possible and clear I've shortened this
to just "ID". In a few places I kept "AnalysisID" to make it clear what
was being identified.

Differential Revision: https://reviews.llvm.org/D27031

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 17:53:26 +00:00
Rui Ueyama
6356463f9a Add convenient functions to compute hashes of byte vectors.
In many sitautions, you just want to compute a hash for one chunk
of data. This patch adds convenient functions for that purpose.

Differential Revision: https://reviews.llvm.org/D26988

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 00:46:09 +00:00
Zachary Turner
370e6fdfc6 Add some searching functions for ArrayRef<T>.
Differential Revision: https://reviews.llvm.org/D26999

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 23:22:19 +00:00
Chandler Carruth
62cfc59ef6 [LCG] Start using SCC relationship predicates in the unittest.
This mostly gives us nice unittesting of the predicates themselves. I'll
start using them further in subsequent commits to help test the actual
operations performed on the graph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:35:32 +00:00
Chandler Carruth
76884e5803 [ADT] Add initializer list support to SmallPtrSet so that sets can be
easily initialized with some initial values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 03:27:43 +00:00
Simon Pilgrim
84354d97d5 Fix spelling mistakes in Tools/Tests comments. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:31:13 +00:00
Matthias Braun
9262f00f1a Timer: Track name and description.
The previously used "names" are rather descriptions (they use multiple
words and contain spaces), use short programming language identifier
like strings for the "names" which should be used when exporting to
machine parseable formats.

Also removed a unused TimerGroup from Hexxagon.

Differential Revision: https://reviews.llvm.org/D25583

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 19:43:18 +00:00
Daniil Fukalov
d5fb62aebe [SCEV] limit recursion depth of CompareSCEVComplexity
Summary:
CompareSCEVComplexity goes too deep (50+ on a quite a big unrolled loop) and runs almost infinite time.

Added cache of "equal" SCEV pairs to earlier cutoff of further estimation. Recursion depth limit was also introduced as a parameter.

Reviewers: sanjoy

Subscribers: mzolotukhin, tstellarAMD, llvm-commits

Differential Revision: https://reviews.llvm.org/D26389

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 16:07:52 +00:00
Lang Hames
a0c2c80d79 Remove a stale test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 01:02:52 +00:00
Lang Hames
2ca233e645 [Orc] Re-enable the RPC unit test disabled in r286917.
This unit test infinite-looped on s390x due to a thread_yield being optimized
out. I've updated the QueueChannel class (where thread_yield was called) to use
a condition variable instead. This should cause the unit test to behave
correctly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287121 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 17:31:09 +00:00
Pavel Labath
a33f3dffef Remove TimeValue class
Summary:
All uses have been replaced by appropriate std::chrono types, and the class is
now unused.

Reviewers: zturner, mehdi_amini

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D26447

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287094 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 10:46:48 +00:00
Chad Rosier
eb47aeba1e [AArch64] Add support for Qualcomm's Falkor CPU.
Differential Revision: https://reviews.llvm.org/D26673

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 21:34:12 +00:00
Chad Rosier
17fd000f82 [AArch64] Refactor test per Matthias' request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287031 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 21:18:18 +00:00
Kuba Brecka
4a7eeb4052 Fix llvm-symbolizer to correctly sort a symbol array and calculate symbol sizes
Sometimes, llvm-symbolizer gives wrong results due to incorrect sizes of some symbols. The reason for that was an incorrectly sorted array in computeSymbolSizes. The comparison function used subtraction of unsigned types, which is incorrect. Let's change this to return explicit -1 or 1.

Differential Revision: https://reviews.llvm.org/D26537



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287028 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 21:07:03 +00:00
Lang Hames
2c34688a06 [ORC] Temporarily disable RPCUtils unit test.
This broke s390x due to a bug in the QueueChannel implementation that led to it
infinite-looping. Disabling it while I look into a fix.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 00:49:12 +00:00
Peter Collingbourne
dead081fb2 Bitcode: Change module reader functions to return an llvm::Expected.
Differential Revision: https://reviews.llvm.org/D26562

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-13 07:00:17 +00:00
Zachary Turner
fd3428261b [Support] Add StringRef::find_lower and contains_lower.
Differential Revision: https://reviews.llvm.org/D25299

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286724 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12 17:17:12 +00:00
Lang Hames
4258590d55 [ORC] Add a WrappedHandlerReturn type to map handler return types onto error
return types.

This class allows user provided handlers to return either error-wrapped types
or plain types. In the latter case, the plain type is wrapped with a success
value of Error or Expected<T> type to fit it into the rest of the serialization
machinery.

This patch allows us to remove the RPC unit-test workaround added in r286646.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286701 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12 02:19:31 +00:00
Zachary Turner
97dac2b41d [Support] Introduce llvm::formatv() function.
This introduces a new type-safe general purpose formatting
library.  It provides compile-time type safety, does not require
a format specifier (since the type is deduced), and provides
mechanisms for extending the format capability to user defined
types, and overriding the formatting behavior for existing types.

This patch additionally adds documentation for the API to the
LLVM programmer's manual.

Mailing List Thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105836.html

Differential Revision: https://reviews.llvm.org/D25587

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 23:57:40 +00:00
Mehdi Amini
aa2b11dcf3 Fix static initialization order fiasco in MCTests
Reported by Kostya on llvm-dev, uncovered by an ASAN bot

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286647 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 22:18:42 +00:00
Lang Hames
823ac75ae6 [ORC] Temporarily fix the RPCUtils unit test by explicitly specifying a handler
return type.

This should be fixed permanently by having the RPCUtils header recognize the
ErrorSuccess type. I'll commit that in a follow up patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286646 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 22:16:10 +00:00
Lang Hames
085827f843 [ORC] Re-apply 286620 with fixes for the ErrorSuccess class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 21:42:09 +00:00
Erik Eckstein
345d21cba1 Make the FunctionComparator of the MergeFunctions pass a stand-alone utility.
This is pure refactoring. NFC.

This change moves the FunctionComparator (together with the GlobalNumberState
utility) in to a separate file so that it can be used by other passes.
For example, the SwiftMergeFunctions pass in the Swift compiler:
https://github.com/apple/swift/blob/master/lib/LLVMPasses/LLVMMergeFunctions.cpp

Details of the change:

*) The big part is just moving code out of MergeFunctions.cpp into FunctionComparator.h/cpp
*) Make FunctionComparator member functions protected (instead of private)
   so that a derived comparator class can use them.

Following refactoring helps to share code between the base FunctionComparator
class and a derived class:

*) Add a beginCompare() function
*) Move some basic function property comparisons into a separate function compareSignature()
*) Do the GEP comparison inside cmpOperations() which now has a new
   needToCmpOperands reference parameter

https://reviews.llvm.org/D25385



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286632 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 21:15:13 +00:00
Lang Hames
b35b701639 [ORC] Revert r286620 while I investigate a bot failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286621 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 19:46:46 +00:00
Lang Hames
d8314f03b1 [ORC] Refactor the ORC RPC utilities to add some new features.
(1) Add support for function key negotiation.

The previous version of the RPC required both sides to maintain the same
enumeration for functions in the API. This means that any version skew between
the client and server would result in communication failure.

With this version of the patch functions (and serializable types) are defined
with string names, and the derived function signature strings are used to
negotiate the actual function keys (which are used for efficient call
serialization). This allows clients to connect to any server that supports a
superset of the API (based on the function signatures it supports).

(2) Add a callAsync primitive.

The callAsync primitive can be used to install a return value handler that will
run as soon as the RPC function's return value is sent back from the remote.

(3) Launch policies for RPC function handlers.

The new addHandler method, which installs handlers for RPC functions, takes two
arguments: (1) the handler itself, and (2) an optional "launch policy". When the
RPC function is called, the launch policy (if present) is invoked to actually
launch the handler. This allows the handler to be spawned on a background
thread, or added to a work list. If no launch policy is used, the handler is run
on the server thread itself. This should only be used for short-running
handlers, or entirely synchronous RPC APIs.

(4) Zero cost cross type serialization.

You can now define serialization from any type to a different "wire" type. For
example, this allows you to call an RPC function that's defined to take a
std::string while passing a StringRef argument. If a serializer from StringRef
to std::string has been defined for the channel type this will be used to
serialize the argument without having to construct a std::string instance.

This allows buffer reference types to be used as arguments to RPC calls without
requiring a copy of the buffer to be made.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286620 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 19:42:44 +00:00
Greg Clayton
f5acbc29d8 Clean up DWARFFormValue by reducing duplicated code and removing DWARFFormValue::getFixedFormSizes()
In preparation for a follow on patch that improves DWARF parsing speed, clean up DWARFFormValue so that we have can get the fixed byte size of a form value given a DWARFUnit or given the version, address byte size and dwarf32/64.

This patch cleans up code so that everyone is using one of the new DWARFFormValue functions:

static Optional<uint8_t> DWARFFormValue::getFixedByteSize(dwarf::Form Form, const DWARFUnit *U = nullptr);
static Optional<uint8_t> DWARFFormValue::getFixedByteSize(dwarf::Form Form, uint16_t Version, uint8_t AddrSize, bool Dwarf32);

This patch changes DWARFFormValue::skipValue() to rely on the output of DWARFFormValue::getFixedByteSize(...) instead of duplicating the code in each function. This will reduce the number of changes we need to make to DWARF to fewer places in DWARFFormValue when we add support for new form.

This patch also starts to support DWARF64 so that we can get correct byte sizes for forms that vary according the DWARF 32/64.

To reduce the code duplication a new FormSizeHelper pure virtual class was created that can be created as a FormSizeHelperDWARFUnit when you have a DWARFUnit, or FormSizeHelperManual where you manually specify the DWARF version, address byte size and DWARF32/DWARF64. There is now a single implementation of a function that gets the fixed byte size (instead of two where one took a DWARFUnit and one took the DWARF version, address byte size and DWARFFormat enum) and one function to skip the form values.

https://reviews.llvm.org/D26526




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 16:21:37 +00:00
Teresa Johnson
a547919737 Split Bitcode/ReaderWriter.h into separate reader and writer headers
Summary:
Split ReaderWriter.h which contains the APIs into both the BitReader and
BitWriter libraries into BitcodeReader.h and BitcodeWriter.h.

This is to address Chandler's concern about sharing the same API header
between multiple libraries (BitReader and BitWriter). That concern is
why we create a single bitcode library in our downstream build of clang,
which led to r286297 being reverted as it added a dependency that
created a cycle only when there is a single bitcode library (not two as
in upstream).

Reviewers: mehdi_amini

Subscribers: dlj, mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D26502

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286566 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 05:34:58 +00:00
Mehdi Amini
5652444405 Prevent at compile time converting from Error::success() to Expected<T>
This would trigger an assertion at runtime otherwise.

Differential Revision: https://reviews.llvm.org/D26482

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286562 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 04:29:25 +00:00
Mehdi Amini
df0b8bce48 Make the Error class constructor protected
This is forcing to use Error::success(), which is in a wide majority
of cases a lot more readable.

Differential Revision: https://reviews.llvm.org/D26481

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 04:28:40 +00:00
Davide Italiano
582d2b4b31 [ADT/MathExtras] Make buildbot happy again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 04:03:29 +00:00
Davide Italiano
07ca53dbb5 [ADT/MathExtras] Add tests for PowerOf2Floor (previously untested).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286551 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 02:38:24 +00:00
Davide Italiano
17ff1559b1 [ADT/MathExtras] Introduce PowerOf2Ceil.
To be used in lld (and probably somewhere else in llvm).

Differential Revision:  https://reviews.llvm.org/D26538

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 02:22:16 +00:00
Zachary Turner
48fbf5cc1a [Support] Improve flexibility of binary blob formatter.
This makes it possible to indent a binary blob by a certain
number of bytes, and also makes some things more idiomatic.
Finally, it integrates this binary blob formatter into ScopedPrinter
which used to have its own implementation of this algorithm.

Differential Revision: https://reviews.llvm.org/D26477

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 20:16:45 +00:00
Nico Weber
2e53b7150a Revert r286437 r286438, they caused PR30976
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 17:55:41 +00:00
Sanjoy Das
b2e86a3cab [SCEVExpander] Hoist unsigned divisons when safe
That is, when the divisor is a constant non-zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286438 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 07:56:12 +00:00
Sanjoy Das
ea50f98cad [SCEVExpander] Don't hoist divisions
Fixes PR30942.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 07:56:09 +00:00
Sanjoy Das
32c88043af Lift out a helper lambda; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286436 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 07:56:05 +00:00
Peter Collingbourne
76c218e094 Bitcode: Change the materializer interface to return llvm::Error.
Differential Revision: https://reviews.llvm.org/D26439

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 17:49:19 +00:00
Greg Clayton
a20694002c Added the ability to dump hex bytes easily into a raw_ostream.
Unit tests were added to verify this functionality keeps working correctly.

Example output for raw hex bytes:
llvm::ArrayRef<uint8_t> Bytes = ...;
llvm::outs() << format_hex_bytes(Bytes);
554889e5 4881ec70 04000048 8d051002
00004c8d 05fd0100 004c8b0d d0020000

Example output for raw hex bytes with offsets:
llvm::outs() << format_hex_bytes(Bytes, 0x100000d10);
0x0000000100000d10: 554889e5 4881ec70 04000048 8d051002
0x0000000100000d20: 00004c8d 05fd0100 004c8b0d d0020000

Example output for raw hex bytes with ASCII with offsets:
llvm::outs() << format_hex_bytes_with_ascii(Bytes, 0x100000d10);
0x0000000100000d10: 554889e5 4881ec70 04000048 8d051002 |UH.?H.?p...H....|
0x0000000100000d20: 00004c8d 05fd0100 004c8b0d d0020000 |..L..?...L..?...|

The default groups bytes into 4 byte groups, but this can be changed to 1 byte:
llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 16 /*NumPerLine*/, 1 /*ByteGroupSize*/);
0x0000000100000d10: 55 48 89 e5 48 81 ec 70 04 00 00 48 8d 05 10 02
0x0000000100000d20: 00 00 4c 8d 05 fd 01 00 00 4c 8b 0d d0 02 00 00

llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 16 /*NumPerLine*/, 2 /*ByteGroupSize*/);
0x0000000100000d10: 5548 89e5 4881 ec70 0400 0048 8d05 1002
0x0000000100000d20: 0000 4c8d 05fd 0100 004c 8b0d d002 0000

llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 8 /*NumPerLine*/, 1 /*ByteGroupSize*/);
0x0000000100000d10: 55 48 89 e5 48 81 ec 70
0x0000000100000d18: 04 00 00 48 8d 05 10 02
0x0000000100000d20: 00 00 4c 8d 05 fd 01 00
0x0000000100000d28: 00 4c 8b 0d d0 02 00 00

https://reviews.llvm.org/D26405



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 00:15:54 +00:00
Sanjoy Das
b73e1558ac [TBAA] Drop support for "old style" scalar TBAA tags
Summary:
We've had support for auto upgrading old style scalar TBAA access
metadata tags into the "new" struct path aware TBAA metadata for 3 years
now.  The only way to actually generate old style TBAA was explicitly
through the IRBuilder API.  I think this is a good time for dropping
support for old style scalar TBAA.

I'm not removing support for textual or bitcode upgrade -- if you have
IR with the old style scalar TBAA tags that go through the AsmParser orf
the bitcode parser before LLVM sees them, they will keep working as
usual.

Note:

  %val = load i32, i32* %ptr, !tbaa !N
  !N = < scalar tbaa node >

is equivalent to

  %val = load i32, i32* %ptr, !tbaa !M
  !N = < scalar tbaa node >
  !M = !{!N, !N, 0}

Reviewers: manmanren, chandlerc, sunfish

Subscribers: mcrosier, llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D26229

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286291 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 20:46:01 +00:00
Peter Collingbourne
5498e18776 IR, Bitcode: Change bitcode reader to no longer own its memory buffer.
Unique ownership is just one possible ownership pattern for the memory buffer
underlying the bitcode reader. In practice, as this patch shows, ownership can
often reside at a higher level. With the upcoming change to allow multiple
modules in a single bitcode file, it will no longer be appropriate for
modules to generally have unique ownership of their memory buffer.

The C API exposes the ownership relation via the LLVMGetBitcodeModuleInContext
and LLVMGetBitcodeModuleInContext2 functions, so we still need some way for
the module to own the memory buffer. This patch does so by adding an owned
memory buffer field to Module, and using it in a few other places where it
is convenient.

Differential Revision: https://reviews.llvm.org/D26384

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 06:03:43 +00:00
Peter Collingbourne
8fc9b4d314 Bitcode: Decouple block info block state from reader.
As proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106630.html

Move block info block state to a new class, BitstreamBlockInfo.
Clients may set the block info for a particular cursor with the
BitstreamCursor::setBlockInfo() method.

At this point BitstreamReader is not much more than a container for an
ArrayRef<uint8_t>, so remove it and replace all uses with direct uses
of memory buffers.

Differential Revision: https://reviews.llvm.org/D26259

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286207 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 04:17:11 +00:00
Jordan Rose
fd34be2ddd Add tests for r286139.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 20:40:16 +00:00
Tim Shen
c7524ad33d [APFloat] Make functions that produce APFloaat objects use correct semantics.
Summary:
Fixes PR30869.

In D25977 I meant to change all functions that care about lifetime. I
changed constructors, factory functions, but I missed member/free
functions that return new instances. This patch changes them.

Reviewers: hfinkel, kbarton, echristo, joerg

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D26269

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286060 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-06 07:38:37 +00:00
Adrian Prantl
60a7c431c0 Add DWARF debug info support for C++11 inline namespaces.
This implements the DWARF 5 DW_AT_export_symbols feature:
http://dwarfstd.org/ShowIssue.php?issue=141212.1

<rdar://problem/18616046>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 19:42:02 +00:00
Michael LeMay
cbbb2b1243 [ADT] IntervalMap: fix setStart and setStop
Summary:
These functions currently require that the new closed interval has a length of
at least 2.  They also currently permit empty half-open intervals.  This patch
defines nonEmpty in each traits structure and uses it to correct the
implementations of setStart and setStop.

Reviewers: stoklund, chandlerc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D26064

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 19:14:46 +00:00
Jonas Hahnfeld
8186cc4fdc [CMake] Disable rpath for UnitTests
This was broken since rL285714.

Differential Revision: https://reviews.llvm.org/D26246

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 06:58:16 +00:00
Malcolm Parsons
4c12732226 Fix Clang-tidy readability-redundant-string-cstr warnings
Reviewers: beanz, lattner, jlebar

Subscribers: jholewinski, llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D26235

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 16:43:50 +00:00
Peter Collingbourne
7cfe6227d3 Bitcode: Fix short read implementation.
We need to zero extend the byte in order to correctly shift it into a
64-bit value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 02:58:47 +00:00
Michael Gottesman
465b55b183 [ilist_node] Add a getReverseIterator() method and a unittest for it.
This is the reverse_iterator analogue of getIterator().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 00:59:58 +00:00