Commit Graph

18869 Commits

Author SHA1 Message Date
Dmitri Gribenko 8f944628ac Make SourceMgr::PrintMessage() testable and add unit tests
llvm-svn: 191558
2013-09-27 21:09:25 +00:00
Rui Ueyama c2bed42904 Re-submit r191472 with a fix for big endian.
llvm-objdump: Dump COFF import table if -private-headers option is given.
llvm-svn: 191557
2013-09-27 21:04:00 +00:00
Yunzhong Gao b8bbcbfcc8 Adding intrinsics to the llvm backend for TBM instruction set.
Phabricator code review is located here: http://llvm-reviews.chandlerc.com/D1750

llvm-svn: 191539
2013-09-27 18:38:42 +00:00
Daniel Sanders 6098b33515 [mips][msa] Implemented insert.d intrinsic.
This intrinsic is lowered into an equivalent INSERT_VECTOR_ELT which is
further lowered into a sequence of insert.w's on MIPS32.

llvm-svn: 191521
2013-09-27 13:36:54 +00:00
Daniel Sanders c72593e69a [mips][msa] Implemented fill.d intrinsic.
This intrinsic is lowered into an equivalent BUILD_VECTOR which is further
lowered into a sequence of insert.w's on MIPS32.

llvm-svn: 191519
2013-09-27 13:20:41 +00:00
Daniel Sanders 7f3d946fb7 [mips][msa] Implemented copy_[us].d intrinsic.
This intrinsic is lowered into equivalent copy_s.w instructions during
legalization.

llvm-svn: 191518
2013-09-27 13:04:21 +00:00
Rui Ueyama 333d28a0bb Revert "llvm-objdump: Dump COFF import table if -private-headers option is given."
This reverts commit r191472 because it's failing on BE machine.

llvm-svn: 191480
2013-09-27 01:29:36 +00:00
Rui Ueyama 5b1adbaad9 llvm-objdump: Dump COFF import table if -private-headers option is given.
This is a patch to add capability to llvm-objdump to dump COFF Import Table
entries, so that we can write tests for LLD checking Import Table contents.

llvm-objdump did not print anything but just file name if the format is COFF
and -private-headers option is given. This is a patch adds capability for
dumping DLL Import Table, which is specific to the COFF format.

In this patch I defined a new iterator to iterate over import table entries.
Also added a few functions to COFFObjectFile.cpp to access fields of the entry.

Differential Revision: http://llvm-reviews.chandlerc.com/D1719

llvm-svn: 191472
2013-09-27 00:07:01 +00:00
Venkatraman Govindaraju 3816d43a9a Implements parsing and emitting of .cfi_window_save in MC.
llvm-svn: 191431
2013-09-26 14:49:40 +00:00
Amara Emerson b4ad2f396a [ARM] Use the load-acquire/store-release instructions optimally in AArch32.
Patch by Artyom Skrobov.

llvm-svn: 191428
2013-09-26 12:22:36 +00:00
Andrew Trick 71e8bb6d1d Added temp flag -misched-bench for staging in default changes.
llvm-svn: 191423
2013-09-26 05:53:35 +00:00
Eric Christopher 4c7e6ba7d3 Dump the normal dwarf pubtypes section as well.
llvm-svn: 191408
2013-09-25 23:02:41 +00:00
Andrew Trick b6854d80e3 Mark the x86 machine model as incomplete. PR17367.
Ideally, the machinel model is added at the time the instructions are
defined. But many instructions in X86InstrSSE.td still need a model.

Without this workaround the scheduler asserts because x86 already has
itinerary classes for these instructions, indicating they should be
modeled by the scheduler. Since we use the new machine model for other
instructions, it expects a new machine model for these too.

llvm-svn: 191391
2013-09-25 18:14:12 +00:00
Joerg Sonnenberger 7278edc5b4 Undefine NetBSD, it may have been defined by an earlier include of
sys/param.h.

llvm-svn: 191384
2013-09-25 17:49:57 +00:00
David Majnemer 0c58bc64a4 MC: Add support for treating $ as a reference to the PC
The binutils assembler supports a mode called DOLLAR_DOT which treats
the dollar sign token as a reference to the current program counter if
the dollar sign doesn't precede a constant or identifier.

This commit adds a new MCAsmInfo flag stating whether or not a given
target supports this interpretation of the dollar sign token; by
default, this flag is not enabled.

Further, enable this flag for PPC. The system assembler for AIX and
binutils both support using the dollar sign in this manner.

This fixes PR17353.

llvm-svn: 191368
2013-09-25 10:47:21 +00:00
David Majnemer 1ccd2f2aee MC: Remove vestigial PCSymbol field from AsmInfo
llvm-svn: 191362
2013-09-25 09:36:11 +00:00
Peter Collingbourne dda3591f48 Try again to fix the MSVC build.
llvm-svn: 191359
2013-09-25 07:52:21 +00:00
Peter Collingbourne 445eb3327b Wrap the #include of <stdbool.h> in an #ifndef __cplusplus.
This should fix the MSVC build.

llvm-svn: 191357
2013-09-25 07:11:58 +00:00
Peter Collingbourne 4ccf0f1bef Move LTO support library to a component, allowing it to be tested
more reliably across platforms.  Patch by Tom Roeder!

llvm-svn: 191343
2013-09-24 23:52:22 +00:00
David Blaikie ecd21fff61 llvm-dwarfdump support for gnu_pubtypes
llvm-svn: 191329
2013-09-24 19:50:00 +00:00
Benjamin Kramer fd4777c046 Teach MemoryBuiltins and InstructionSimplify that operator new never returns NULL.
This is safe per C++11 18.6.1.1p3: [operator new returns] a non-null pointer to
suitably aligned storage (3.7.4), or else throw a bad_alloc exception. This
requirement is binding on a replacement version of this function.

Brings us a tiny bit closer to eliminating more vector push_backs.

llvm-svn: 191310
2013-09-24 16:37:51 +00:00
Daniel Sanders e508704b52 [mips][msa] Added support for matching vshf from normal IR (i.e. not intrinsics)
llvm-svn: 191301
2013-09-24 14:02:15 +00:00
Daniel Sanders e1d2435543 [mips][msa] Added support for matching bsel and bseli from normal IR (i.e. not intrinsics)
This required correcting the definition of the bsel and bseli intrinsics.

llvm-svn: 191290
2013-09-24 12:04:44 +00:00
Jiangning Liu 63dc840fc5 Initial support for Neon scalar instructions.
Patch by Ana Pazos.

1.Added support for v1ix and v1fx types.
2.Added Scalar Pairwise Reduce instructions.
3.Added initial implementation of Scalar Arithmetic instructions.

llvm-svn: 191263
2013-09-24 02:47:27 +00:00
Reid Kleckner 36cf1f02f8 Explicitly request unsigned enum types when desired
The underlying type of all plain enums in MSVC is 'int', even if the
enumerator contains large 32-bit unsigned values or values greater than
UINT_MAX.  The only way to get a large or unsigned enum type is to
request it explicitly with the C++11 strong enum types feature.

However, since LLVM isn't C++11 yet, I had to add a conditional
LLVM_ENUM_INT_TYPE to Compiler.h to control its usage.

The motivating true positive for this change is compiling PointerIntPair
with MSVC for win64.  The PointerIntMask value is supposed to be pointer
sized value of all ones with some low zeros.  Instead, it's truncated to
32-bits!  We are only saved later because it is sign extended back in
the AND with int64_t, and we happen to want all ones.

This silences lots of -Wmicrosoft warnings during a clang self-host
targeting Windows.

llvm-svn: 191241
2013-09-23 23:26:57 +00:00
David Blaikie 03c089cf97 llvm-dwarfdump/libDebugInfo support for type units
llvm-svn: 191234
2013-09-23 22:44:47 +00:00
David Blaikie 07e22449a3 Exract most of DWARFCompileUnit into a new DWARFUnit to prepare for the coming DWARFTypeUnit.
llvm-svn: 191233
2013-09-23 22:44:40 +00:00
Daniel Sanders a4c8f3a7b0 [mips][msa] Added support for matching insert and copy from normal IR (i.e. not intrinsics)
Changes to MIPS SelectionDAG:
* Added nodes VEXTRACT_[SZ]EXT_ELT to represent extract and extend in a single
  operation and implemented the DAG combines necessary to fold sign/zero
  extends into the extract.

llvm-svn: 191199
2013-09-23 14:03:12 +00:00
David Blaikie 4f099cb2ba Remove dead code
llvm-svn: 191179
2013-09-22 18:25:32 +00:00
David Blaikie ba860d74ba StringRef-ize some things
llvm-svn: 191178
2013-09-22 17:01:50 +00:00
Benjamin Kramer 8817cca5ce Provide basic type safety for array_pod_sort comparators.
This makes using array_pod_sort significantly safer. The implementation relies
on function pointer casting but that should be safe as we're dealing with void*
here.

llvm-svn: 191175
2013-09-22 14:09:50 +00:00
Anders Waldenborg fc8ca53329 Revert "llvm-c: Add LLVMGetPointerToFunction"
This reverts r191030

llvm-svn: 191075
2013-09-20 07:00:36 +00:00
Andrew Trick 978674b2bc Allow subtarget selection of the default MachineScheduler and document the interface.
The global registry is used to allow command line override of the
scheduler selection, but does not work well as the normal selection
API. For example, the same LLVM process should be able to target
multiple targets or subtargets.

llvm-svn: 191071
2013-09-20 05:14:41 +00:00
David Blaikie efd0bcb70f DebugInfo: GDBIndexEntry*String conversion functions now return const char* for easy llvm::formating
This was previously invoking UB by passing a user-defined type to
format. Thanks to Jordan Rose for pointing this out.

llvm-svn: 191060
2013-09-20 00:33:15 +00:00
Richard Mitton 89a4bc6dc3 Fixed warning
llvm-svn: 191053
2013-09-19 23:21:07 +00:00
Richard Mitton 21101b3231 Added support for generate DWARF .debug_aranges sections automatically.
llvm-svn: 191052
2013-09-19 23:21:01 +00:00
David Blaikie 404d3047c0 DebugInfo: llvm-dwarfdump support for gnu_pubnames section
llvm-svn: 191050
2013-09-19 23:01:29 +00:00
David Blaikie d0a869d0bf DebugInfo: Improve IR annotation comments for GNU pubthings.
llvm-svn: 191043
2013-09-19 22:19:37 +00:00
Benjamin Kramer 4f921f1afc Unbreak C++03 build.
llvm-svn: 191039
2013-09-19 21:30:00 +00:00
David Blaikie 8dec407649 Unshift the GDB index/GNU pubnames constants modified in r191025
Based on code review feedback from Eric Christopher, unshifting these
constants as they can appear in the gdb_index itself, shifted a further
24 bits. This means that keeping them preshifted is a bit inflexible, so
let's not do that.

Given the motivation, wrap up some nicer enums, more type safety, and
some utility functions.

llvm-svn: 191035
2013-09-19 20:40:26 +00:00
Anders Waldenborg 8bbda41c6e llvm-c: Add LLVMGetPointerToFunction
Differential Revision: http://llvm-reviews.chandlerc.com/D1715

llvm-svn: 191030
2013-09-19 19:55:06 +00:00
Anders Waldenborg 5b15455823 llvm-c: Make LLVMGetFirstTarget a proper prototype
This avoids warnings when included in a application that
uses -Wstrict-prototypes.

Differential Revision: http://llvm-reviews.chandlerc.com/D1713

llvm-svn: 191029
2013-09-19 19:43:55 +00:00
David Blaikie b20db58a4d DebugInfo: Simplify gnu_pubnames index computation.
Names open to bikeshedding. Could switch back to the constants being
unshifted, but this way seems a bit easier to work with.

llvm-svn: 191025
2013-09-19 18:39:59 +00:00
Shuxin Yang a9df0db27d Add function DominatorTree::getDescendants().
As its name suggests, this function will return all basic blocks
dominated by a given block.

llvm-svn: 191014
2013-09-19 17:18:35 +00:00
Amara Emerson 3308909508 [ARMv8] Add support for the v8 cryptography extensions.
llvm-svn: 190996
2013-09-19 11:59:01 +00:00
Andrew Trick b5e1e6cc11 Revert "Encapsulate PassManager debug flags to avoid static init and cxa_exit."
Working on a better solution to this.

This reverts commit 7d4e9934e7ca83094c5cf41346966c8350179ff2.

llvm-svn: 190990
2013-09-19 06:02:43 +00:00
Andrew Trick f33d6df899 Encapsulate PassManager debug flags to avoid static init and cxa_exit.
This puts all the global PassManager debugging flags, like
-print-after-all and -time-passes, behind a managed static. This
eliminates their static initializers and, more importantly, exit-time
destructors.

The only behavioral change I anticipate is that tools need to
initialize the PassManager before parsing the command line in order to
export these options, which makes sense. Tools that already initialize
the standard passes (opt/llc) don't need to do anything new.

llvm-svn: 190974
2013-09-18 23:31:16 +00:00
Adrian Prantl 262bcf4584 Debug info: Get rid of the VLA indirection hack in FastISel.
Use the DIVariable::isIndirect() flag set by the frontend instead of
guessing whether to set the machine location's indirection bit.
Paired commit with CFE.

llvm-svn: 190961
2013-09-18 22:08:59 +00:00
Joey Gouly 2f8890ed1c [ARMv8] Add CRC instructions.
Patch by Bradley Smith!

llvm-svn: 190928
2013-09-18 09:45:55 +00:00
Craig Topper a8442344ed Fix X86 subtarget to not overwrite the autodetected features by calling InitMCProcessorInfo right after detecting them. Instead add a new function that only updates the scheduling model and call that.
llvm-svn: 190919
2013-09-18 05:54:09 +00:00
Arnold Schwaighofer cae8735a54 Costmodel: Add support for horizontal vector reductions
Upcoming SLP vectorization improvements will want to be able to estimate costs
of horizontal reductions. Add infrastructure to support this.

We model reductions as a series of (shufflevector,add) tuples ultimately
followed by an extractelement. For example, for an add-reduction of <4 x float>
we could generate the following sequence:

 (v0, v1, v2, v3)
   \   \  /  /
     \  \  /
       +  +

 (v0+v2, v1+v3, undef, undef)
    \      /
 ((v0+v2) + (v1+v3), undef, undef)

 %rdx.shuf = shufflevector <4 x float> %rdx, <4 x float> undef,
                           <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
 %bin.rdx = fadd <4 x float> %rdx, %rdx.shuf
 %rdx.shuf7 = shufflevector <4 x float> %bin.rdx, <4 x float> undef,
                          <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
 %bin.rdx8 = fadd <4 x float> %bin.rdx, %rdx.shuf7
 %r = extractelement <4 x float> %bin.rdx8, i32 0

This commit adds a cost model interface "getReductionCost(Opcode, Ty, Pairwise)"
that will allow clients to ask for the cost of such a reduction (as backends
might generate more efficient code than the cost of the individual instructions
summed up). This interface is excercised by the CostModel analysis pass which
looks for reduction patterns like the one above - starting at extractelements -
and if it sees a matching sequence will call the cost model interface.

We will also support a second form of pairwise reduction that is well supported
on common architectures (haddps, vpadd, faddp).

 (v0, v1, v2, v3)
  \   /    \  /
 (v0+v1, v2+v3, undef, undef)
    \     /
 ((v0+v1)+(v2+v3), undef, undef, undef)

  %rdx.shuf.0.0 = shufflevector <4 x float> %rdx, <4 x float> undef,
        <4 x i32> <i32 0, i32 2 , i32 undef, i32 undef>
  %rdx.shuf.0.1 = shufflevector <4 x float> %rdx, <4 x float> undef,
        <4 x i32> <i32 1, i32 3, i32 undef, i32 undef>
  %bin.rdx.0 = fadd <4 x float> %rdx.shuf.0.0, %rdx.shuf.0.1
  %rdx.shuf.1.0 = shufflevector <4 x float> %bin.rdx.0, <4 x float> undef,
        <4 x i32> <i32 0, i32 undef, i32 undef, i32 undef>
  %rdx.shuf.1.1 = shufflevector <4 x float> %bin.rdx.0, <4 x float> undef,
        <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
  %bin.rdx.1 = fadd <4 x float> %rdx.shuf.1.0, %rdx.shuf.1.1
  %r = extractelement <4 x float> %bin.rdx.1, i32 0

llvm-svn: 190876
2013-09-17 18:06:50 +00:00
Ben Langmuir de39520f79 Add llvm.x86.* intrinsics for Intel SHA Extensions
Add llvm.x86.* intrinsics for all of the Intel SHA Extensions instructions, as
well as tests. Also remove mayLoad and hasSideEffects, which can be inferred
from the instruction patterns.

llvm-svn: 190864
2013-09-17 13:44:39 +00:00
Craig Topper 79d1bff2ad Make a more clear AVX-512 section header that matches similar in the file.
llvm-svn: 190843
2013-09-17 03:34:09 +00:00
Adrian Prantl 35c885879a simplify expression
llvm-svn: 190826
2013-09-17 00:15:33 +00:00
Adrian Prantl db3e26d193 Debug info: Fix PR16736 and rdar://problem/14990587.
A DBG_VALUE is register-indirect iff the first operand is a register
_and_ the second operand is an immediate.

llvm-svn: 190821
2013-09-16 23:29:03 +00:00
Matt Arsenault 899f7d2b00 MemCpyOptimizer: Use max legal int size instead of pointer size
If there are no legal integers, assume 1 byte.

This makes more sense than using the pointer size as
a guess for the maximum GPR width.

It is conceivable to want to use some 64-bit pointers
on a target where 64-bit integers aren't legal.

llvm-svn: 190817
2013-09-16 22:43:16 +00:00
Peter Collingbourne 3fa50f9b05 Implement function prefix data as an IR feature.
Previous discussion:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html

Differential Revision: http://llvm-reviews.chandlerc.com/D1191

llvm-svn: 190773
2013-09-16 01:08:15 +00:00
Benjamin Kramer ac511cac77 ELF: Add support for the exclude section bit for gas compat.
llvm-svn: 190769
2013-09-15 19:53:20 +00:00
Chandler Carruth ebeac5cb89 Remove the long, long defunct IR block placement pass.
This pass was based on the previous (essentially unused) profiling
infrastructure and the assumption that by ordering the basic blocks at
the IR level in a particular way, the correct layout would happen in the
end. This sometimes worked, and mostly didn't. It also was a really
naive implementation of the classical paper that dates from when branch
predictors were primarily directional and when loop structure wasn't
commonly available. It also didn't factor into the equation
non-fallthrough branches and other machine level details.

Anyways, for all of these reasons and more, I wrote
MachineBlockPlacement, which completely supercedes this pass. It both
uses modern profile information infrastructure, and actually works. =]

llvm-svn: 190748
2013-09-14 09:28:14 +00:00
Filip Pizlo 67d9709341 Make PrettyStackTraceEntry use ManagedStatic for its ThreadLocal.
This was somewhat tricky because ~PrettyStackTraceEntry() may run after 
llvm_shutdown() has been called. This is rare and only happens for a common idiom 
used in the main() functions of command-line tools. This works around the idiom by 
skipping the stack clean-up if the PrettyStackTraceHead ManagedStatic is not 
constructed (i.e. llvm_shutdown() has been called).

llvm-svn: 190730
2013-09-13 22:59:47 +00:00
Benjamin Kramer e35e7c982f Add warn_unused_result to empty() on various containers.
empty() doesn't actually empty out the container, making this a common typo.

llvm-svn: 190708
2013-09-13 17:33:24 +00:00
Eric Christopher dd1a01203d Add initial support for handling gnu style pubnames accepted by some
versions of gold. This support is designed to allow gold to produce
gdb_index sections similar to the accelerator tables and consumable
by gdb.

llvm-svn: 190649
2013-09-13 00:35:05 +00:00
Joey Gouly 904d8806ce Somehow this important part of the patch, where I actually check the Mask,
got lost during my iterations of review.

Thanks to Hal for spotting it!

llvm-svn: 190604
2013-09-12 14:23:19 +00:00
Joey Gouly 0e76fa7df5 Add an instruction deprecation feature to TableGen.
The 'Deprecated' class allows you to specify a SubtargetFeature that the
instruction is deprecated on.

The 'ComplexDeprecationPredicate' class allows you to define a custom
predicate that is called to check for deprecation.
For example:
  ComplexDeprecationPredicate<"MCR">

would mean you would have to define the following function:
  bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
                             std::string &Info)

Which returns 'false' for not deprecated, and 'true' for deprecated
and store the warning message in 'Info'.

The MCTargetAsmParser constructor was chaned to take an extra argument of
the MCInstrInfo class, so out-of-tree targets will need to be changed.

llvm-svn: 190598
2013-09-12 10:28:05 +00:00
Matt Arsenault a9e7c7abdc Fix comment to match what the assert actually enforces
llvm-svn: 190566
2013-09-12 01:07:54 +00:00
Bill Wendling 7b650a751f Use the appropriate return type for the compact unwind encoding.
llvm-svn: 190551
2013-09-11 21:47:57 +00:00
Hal Finkel 8f2e700522 Add getUnrollingPreferences to TTI
Allow targets to customize the default behavior of the generic loop unrolling
transformation. This will be used by the PowerPC backend when targeting the A2
core (which is in-order with a deep pipeline), and using more aggressive
defaults is important.

llvm-svn: 190542
2013-09-11 19:25:43 +00:00
Manman Ren fa7b0b8767 Debug Info: move class definition of DIRef.
Definition of DIRef used to require the full definition of DIType because
of usage of DIType::isType in DIRef::resolve. We now use DIDescriptor::isType
instead to remove the requirement and move definition of DIRef before DIType.

With this, we can move the definition of DIType::getContext to the header
file.

llvm-svn: 190540
2013-09-11 18:55:55 +00:00
Benjamin Kramer bd4ac9bc6d Path: Add an in-place version of path::native.
This reflects the common use case of nativizing a prepared path. The existing
version invokes undefined behavior if input = output, add an assert to catch
that case.

llvm-svn: 190510
2013-09-11 10:45:21 +00:00
Daniel Sanders cb2929c239 [mips][msa] Corrected the definition of the dotp_[su].[hwd] intrinsics
The elements of the operands should be half the width of the elements of
the result.

llvm-svn: 190505
2013-09-11 09:59:17 +00:00
Nico Rieck 92d649ad61 Support ANSI escape code on Windows
In some cases (e.g. when a build system pipes stderr) the Windows console
API cannot be used to color output. For these, provide a way to switch to
ANSI escape codes. This is required for Clang's -fansi-escape-codes option.

llvm-svn: 190460
2013-09-11 00:36:48 +00:00
Matt Arsenault a90a18e0ea Teach ScalarEvolution about pointer address spaces
llvm-svn: 190425
2013-09-10 19:55:24 +00:00
Rui Ueyama 471d0c57e7 Add getenv() wrapper that works on multibyte environment variable.
On Windows, character encoding of multibyte environment variable varies
depending on settings. The only reliable way to handle it I think is to use
GetEnvironmentVariableW().

GetEnvironmentVariableW() works on wchar_t string, which is on Windows UTF16
string. That's not ideal because we use UTF-8 as the internal encoding in LLVM.
This patch defines a wrapper function which takes and returns UTF-8 string for
GetEnvironmentVariableW().

The wrapper function does not do any conversion and just forwards the argument
to getenv() on Unix.

Differential Revision: http://llvm-reviews.chandlerc.com/D1612

llvm-svn: 190423
2013-09-10 19:45:51 +00:00
Manman Ren 34b3dcc3b5 Debug Info: define a DIRef template.
Specialize the constructors for DIRef<DIScope> and DIRef<DIType> to make sure
the Value is indeed a scope ref and a type ref.

Use DIScopeRef for DIScope::getContext and DIType::getContext and use DITypeRef
for getContainingType and getClassType.

DIScope::generateRef now returns a DIScopeRef instead of a "Value *" for
readability and type safety.

llvm-svn: 190418
2013-09-10 18:30:07 +00:00
Daniel Sanders f561730af8 [mips][msa] Removed unsupported dot product instructions (dotp_[su].b)
The dotp_[su].b instructions never existed in any revision of the MSA spec.

llvm-svn: 190398
2013-09-10 09:51:43 +00:00
Manman Ren de897a369a Debug Info: move DIScope::getContext back from DwarfDebug.
This partially reverts r190330. DIScope::getContext now returns DIScopeRef
instead of DIScope. We construct a DIScopeRef from DIScope when we are
dealing with subprogram, lexical block or name space.

llvm-svn: 190362
2013-09-09 22:35:23 +00:00
Jack Carter 170a5f2983 white spaces and long lines
llvm-svn: 190358
2013-09-09 22:02:08 +00:00
Eric Christopher b0e769411d Add the gnu pubnames and pubtypes sections to the mc object file
handling.

llvm-svn: 190344
2013-09-09 20:03:14 +00:00
Eric Christopher add00faa96 Add constant defines for gnu pubnames and gnu pubtypes - they're used
for the gdb index as the names convey.

llvm-svn: 190343
2013-09-09 20:03:11 +00:00
Eric Christopher e5679d8f5b Formatting.
llvm-svn: 190342
2013-09-09 20:03:08 +00:00
Bill Wendling 550c76dbd6 Call generateCompactUnwindEncodings() right before we need to output the frame information.
There are more than one paths to where the frame information is emitted. Place
the call to generateCompactUnwindEncodings() into the method which outputs the
frame information, thus ensuring that the encoding is there for every path. This
involved threading the MCAsmBackend object through to this method.

<rdar://problem/13623355>

llvm-svn: 190335
2013-09-09 19:48:37 +00:00
Manman Ren 116868eadd Debug Info: Use DIScopeRef for DIType::getContext.
In DIBuilder, the context field of a TAG_member is updated to use the
scope reference. Verifier is updated accordingly.
    
DebugInfoFinder now needs to generate a type identifier map to have
access to the actual scope. Same applies for BreakpointPrinter.
    
processModule of DebugInfoFinder is called during initialization phase
of the verifier to make sure the type identifier map is constructed early
enough.
    
We are now able to unique a simple class as demonstrated by the added
testing case.

llvm-svn: 190334
2013-09-09 19:47:11 +00:00
Manman Ren 33796c5e98 Debug Info: move DIScope::getContext to DwarfDebug.
DIScope::getContext is a wrapper function that calls the specific getContext
method on each subclass. When we switch DIType::getContext to return DIScopeRef
instead of DIScope, DIScope::getContext can no longer return a DIScope without
a type identifier map.
    
DIScope::getContext is only used by DwarfDebug, so we move it to DwarfDebug
to have easy access to the type identifier map.

llvm-svn: 190330
2013-09-09 19:23:58 +00:00
Bob Wilson e407736a06 Revert patches to add case-range support for PR1255.
The work on this project was left in an unfinished and inconsistent state.
Hopefully someone will eventually get a chance to implement this feature, but
in the meantime, it is better to put things back the way the were.  I have
left support in the bitcode reader to handle the case-range bitcode format,
so that we do not lose bitcode compatibility with the llvm 3.3 release.

This reverts the following commits: 155464, 156374, 156377, 156613, 156704,
156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575,
157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884,
157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100,
159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659,
159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736

llvm-svn: 190328
2013-09-09 19:14:35 +00:00
Manman Ren 3eb9dffc89 Debug Info: Move isSubprogramContext from DebugInfo to DwarfDebug.
This helper function needs the type identifier map when we switch
DIType::getContext to return DIScopeRef instead of DIScope.

Since isSubprogramContext is used by DwarfDebug only, We move it to DwarfDebug
to have easy access to the map.

llvm-svn: 190325
2013-09-09 19:05:21 +00:00
Manman Ren 856191b0d1 Debug Info: Rename DITypeRef to DIScopeRef.
A reference to a scope is more general than a reference to a type since
DIType is a subclass of DIScope.

A reference to a type can be either an identifier for the type or
the DIType itself, while a reference to a scope can be either an
identifier for the type (when the scope is indeed a type) or the
DIScope itself. A reference to a type and a reference to a scope
will be resolved in the same way. The only difference is in the
verifier when a field is a reference to a type (i.e. the containing
type field of a DICompositeType) or a field is a reference to a scope
(i.e. the context field of a DIType).

This is to get ready for switching DIType::getContext to return
DIScopeRef instead of DIScope.

Tighten up isTypeRef and isScopeRef to make sure the identifier is not
empty and the MDNode is DIType for TypeRef and DIScope for ScopeRef.

llvm-svn: 190322
2013-09-09 19:03:51 +00:00
Bill Wendling 58e2d3d856 Generate compact unwind encoding from CFI directives.
We used to generate the compact unwind encoding from the machine
instructions. However, this had the problem that if the user used `-save-temps'
or compiled their hand-written `.s' file (with CFI directives), we wouldn't
generate the compact unwind encoding.

Move the algorithm that generates the compact unwind encoding into the
MCAsmBackend. This way we can generate the encoding whether the code is from a
`.ll' or `.s' file.

<rdar://problem/13623355>

llvm-svn: 190290
2013-09-09 02:37:14 +00:00
Manman Ren b09878728f Revert r190269 to fix dragonegg failures.
llvm-svn: 190271
2013-09-08 06:02:56 +00:00
Manman Ren 93da987ea4 Debug Info: pass in DIScope instead of DIDescriptor in createMemberType.
Improve readability. No functionality change.

llvm-svn: 190269
2013-09-08 04:07:59 +00:00
Bill Wendling d14f153a7e Run clang-format on these header files. Part of a WIP.
llvm-svn: 190250
2013-09-07 11:55:36 +00:00
Manman Ren c4ae9b3aeb Debug Info: Use identifier to reference DIType in containing type field of
a DISubprogram.
    
Verifier is updated accordingly.

llvm-svn: 190229
2013-09-07 00:04:05 +00:00
Manman Ren 275520608b Debug Info: pass in VTableHolder as DIType instead of MDNode *.
Remove one cast and improve readability. No functionality change.

llvm-svn: 190225
2013-09-06 23:54:23 +00:00
Manman Ren d8c68b1852 TBAA: add isTBAAVtableAccess to MDNode so clients can call the function
instead of having its own implementation.

The implementation of isTBAAVtableAccess is in TypeBasedAliasAnalysis.cpp
since it is related to the format of TBAA metadata.

The path for struct-path tbaa will be exercised by
test/Instrumentation/ThreadSanitizer/read_from_global.ll, vptr_read.ll, and
vptr_update.ll when struct-path tbaa is on by default.

llvm-svn: 190216
2013-09-06 22:47:05 +00:00
Manman Ren d8f798ea97 Debug Info: Use identifier to reference DIType in containing type field of
a DICompositeType.
    
Verifier is updated accordingly.

llvm-svn: 190190
2013-09-06 18:46:00 +00:00
Manman Ren 277206fa28 Debug Info: Move a helper function getTypeIdentifier from DIBuilder to be part
of DIType.
    
Implement DIType::generateRef to return a type reference. This function will be
used in setContaintingType and in DIBuilder to generete the type reference.
    
No functionality change.

llvm-svn: 190188
2013-09-06 18:27:00 +00:00
Andrew Trick b248b4a1de mi-sched: cleanup register pressure update, remove a FIXME.
llvm-svn: 190181
2013-09-06 17:32:47 +00:00
Andrew Trick 75e411cc8e Added MachineSchedPolicy.
Allow subtargets to customize the generic scheduling strategy.
This is convenient for targets that don't need to add new heuristics
by specializing the strategy.

llvm-svn: 190176
2013-09-06 17:32:34 +00:00
Matthias Braun 305ef7f5b0 avoid unnecessary direct access to LiveInterval::ranges
llvm-svn: 190170
2013-09-06 16:44:32 +00:00
Matthias Braun 90e0d3c03a remove unused argument from LiveRanges::join()
llvm-svn: 190169
2013-09-06 16:44:29 +00:00
Matthias Braun 9804f81fde fix typo in comment
llvm-svn: 190165
2013-09-06 16:19:22 +00:00