platform/upstream/llvm.git
11 years agoAdd register encoding support in X86 backend
Michael Liao [Thu, 4 Oct 2012 19:50:43 +0000 (19:50 +0000)]
Add register encoding support in X86 backend

- Add 'HwEncoding' for X86 registers and call getEncodingValue() to
  retrieve their encoding values.
- This's the first step to adopt new scheme. Furthur revising is onging.

llvm-svn: 165241

11 years agoDriver: Link crtfastmath.o if it's available and -ffast-math is specified.
Benjamin Kramer [Thu, 4 Oct 2012 19:42:20 +0000 (19:42 +0000)]
Driver: Link crtfastmath.o if it's available and -ffast-math is specified.

crtfastmath.o contains routines to set the floating point flags to a faster,
unsafe mode. Linking it in speeds up code dealing with denormals significantly
(PR14024).

For now this is only enabled on linux where I can test it and crtfastmath.o is
widely available. We may want to provide a similar file with compiler-rt
eventually and/or enable it on other platforms too.

llvm-svn: 165240

11 years agoFix doxygen comment to match parameters' names.
Jakub Staszak [Thu, 4 Oct 2012 19:10:44 +0000 (19:10 +0000)]
Fix doxygen comment to match parameters' names.

llvm-svn: 165239

11 years agoAdd a comment to the commit r165187.
Jakub Staszak [Thu, 4 Oct 2012 19:08:30 +0000 (19:08 +0000)]
Add a comment to the commit r165187.

llvm-svn: 165238

11 years ago- add tokens to PPCInstrInfo.td and PPCInstr64Bit.td to resolve
Will Schmidt [Thu, 4 Oct 2012 18:14:28 +0000 (18:14 +0000)]
- add tokens to PPCInstrInfo.td and PPCInstr64Bit.td to resolve
"Instruction 'foo' has no tokens" errors during llvm-tblgen
-gen-asm-matcher attempts.  At this time, the added
tokens are "#comment" style rather than the actual mnemonic.  This will
be revisited once the rest of the base asmparser bits get straightened
out for ppc64-elf-linux.

llvm-svn: 165237

11 years agoGet MCSchedModel directly from the subtarget.
Jakob Stoklund Olesen [Thu, 4 Oct 2012 17:30:43 +0000 (17:30 +0000)]
Get MCSchedModel directly from the subtarget.

Not all targets have itineraries, but the subtarget always has an
MCSchedModel.

llvm-svn: 165236

11 years agoSwitch MachineTraceMetrics to the new TargetSchedModel interface.
Jakob Stoklund Olesen [Thu, 4 Oct 2012 17:30:40 +0000 (17:30 +0000)]
Switch MachineTraceMetrics to the new TargetSchedModel interface.

llvm-svn: 165235

11 years agoFix scope location when parsing GNU attributes.
Michael Han [Thu, 4 Oct 2012 16:42:52 +0000 (16:42 +0000)]
Fix scope location when parsing GNU attributes.

For GNU attributes, instead of reusing attribute source
location for the scope location, use SourceLocation() since
GNU attributes don not have scope tokens.

llvm-svn: 165234

11 years agotest commit / whitespace
Will Schmidt [Thu, 4 Oct 2012 16:20:24 +0000 (16:20 +0000)]
test commit / whitespace

llvm-svn: 165233

11 years agoSimplifyCFG: Enhance the "remove CFG edge that leads to null pointer dereference...
Benjamin Kramer [Thu, 4 Oct 2012 16:11:49 +0000 (16:11 +0000)]
SimplifyCFG: Enhance the "remove CFG edge that leads to null pointer dereference" optimization to also handle instructions with multiple uses.

We conservatively only check the first use to avoid walking long use chains.
This catches the common case of having both a load and a store to a pointer
supplied by a PHI node.

llvm-svn: 165232

11 years agoRevert 165129
Preston Gurd [Thu, 4 Oct 2012 15:26:04 +0000 (15:26 +0000)]
Revert 165129

llvm-svn: 165231

11 years agotsan for Go: support mallocs before __tsan_init() (required to support cgo code)
Dmitry Vyukov [Thu, 4 Oct 2012 13:54:49 +0000 (13:54 +0000)]
tsan for Go: support mallocs before __tsan_init() (required to support cgo code)

llvm-svn: 165229

11 years agoIn my recent change to avoid use of underaligned memory I didn't notice that
Duncan Sands [Thu, 4 Oct 2012 13:53:21 +0000 (13:53 +0000)]
In my recent change to avoid use of underaligned memory I didn't notice that
cpyDest can be mutated in some cases, which would then cause a crash later if
indeed the memory was underaligned.  This brought down several buildbots, so
I guess the underaligned case is much more common than I thought!

llvm-svn: 165228

11 years agoAvoid calling __asan_init from memcpy(), memmove(), memset() during libSystem initial...
Alexander Potapenko [Thu, 4 Oct 2012 13:41:28 +0000 (13:41 +0000)]
Avoid calling __asan_init from memcpy(), memmove(), memset() during libSystem initialization.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=117.

llvm-svn: 165227

11 years agoThe alignment of an sret parameter is known: it must be at least the
Duncan Sands [Thu, 4 Oct 2012 13:36:31 +0000 (13:36 +0000)]
The alignment of an sret parameter is known: it must be at least the
alignment of the return type.  Teach the optimizers this.

llvm-svn: 165226

11 years agoHoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStr...
Benjamin Kramer [Thu, 4 Oct 2012 13:12:43 +0000 (13:12 +0000)]
Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStreamer.

llvm-svn: 165225

11 years agoFix wrong name in comment.
Duncan Sands [Thu, 4 Oct 2012 13:07:26 +0000 (13:07 +0000)]
Fix wrong name in comment.

llvm-svn: 165224

11 years agoFix PR13969, a mini-phase-ordering issue with the new SROA pass.
Chandler Carruth [Thu, 4 Oct 2012 12:33:50 +0000 (12:33 +0000)]
Fix PR13969, a mini-phase-ordering issue with the new SROA pass.

Currently, we re-visit allocas when something changes about the way they
might be *split* to allow better scalarization to take place. However,
we weren't handling the case when the *promotion* is what would change
the behavior of SROA. When an address derived from an alloca is stored
into another alloca, we consider the first to have escaped. If the
second is ever promoted to an SSA value, we will suddenly be able to run
the SROA pass on the first alloca.

This patch adds explicit support for this form if iteration. When we
detect a store of a pointer derived from an alloca, we flag the
underlying alloca for reprocessing after promotion. The logic works hard
to only do this when there is definitely going to be promotion and it
might remove impediments to the analysis of the alloca.

Thanks to Nick for the great test case and Benjamin for some sanity
check review.

llvm-svn: 165223

11 years ago[ASan] don't build 64-bit runtime on 32-bit Linux platforms
Alexey Samsonov [Thu, 4 Oct 2012 12:22:33 +0000 (12:22 +0000)]
[ASan] don't build 64-bit runtime on 32-bit Linux platforms

llvm-svn: 165222

11 years agoThe memcpy optimizer was happily doing call slot forwarding when the new memory
Duncan Sands [Thu, 4 Oct 2012 10:54:40 +0000 (10:54 +0000)]
The memcpy optimizer was happily doing call slot forwarding when the new memory
was less aligned than the old.  In the testcase this results in an overaligned
memset: the memset alignment was correct for the original memory but is too much
for the new memory.  Fix this by either increasing the alignment of the new
memory or bailing out if that isn't possible.  Should fix the gcc-4.7 self-host
buildbot failure.

llvm-svn: 165220

11 years agoTeach the integer-promotion rewrite strategy to be endianness aware.
Chandler Carruth [Thu, 4 Oct 2012 10:39:28 +0000 (10:39 +0000)]
Teach the integer-promotion rewrite strategy to be endianness aware.
Sorry for this being broken so long. =/

As part of this, switch all of the existing tests to be Little Endian,
which is the behavior I was asserting in them anyways! Add in a new
big-endian test that checks the interesting behavior there.

Another part of this is to tighten the rules abotu when we perform the
full-integer promotion. This logic now rejects cases where there fully
promoted integer is a non-multiple-of-8 bitwidth or cases where the
loads or stores touch bits which are in the allocated space of the
alloca but are not loaded or stored when accessing the integer. Sadly,
these aren't really observable today as the rest of the pass will
already ensure the invariants hold. However, the latter situation is
likely to become a potential concern in the future.

Thanks to Benjamin and Duncan for early review of this patch. I'm still
looking into whether there are further endianness issues, please let me
know if anyone sees BE failures persisting past this.

llvm-svn: 165219

11 years agotsan: add atomic_fetch_sub() and atomic_signal_fence() functions
Dmitry Vyukov [Thu, 4 Oct 2012 10:08:23 +0000 (10:08 +0000)]
tsan: add atomic_fetch_sub() and atomic_signal_fence() functions

llvm-svn: 165218

11 years agoPrefer StringRef::startswith to the strncmp/strlen contraption.
Benjamin Kramer [Thu, 4 Oct 2012 10:06:38 +0000 (10:06 +0000)]
Prefer StringRef::startswith to the strncmp/strlen contraption.

This may be slightly more efficient and is definitely more readable.

llvm-svn: 165217

11 years agoFix typo in comments.
Logan Chien [Thu, 4 Oct 2012 08:08:56 +0000 (08:08 +0000)]
Fix typo in comments.

llvm-svn: 165216

11 years agoFix r165005: The lexical DeclContext is not the right place to make a decision about...
Axel Naumann [Thu, 4 Oct 2012 07:34:43 +0000 (07:34 +0000)]
Fix r165005: The lexical DeclContext is not the right place to make a decision about whether we need to call tryAddTopLevelDecl or not. That call should be made when the DeclContext's redeclaration context is the translation unit.

llvm-svn: 165215

11 years ago[asan] properly report mmap failure
Kostya Serebryany [Thu, 4 Oct 2012 07:21:09 +0000 (07:21 +0000)]
[asan] properly report mmap failure

llvm-svn: 165214

11 years agoUse method to query if there are attributes.
Bill Wendling [Thu, 4 Oct 2012 07:19:46 +0000 (07:19 +0000)]
Use method to query if there are attributes.

llvm-svn: 165213

11 years agoAdd method to query for NoCapture attribute.
Bill Wendling [Thu, 4 Oct 2012 07:18:12 +0000 (07:18 +0000)]
Add method to query for NoCapture attribute.

llvm-svn: 165212

11 years agoUse method to query for NoAlias attribute.
Bill Wendling [Thu, 4 Oct 2012 07:17:46 +0000 (07:17 +0000)]
Use method to query for NoAlias attribute.

llvm-svn: 165211

11 years agoUse attribute query methods.
Bill Wendling [Thu, 4 Oct 2012 07:08:30 +0000 (07:08 +0000)]
Use attribute query methods.

llvm-svn: 165210

11 years agoUse method to query for attributes.
Bill Wendling [Thu, 4 Oct 2012 06:58:52 +0000 (06:58 +0000)]
Use method to query for attributes.

llvm-svn: 165209

11 years agoAdd method to query for 'NoAlias' attribute on call/invoke instructions.
Bill Wendling [Thu, 4 Oct 2012 06:52:09 +0000 (06:52 +0000)]
Add method to query for 'NoAlias' attribute on call/invoke instructions.

llvm-svn: 165208

11 years agoUse method to query for attributes.
Bill Wendling [Thu, 4 Oct 2012 06:49:41 +0000 (06:49 +0000)]
Use method to query for attributes.

llvm-svn: 165207

11 years agoQuery for attributes via the correct method call.
Bill Wendling [Thu, 4 Oct 2012 06:48:57 +0000 (06:48 +0000)]
Query for attributes via the correct method call.

llvm-svn: 165206

11 years agoUse new accessor methods to query for attributes.
Bill Wendling [Thu, 4 Oct 2012 06:43:21 +0000 (06:43 +0000)]
Use new accessor methods to query for attributes.

llvm-svn: 165205

11 years ago[tsan] add 3 internal flags for fine-grain control of what is instrumented and what...
Kostya Serebryany [Thu, 4 Oct 2012 05:28:50 +0000 (05:28 +0000)]
[tsan] add 3 internal flags for fine-grain control of what is instrumented and what is not.

llvm-svn: 165204

11 years agoRemove template from function that is only used with one type after r165092.
Craig Topper [Thu, 4 Oct 2012 05:18:31 +0000 (05:18 +0000)]
Remove template from function that is only used with one type after r165092.

llvm-svn: 165203

11 years agoAdd missing comment for mangling.
Nick Lewycky [Thu, 4 Oct 2012 04:58:17 +0000 (04:58 +0000)]
Add missing comment for mangling.

llvm-svn: 165202

11 years agoFix reg mask slot test, and preserve LiveIntervals and VirtRegMap in the PBQP
Lang Hames [Thu, 4 Oct 2012 04:50:53 +0000 (04:50 +0000)]
Fix reg mask slot test, and preserve LiveIntervals and VirtRegMap in the PBQP
allocator. Fixes PR13945.

llvm-svn: 165201

11 years agodocs: Fix typo on front page
Sean Silva [Thu, 4 Oct 2012 04:41:27 +0000 (04:41 +0000)]
docs: Fix typo on front page

llvm-svn: 165200

11 years agoImplement methods that enable expansion of load immediate
Jack Carter [Thu, 4 Oct 2012 04:03:53 +0000 (04:03 +0000)]
Implement methods that enable expansion of load immediate
macro instruction (li) in the assembler.

We have identified three possible expansions depending on
the size of immediate operand:
  1) for 0 ≤ j ≤ 65535.
     li d,j =>
     ori d,$zero,j

  2) for −32768 ≤ j < 0.
     li d,j =>
     addiu d,$zero,j

  3) for any other value of j that is representable as a 32-bit integer.
     li d,j =>
     lui d,hi16(j)
     ori d,d,lo16(j)

All of the above have been implemented in ths patch.

Contributer: Vladimir Medic
llvm-svn: 165199

11 years agodocs: Sphinxify GoldPlugin document.
Sean Silva [Thu, 4 Oct 2012 03:56:23 +0000 (03:56 +0000)]
docs: Sphinxify GoldPlugin document.

llvm-svn: 165198

11 years agoFail early with a clear assert if an operation with multiple uses somehow ends
Lang Hames [Thu, 4 Oct 2012 03:23:25 +0000 (03:23 +0000)]
Fail early with a clear assert if an operation with multiple uses somehow ends
up being contracted during codegen.

llvm-svn: 165197

11 years agoTest file-scoped FP_CONTRACT pragma.
Lang Hames [Thu, 4 Oct 2012 03:07:37 +0000 (03:07 +0000)]
Test file-scoped FP_CONTRACT pragma.

llvm-svn: 165196

11 years agoPermanently end the whole "pragma got handled by the parser too early"
Eli Friedman [Thu, 4 Oct 2012 02:36:51 +0000 (02:36 +0000)]
Permanently end the whole "pragma got handled by the parser too early"
mess by handling all pragmas which the parser touches uniformly.
<rdar://problem/12248901>, etc.

llvm-svn: 165195

11 years agoThis patch is a partial implementation of mips .set assembler directive. Directive...
Jack Carter [Thu, 4 Oct 2012 02:29:46 +0000 (02:29 +0000)]
This patch is a partial implementation of mips .set assembler directive. Directive is defined as follows:
.set option
The patch implements following options

    at - lets the assembler use the $at register for macros,
         but generates warnings if the source program uses $at

    noat - let source programs use $at without issuingwarnings.

    noreorder - prevents the assembler from reordering machine
                language instructions.
    nomacro - causes the assembler to print a warning whenever
              an assembler operation generates more than one
              machine language instruction.
    macro - lets the assembler generate multiple machine instructions
            from a single assembler instruction
    reorder - lets the assembler reorder machine language
               instructions to improve performance

The above variants are parsed and their boolean values set or unset.
The code to actually use them will come later.

Following options are not implemented yet:

nomips16
nomicromips
move
nomove

Contributer: Vladimir Medic
llvm-svn: 165194

11 years agoPatch submitted by Dan Malea -- I introduced a dependency between
Jason Molenda [Thu, 4 Oct 2012 02:16:06 +0000 (02:16 +0000)]
Patch submitted by Dan Malea -- I introduced a dependency between
ProcessGDBRemote and DynamicLoaderDarwinKernel and a patch was needed
to get this building on Linux.  Thanks!

llvm-svn: 165193

11 years agoRemove a few debug printf's that were left in ProcessKDP.
Jason Molenda [Thu, 4 Oct 2012 02:06:30 +0000 (02:06 +0000)]
Remove a few debug printf's that were left in ProcessKDP.

llvm-svn: 165192

11 years agoI'm getting these errors with r165159:
Bill Wendling [Thu, 4 Oct 2012 01:44:41 +0000 (01:44 +0000)]
I'm getting these errors with r165159:

/Users/void/llvm/llvm-tot.src/projects/compiler-rt/lib/arm/eqdf2vfp.S:22:2: error: instruction requires: VFP2
 vmov d6, r0, r1
 ^
/Users/void/llvm/llvm-tot.src/projects/compiler-rt/lib/arm/eqdf2vfp.S:23:2: error: instruction requires: VFP2
 vmov d7, r2, r3
 ^
/Users/void/llvm/llvm-tot.src/projects/compiler-rt/lib/arm/eqdf2vfp.S:24:2: error: instruction requires: VFP2
 vcmp.f64 d6, d7
 ^
/Users/void/llvm/llvm-tot.src/projects/compiler-rt/lib/arm/eqdf2vfp.S:25:2: error: instruction requires: VFP2
 vmrs apsr_nzcv, fpscr
 ^

llvm-svn: 165191

11 years agotblgen: Whitespace and 80-col cleanup.
Sean Silva [Thu, 4 Oct 2012 00:54:27 +0000 (00:54 +0000)]
tblgen: Whitespace and 80-col cleanup.

llvm-svn: 165190

11 years agoMake sure 'prefix-clang++' is aliased to 'prefix-clang', not 'clang'.
Jordan Rose [Thu, 4 Oct 2012 00:47:59 +0000 (00:47 +0000)]
Make sure 'prefix-clang++' is aliased to 'prefix-clang', not 'clang'.

When aliasing tools, rather than using the base TOOLEXENAME, we should
instead use the built tool's basename (for 'make') or the installed
tool's basename (for 'make install').

This should not cause any changes for anyone building unprefixed 'clang'
and 'clang++' tools.

Patch by Rick Foos!

llvm-svn: 165189

11 years agoEnable -schedmodel, but prefer itineraries until we have more benchmark data.
Andrew Trick [Thu, 4 Oct 2012 00:24:34 +0000 (00:24 +0000)]
Enable -schedmodel, but prefer itineraries until we have more benchmark data.

llvm-svn: 165188

11 years agoFix PR13967.
Jakub Staszak [Wed, 3 Oct 2012 23:59:47 +0000 (23:59 +0000)]
Fix PR13967.

llvm-svn: 165187

11 years ago<rdar://problem/12099592> Adding back a bunch of code-running summaries
Enrico Granata [Wed, 3 Oct 2012 23:53:45 +0000 (23:53 +0000)]
<rdar://problem/12099592> Adding back a bunch of code-running summaries

llvm-svn: 165186

11 years agoAdd an explicit -object_path_lto flag during linking with a uniquified temporary
Bill Wendling [Wed, 3 Oct 2012 23:52:10 +0000 (23:52 +0000)]
Add an explicit -object_path_lto flag during linking with a uniquified temporary
file name if building Apple-style.

llvm-svn: 165185

11 years agoAdd an explicit -object_path_lto flag during linking with a uniquified temporary
Bill Wendling [Wed, 3 Oct 2012 23:49:57 +0000 (23:49 +0000)]
Add an explicit -object_path_lto flag during linking with a uniquified temporary
file name if building Apple-style.

llvm-svn: 165184

11 years agoClean up tailing whitespaces
Michael Liao [Wed, 3 Oct 2012 23:43:52 +0000 (23:43 +0000)]
Clean up tailing whitespaces

llvm-svn: 165182

11 years agoAdded missing break in StockSectionChunk constructor.
Hemant Kulkarni [Wed, 3 Oct 2012 23:27:33 +0000 (23:27 +0000)]
Added missing break in StockSectionChunk constructor.
Removed architecture dependent .sbss section creation.

Updated test case to show the change in section types and removal of a sbss section.

llvm-svn: 165181

11 years agoAdded instregex support to TableGen subtarget emitter.
Andrew Trick [Wed, 3 Oct 2012 23:06:32 +0000 (23:06 +0000)]
Added instregex support to TableGen subtarget emitter.

This allows the processor-specific machine model to override selected
base opcodes without any fanciness.
e.g. InstRW<[CoreXWriteVANDP], (instregex "VANDP")>.

llvm-svn: 165180

11 years agoTableGen subtarget emitter, nearly first class support for SchedAlias.
Andrew Trick [Wed, 3 Oct 2012 23:06:28 +0000 (23:06 +0000)]
TableGen subtarget emitter, nearly first class support for SchedAlias.

A processor can now arbitrarily alias one SchedWrite onto
another. Only the SchedAlias definition need be within the processor
model. The aliased SchedWrite may be a SchedVariant, WriteSequence, or
transitively refer to another alias.

llvm-svn: 165179

11 years agoCleanup TableGen subtarget emitter.
Andrew Trick [Wed, 3 Oct 2012 23:06:25 +0000 (23:06 +0000)]
Cleanup TableGen subtarget emitter.

llvm-svn: 165178

11 years agouse ';' instead of '-' in the note part of my last patch.
Fariborz Jahanian [Wed, 3 Oct 2012 22:39:32 +0000 (22:39 +0000)]
use ';' instead of '-' in the note part of my last patch.

llvm-svn: 165177

11 years agoDon't turn on the debugserver log by default.
Jim Ingham [Wed, 3 Oct 2012 22:31:30 +0000 (22:31 +0000)]
Don't turn on the debugserver log by default.

llvm-svn: 165176

11 years agoUpdate test case for r165174.
Chad Rosier [Wed, 3 Oct 2012 22:18:51 +0000 (22:18 +0000)]
Update test case for r165174.

llvm-svn: 165175

11 years ago[ms-inline asm] Default to the 'm' constraint. This matches the behavior of the
Chad Rosier [Wed, 3 Oct 2012 22:18:38 +0000 (22:18 +0000)]
[ms-inline asm] Default to the 'm' constraint.  This matches the behavior of the
MSVC compiler.

llvm-svn: 165174

11 years ago[ms-inline asm] Add support in the X86AsmPrinter for printing memory references
Chad Rosier [Wed, 3 Oct 2012 22:06:44 +0000 (22:06 +0000)]
[ms-inline asm] Add support in the X86AsmPrinter for printing memory references
in the Intel syntax.

The MC layer supports emitting in the Intel syntax, but this would require the
inline assembly MachineInstr to be lowered to an MCInst before emission.  This
is potential future work, but for now emitting directly from the MachineInstr
suffices.

llvm-svn: 165173

11 years agoThis patch moves from using a hard coded number (4)
Jack Carter [Wed, 3 Oct 2012 21:58:54 +0000 (21:58 +0000)]
This patch moves from using a hard coded number (4)
for the number of bytes in a particular instruction
to using
   const MCInstrDesc &Desc = MCII.get(TmpInst.getOpcode());
   Desc.getSize()

This is necessary with the advent of 16 bit instructions with
mips16 and micromips. It is also puts Mips in compliance with
the other targets for getting instruction size.

llvm-svn: 165171

11 years ago * Return correct size and alignment for common symbols.
Sid Manning [Wed, 3 Oct 2012 21:46:48 +0000 (21:46 +0000)]
  * Return correct size and alignment for common symbols.

llvm-svn: 165170

11 years ago<rdar://problem/12408181> Fixing a bug where we would try to look for types in a...
Enrico Granata [Wed, 3 Oct 2012 21:31:35 +0000 (21:31 +0000)]
<rdar://problem/12408181> Fixing a bug where we would try to look for types in a module, and then fail to look for them anywhere else because the same SymbolContext was being passed everywhere

llvm-svn: 165169

11 years agotblgen: Remove last traces of old TableGenMain API.
Sean Silva [Wed, 3 Oct 2012 21:31:08 +0000 (21:31 +0000)]
tblgen: Remove last traces of old TableGenMain API.

llvm-svn: 165168

11 years agotblgen: Migrate clang-tblgen to new TableGenMain API.
Sean Silva [Wed, 3 Oct 2012 21:29:30 +0000 (21:29 +0000)]
tblgen: Migrate clang-tblgen to new TableGenMain API.

llvm-svn: 165167

11 years agotblgen: Migrate llvm-tblgen to new TableGenMain API.
Sean Silva [Wed, 3 Oct 2012 21:29:19 +0000 (21:29 +0000)]
tblgen: Migrate llvm-tblgen to new TableGenMain API.

llvm-svn: 165166

11 years agotblgen: Put new TableGenMain API in place.
Sean Silva [Wed, 3 Oct 2012 21:29:18 +0000 (21:29 +0000)]
tblgen: Put new TableGenMain API in place.

In order to avoid rev-lock with Clang when moving to the new API, also
preserve the current API temporarily and insert a shim to implement the
new API in terms of the old.

llvm-svn: 165165

11 years agoAdd function to return return attributes.
Bill Wendling [Wed, 3 Oct 2012 21:19:35 +0000 (21:19 +0000)]
Add function to return return attributes.

llvm-svn: 165164

11 years agoUpdate to use the predicate methods to query if an attribute exists.
Bill Wendling [Wed, 3 Oct 2012 21:17:09 +0000 (21:17 +0000)]
Update to use the predicate methods to query if an attribute exists.

llvm-svn: 165163

11 years agoRemove the directory that these are already in.
Bill Wendling [Wed, 3 Oct 2012 21:08:21 +0000 (21:08 +0000)]
Remove the directory that these are already in.

llvm-svn: 165162

11 years ago[libclang] When indexing, invoke the importedASTFile for PCH files as well.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 21:05:51 +0000 (21:05 +0000)]
[libclang] When indexing, invoke the importedASTFile for PCH files as well.

llvm-svn: 165161

11 years ago[libclang] Simplify indexing of module imports by handling implicit
Argyrios Kyrtzidis [Wed, 3 Oct 2012 21:05:44 +0000 (21:05 +0000)]
[libclang] Simplify indexing of module imports by handling implicit
imports via ImportDecls.

llvm-svn: 165160

11 years agoBack out my temporary workaround for Apple buildbots.
Bob Wilson [Wed, 3 Oct 2012 21:03:42 +0000 (21:03 +0000)]
Back out my temporary workaround for Apple buildbots.
--- Reverse-merging r164909 into '.':
U    make/platform/clang_darwin.mk

llvm-svn: 165159

11 years agoPR14004: Fix typo in documentation.
Richard Smith [Wed, 3 Oct 2012 21:02:25 +0000 (21:02 +0000)]
PR14004: Fix typo in documentation.

llvm-svn: 165158

11 years agoFix invalid reads by memcmp.
Benjamin Kramer [Wed, 3 Oct 2012 20:58:09 +0000 (20:58 +0000)]
Fix invalid reads by memcmp.

Str may be smaller than Start->Name here. Use strncmp to avoid scanning past the
end. Found by valgrind.

llvm-svn: 165157

11 years agoAlways initialize FPContractable.
Benjamin Kramer [Wed, 3 Oct 2012 20:58:04 +0000 (20:58 +0000)]
Always initialize FPContractable.

false is used as a baseline here, we may want to allow contraction in some of
the cases.  Found by valgrind.

llvm-svn: 165156

11 years agoHolger Arnold: Correct the use and testing of __GNUC__ and __GNUC_MINOR__ in <__config>.
Howard Hinnant [Wed, 3 Oct 2012 20:48:05 +0000 (20:48 +0000)]
Holger Arnold:  Correct the use and testing of __GNUC__ and __GNUC_MINOR__ in <__config>.

llvm-svn: 165151

11 years ago[Options] Store the owning OptTable in Option so it can construct Group and Alias.
Michael J. Spencer [Wed, 3 Oct 2012 19:58:10 +0000 (19:58 +0000)]
[Options] Store the owning OptTable in Option so it can construct Group and Alias.

llvm-svn: 165150

11 years agoRemove useless parameter "WantFile" from Driver::GetProgramPath().
Simon Atanasyan [Wed, 3 Oct 2012 19:52:37 +0000 (19:52 +0000)]
Remove useless parameter "WantFile" from Driver::GetProgramPath().
This parameter is useless because nowhere used explicitly and always
gets its default value - "false".

The patch reviewed by Rafael Espindola.

llvm-svn: 165149

11 years agoFix a cycle in the DAG. In this code we replace multiple loads with a single load and
Nadav Rotem [Wed, 3 Oct 2012 19:30:31 +0000 (19:30 +0000)]
Fix a cycle in the DAG. In this code we replace multiple loads with a single load and
multiple stores with a single load. We create the wide loads and stores (and their chains)
before we remove the scalar loads and stores and fix the DAG chain. We attempted to merge
loads with a different chain. When that happened, the assumption that it is safe to RAUW
broke and a cycle was introduced.

llvm-svn: 165148

11 years agoUse unsigned long long instead of uin64_t for OS where that matters.
Nick Kledzik [Wed, 3 Oct 2012 19:27:25 +0000 (19:27 +0000)]
Use unsigned long long instead of uin64_t for OS where that matters.

llvm-svn: 165147

11 years agoAn API in Clang got renamed; fixing LLDB to match.
Sean Callanan [Wed, 3 Oct 2012 19:23:27 +0000 (19:23 +0000)]
An API in Clang got renamed; fixing LLDB to match.

llvm-svn: 165144

11 years agoThis patch enables general varargs support for the 64-bit PPC SVR4 ABI.
Bill Schmidt [Wed, 3 Oct 2012 19:18:57 +0000 (19:18 +0000)]
This patch enables general varargs support for the 64-bit PPC SVR4 ABI.

Most of the pieces for this were already in place, but a proper EmitVAArg
is needed for aggregates and complex numbers to be handled.  Although the
va_list for 64-bit PowerPC SVR4 consists of GPRs 3 through 10 together with
the overflow portion of the parameter save area, we can treat va_list as
pointing to contiguous memory for all parameters, since the back end forces
the parameter GPRs to memory for varargs functions.

There is no need at this time to model parameters and return values beyond
what the DefaultABIInfo provides.

llvm-svn: 165143

11 years agoFix a typo in my last patch reported by Erik Schwiebert.
Fariborz Jahanian [Wed, 3 Oct 2012 19:05:41 +0000 (19:05 +0000)]
Fix a typo in my last patch reported by Erik Schwiebert.

llvm-svn: 165142

11 years agoTypos.
Chad Rosier [Wed, 3 Oct 2012 19:00:20 +0000 (19:00 +0000)]
Typos.

llvm-svn: 165141

11 years agoDon't call getAsUnsignedInteger directly, it fails to compile if uint64_t is not...
Benjamin Kramer [Wed, 3 Oct 2012 18:54:36 +0000 (18:54 +0000)]
Don't call getAsUnsignedInteger directly, it fails to compile if uint64_t is not "unsigned long long".

while there add more test cases.

llvm-svn: 165140

11 years agoRemove ASTReader::needPendingInstantiation(), introduced in r164993,
Douglas Gregor [Wed, 3 Oct 2012 18:38:43 +0000 (18:38 +0000)]
Remove ASTReader::needPendingInstantiation(), introduced in r164993,
which is neither correct nor necessary. The use of this routine was
eliminated by r165137.

llvm-svn: 165139

11 years agoAdd some FIXMEs to the ASTReader code
Douglas Gregor [Wed, 3 Oct 2012 18:36:10 +0000 (18:36 +0000)]
Add some FIXMEs to the ASTReader code

llvm-svn: 165138

11 years agoRevert most of the functionality in r165001. Instead, make sure that
Douglas Gregor [Wed, 3 Oct 2012 18:34:48 +0000 (18:34 +0000)]
Revert most of the functionality in r165001. Instead, make sure that
the ASTReader doesn't attach a body to a function that is already
defined elsewhere.

llvm-svn: 165137

11 years agoAdd getAsUnsignedInteger test case that checks that known bad values are rejected
Nick Kledzik [Wed, 3 Oct 2012 18:15:27 +0000 (18:15 +0000)]
Add getAsUnsignedInteger test case that checks that known bad values are rejected

llvm-svn: 165136

11 years agoNo need to call functions which do the same thing as the default.
Bill Wendling [Wed, 3 Oct 2012 18:10:49 +0000 (18:10 +0000)]
No need to call functions which do the same thing as the default.

llvm-svn: 165135

11 years agoRemove assert that's too restrictive.
Bill Wendling [Wed, 3 Oct 2012 18:08:57 +0000 (18:08 +0000)]
Remove assert that's too restrictive.

llvm-svn: 165134

11 years agoobjective-C arc: Warn under arc about a use of an ivar inside a block
Fariborz Jahanian [Wed, 3 Oct 2012 17:55:29 +0000 (17:55 +0000)]
objective-C arc: Warn under arc about a use of an ivar inside a block
that doesn't have a 'self' as this implicitly captures 'self' and could
create retain cycles. Provide fixit. // rdar://11194874

llvm-svn: 165133

11 years agoAdd methods which query for the specific attribute instead of using the
Bill Wendling [Wed, 3 Oct 2012 17:54:26 +0000 (17:54 +0000)]
Add methods which query for the specific attribute instead of using the
enums. This allows for better encapsulation of the Attributes class.

llvm-svn: 165132