platform/upstream/llvm.git
11 years agoFix an off-by-one error. Also make the code a little more explicit in what it
Chad Rosier [Fri, 28 Jun 2013 18:57:01 +0000 (18:57 +0000)]
Fix an off-by-one error.  Also make the code a little more explicit in what it
is trying to do.

llvm-svn: 185191

11 years agoDebugInfo: Revise r185189 to avoid subtle 'unsigned += bool'
David Blaikie [Fri, 28 Jun 2013 18:55:13 +0000 (18:55 +0000)]
DebugInfo: Revise r185189 to avoid subtle 'unsigned += bool'

llvm-svn: 185190

11 years agoDebugInfo: Simplify the AddressPool representation
David Blaikie [Fri, 28 Jun 2013 18:47:19 +0000 (18:47 +0000)]
DebugInfo: Simplify the AddressPool representation

llvm-svn: 185189

11 years agoDebugInfo: constify the AddressPool MCSymbol pointers
David Blaikie [Fri, 28 Jun 2013 18:47:14 +0000 (18:47 +0000)]
DebugInfo: constify the AddressPool MCSymbol pointers

llvm-svn: 185188

11 years ago(no commit message)
Preston Briggs [Fri, 28 Jun 2013 18:44:48 +0000 (18:44 +0000)]
(no commit message)

llvm-svn: 185187

11 years agoAdd missing case to switch statement - DAGTypeLegalizer::ExpandIntegerResult
Lang Hames [Fri, 28 Jun 2013 18:36:42 +0000 (18:36 +0000)]
Add missing case to switch statement - DAGTypeLegalizer::ExpandIntegerResult
should expand ATOMIC_CMP_SWAP nodes the same way that it does for ATOMIC_SWAP.

Since ATOMIC_LOADs on some targets (e.g. older ARM variants) get legalized to
ATOMIC_CMP_SWAPs, the missing case had been causing i64 atomic loads to crash
during isel.

<rdar://problem/14074644>

llvm-svn: 185186

11 years agoStylistic cleanups, no functional change.
Jakob Stoklund Olesen [Fri, 28 Jun 2013 18:33:19 +0000 (18:33 +0000)]
Stylistic cleanups, no functional change.

- Use static functions instead of anonymous namespace.
- Appease the Doxygen lobby.
- Use 0-based induction variable.

llvm-svn: 185185

11 years agoAdd a division operator to BlockFrequency.
Jakob Stoklund Olesen [Fri, 28 Jun 2013 18:23:42 +0000 (18:23 +0000)]
Add a division operator to BlockFrequency.

Allow a BlockFrequency to be divided by a non-zero BranchProbability
with saturating arithmetic. This will be used to compute the frequency
of a loop header given the probability of leaving the loop.

Our long division algorithm already saturates on overflow, so that was a
freebie.

llvm-svn: 185184

11 years agoDimitry Andric: Add const to constexpr member functions in order to cope with new...
Howard Hinnant [Fri, 28 Jun 2013 18:09:35 +0000 (18:09 +0000)]
Dimitry Andric:  Add const to constexpr member functions in order to cope with new C++1y language rules.  This silences -Wconstexpr-not-const warnings.

llvm-svn: 185181

11 years agoRemove unused variables.
Eric Christopher [Fri, 28 Jun 2013 18:03:54 +0000 (18:03 +0000)]
Remove unused variables.

llvm-svn: 185180

11 years ago[NVPTX] Select -1 instead of 1 when anyextend'ing i1 types
Justin Holewinski [Fri, 28 Jun 2013 17:58:15 +0000 (17:58 +0000)]
[NVPTX] Select -1 instead of 1 when anyextend'ing i1 types

This makes it more consistent with the ZeroOrNegativeOneBooleanContent flag

llvm-svn: 185179

11 years ago[NVPTX] Add (1.0 / sqrt(x)) => rsqrt(x) generation when allowable by FP flags
Justin Holewinski [Fri, 28 Jun 2013 17:58:13 +0000 (17:58 +0000)]
[NVPTX] Add (1.0 / sqrt(x)) => rsqrt(x) generation when allowable by FP flags

llvm-svn: 185178

11 years ago[NVPTX] Calling conventions fix
Justin Holewinski [Fri, 28 Jun 2013 17:58:10 +0000 (17:58 +0000)]
[NVPTX] Calling conventions fix

Fix ABI handling for function
returning bool -- use st.param.b32 to return the value
and use ld.param.b32 in caller to load the return value.

llvm-svn: 185177

11 years ago[NVPTX] Add support for cttz/ctlz/ctpop
Justin Holewinski [Fri, 28 Jun 2013 17:58:07 +0000 (17:58 +0000)]
[NVPTX] Add support for cttz/ctlz/ctpop

llvm-svn: 185176

11 years ago[NVPTX] Clean up comparison/select/convert patterns and factor out PTX instructions...
Justin Holewinski [Fri, 28 Jun 2013 17:58:04 +0000 (17:58 +0000)]
[NVPTX] Clean up comparison/select/convert patterns and factor out PTX instructions from their patterns

Test case is no breakage

llvm-svn: 185175

11 years ago[NVPTX] Remove i8 register class. PTX support for i8 (.b8, .u8, .s8) is rather poor...
Justin Holewinski [Fri, 28 Jun 2013 17:57:59 +0000 (17:57 +0000)]
[NVPTX] Remove i8 register class.  PTX support for i8 (.b8, .u8, .s8) is rather poor and we're better off just ignoring it and letting LLVM expand all i8 ops out to i16.

llvm-svn: 185174

11 years ago[NVPTX] Add support for vectorized function return values
Justin Holewinski [Fri, 28 Jun 2013 17:57:55 +0000 (17:57 +0000)]
[NVPTX] Add support for vectorized function return values

llvm-svn: 185173

11 years ago[NVPTX] Clean up handling of formal arguments and enable generation of vector paramet...
Justin Holewinski [Fri, 28 Jun 2013 17:57:53 +0000 (17:57 +0000)]
[NVPTX] Clean up handling of formal arguments and enable generation of vector parameter loads

llvm-svn: 185172

11 years ago[NVPTX] Add infrastructure for vector loads/stores of parameters
Justin Holewinski [Fri, 28 Jun 2013 17:57:51 +0000 (17:57 +0000)]
[NVPTX] Add infrastructure for vector loads/stores of parameters

llvm-svn: 185171

11 years agoDon't check for "are there any loaded sections" before trying to resolve a breakpoint...
Jim Ingham [Fri, 28 Jun 2013 17:51:33 +0000 (17:51 +0000)]
Don't check for "are there any loaded sections" before trying to resolve a breakpoint site.  We've already got a process,
and any breakpoints with section relative addresses won't resolve their load addresses so they will error out at that point.

<rdar://problem/13900130>

llvm-svn: 185170

11 years agoBug 13662: Enable GPRPair for all i64 operands of inline asm on ARM
Weiming Zhao [Fri, 28 Jun 2013 17:26:02 +0000 (17:26 +0000)]
Bug 13662: Enable GPRPair for all i64 operands of inline asm on ARM

This patch assigns paired GPRs  for inline asm with
64-bit data on ARM. It's enabled for both ARM and Thumb to support modifiers
like %H, %Q, %R.

llvm-svn: 185169

11 years agoLoopVectorize: Pull dyn_cast into setDebugLocFromInst
Arnold Schwaighofer [Fri, 28 Jun 2013 17:14:48 +0000 (17:14 +0000)]
LoopVectorize: Pull dyn_cast into setDebugLocFromInst

llvm-svn: 185168

11 years agoImplement full support for non-pointer pointers in custom allocators for string....
Howard Hinnant [Fri, 28 Jun 2013 16:59:19 +0000 (16:59 +0000)]
Implement full support for non-pointer pointers in custom allocators for string.  This completes the custom pointer support for the entire library.

llvm-svn: 185167

11 years agoFix bugpoint execution/reference output file name
Hal Finkel [Fri, 28 Jun 2013 16:37:52 +0000 (16:37 +0000)]
Fix bugpoint execution/reference output file name

sys::fs::unique_file will now loop infinitely if provided with a file name
without '%' characters and the input file already exists. As a result, bugpoint
cannot use a fixed file name for the execution output (including the reference
output).

llvm-svn: 185166

11 years agoLoopVectorize: Use static function instead of DebugLocSetter class
Arnold Schwaighofer [Fri, 28 Jun 2013 16:26:54 +0000 (16:26 +0000)]
LoopVectorize: Use static function instead of DebugLocSetter class

I used the class to safely reset the state of the builder's debug location.  I
think I have caught all places where we need to set the debug location to a new
one. Therefore, we can replace the class by a function that just sets the debug
location.

llvm-svn: 185165

11 years agoUse the multiple argument form of path::append.
Benjamin Kramer [Fri, 28 Jun 2013 16:25:46 +0000 (16:25 +0000)]
Use the multiple argument form of path::append.

llvm-svn: 185164

11 years ago[ASan] Remove %symbolize from lit tests: we now use external symbolizer instead of...
Alexey Samsonov [Fri, 28 Jun 2013 15:52:44 +0000 (15:52 +0000)]
[ASan] Remove %symbolize from lit tests: we now use external symbolizer instead of python script

llvm-svn: 185163

11 years agoR600: Add local memory support via LDS
Tom Stellard [Fri, 28 Jun 2013 15:47:08 +0000 (15:47 +0000)]
R600: Add local memory support via LDS

Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 185162

11 years agoR600: Add support for GROUP_BARRIER instruction
Tom Stellard [Fri, 28 Jun 2013 15:46:59 +0000 (15:46 +0000)]
R600: Add support for GROUP_BARRIER instruction

Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 185161

11 years agoR600: Add ALUInst bit to tablegen definitions v2
Tom Stellard [Fri, 28 Jun 2013 15:46:53 +0000 (15:46 +0000)]
R600: Add ALUInst bit to tablegen definitions v2

v2:
  - Remove functions left over from a previous rebase.

Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 185160

11 years agoFix a trivial typo, add a FIXME to have more test coverage for VTableBuilder
Timur Iskhodzhanov [Fri, 28 Jun 2013 15:42:28 +0000 (15:42 +0000)]
Fix a trivial typo, add a FIXME to have more test coverage for VTableBuilder

llvm-svn: 185159

11 years agoARM: ensure fixed-point conversions have sane types
Tim Northover [Fri, 28 Jun 2013 15:29:25 +0000 (15:29 +0000)]
ARM: ensure fixed-point conversions have sane types

We were generating intrinsics for NEON fixed-point conversions that didn't
exist (e.g. float -> i16). There are two cases to consider:
  + iN is smaller than float. In this case we can do the conversion but need an
    extend or truncate as well.
  + iN is larger than float. In this case using the NEON conversion would be
    incorrect so we don't perform any combining.

llvm-svn: 185158

11 years ago[lsan] Fix build again.
Sergey Matveev [Fri, 28 Jun 2013 15:23:15 +0000 (15:23 +0000)]
[lsan] Fix build again.

llvm-svn: 185157

11 years ago[lsan] Fix build.
Sergey Matveev [Fri, 28 Jun 2013 15:18:06 +0000 (15:18 +0000)]
[lsan] Fix build.

llvm-svn: 185156

11 years agoARM: Fix pseudo-instructions for SRS (Store Return State).
Tilmann Scheller [Fri, 28 Jun 2013 15:09:46 +0000 (15:09 +0000)]
ARM: Fix pseudo-instructions for SRS (Store Return State).

The mapping between SRS pseudo-instructions and SRS native instructions was incorrect, the correct mapping is:

srsfa -> srsib
srsea -> srsia
srsfd -> srsdb
srsed -> srsda

This fixes <rdar://problem/14214734>.

llvm-svn: 185155

11 years agollvm-symbolizer: don't leave dangling pointers after flushing LLVMSymbolizer. Add...
Alexey Samsonov [Fri, 28 Jun 2013 15:08:29 +0000 (15:08 +0000)]
llvm-symbolizer: don't leave dangling pointers after flushing LLVMSymbolizer. Add a destructor.

llvm-svn: 185154

11 years ago[lsan] When verbosity > 1, always print suppressions and summary (even if no leaks...
Sergey Matveev [Fri, 28 Jun 2013 15:05:16 +0000 (15:05 +0000)]
[lsan] When verbosity > 1, always print suppressions and summary (even if no leaks found).

Also fix an output bug.

llvm-svn: 185153

11 years ago[lsan] Add suppression support.
Sergey Matveev [Fri, 28 Jun 2013 14:38:31 +0000 (14:38 +0000)]
[lsan] Add suppression support.

llvm-svn: 185152

11 years agollvm-symbolizer: skip leading underscore in Mach-O symbol table entries
Alexey Samsonov [Fri, 28 Jun 2013 14:25:52 +0000 (14:25 +0000)]
llvm-symbolizer: skip leading underscore in Mach-O symbol table entries

llvm-svn: 185151

11 years ago[sanitizer] Disable all ptrace-related definitions on Android.
Evgeniy Stepanov [Fri, 28 Jun 2013 14:18:10 +0000 (14:18 +0000)]
[sanitizer] Disable all ptrace-related definitions on Android.

llvm-svn: 185150

11 years agoUse lexing mode based on FormatStyle.Standard.
Alexander Kornienko [Fri, 28 Jun 2013 12:51:24 +0000 (12:51 +0000)]
Use lexing mode based on FormatStyle.Standard.

Summary:
Some valid pre-C++11 constructs change meaning when lexed in C++11
mode, e.g.
#define x(_a) printf("foo"_a);
(example from http://llvm.org/bugs/show_bug.cgi?id=16342). "foo"_a is treated as
a user-defined string literal when parsed in C++11 mode.
In order to deal with this correctly, we need to set lexing mode according to
which standard the code conforms to. We already have a configuration value for
this (FormatStyle.Standard), which seems to be appropriate to use in this case
as well.

Reviewers: klimek

CC: cfe-commits, gribozavr
Differential Revision: http://llvm-reviews.chandlerc.com/D1028

llvm-svn: 185149

11 years ago[ASan] Migrate lit tests to external symbolizer from asan_symbolize.py script
Alexey Samsonov [Fri, 28 Jun 2013 12:50:12 +0000 (12:50 +0000)]
[ASan] Migrate lit tests to external symbolizer from asan_symbolize.py script

llvm-svn: 185148

11 years agoMove sys/sysctl.h include after its dependency sys/types.h
Ed Maste [Fri, 28 Jun 2013 12:35:08 +0000 (12:35 +0000)]
Move sys/sysctl.h include after its dependency sys/types.h

llvm-svn: 185147

11 years agoDemangle names using pluggable internal symbolizer if possible
Alexey Samsonov [Fri, 28 Jun 2013 12:30:24 +0000 (12:30 +0000)]
Demangle names using pluggable internal symbolizer if possible

llvm-svn: 185146

11 years ago[sanitizer] Fix an unfortunate typo and disable ptrace interception on Android.
Evgeniy Stepanov [Fri, 28 Jun 2013 12:16:03 +0000 (12:16 +0000)]
[sanitizer] Fix an unfortunate typo and disable ptrace interception on Android.

llvm-svn: 185145

11 years agoPass --default-arch flag to external symbolizer. Fix line lengths.
Alexey Samsonov [Fri, 28 Jun 2013 12:13:31 +0000 (12:13 +0000)]
Pass --default-arch flag to external symbolizer. Fix line lengths.

llvm-svn: 185144

11 years agollvm-symbolizer: make name demangling a public static method of LLVMSymbolizer
Alexey Samsonov [Fri, 28 Jun 2013 12:06:25 +0000 (12:06 +0000)]
llvm-symbolizer: make name demangling a public static method of LLVMSymbolizer

llvm-svn: 185143

11 years ago[sanitizer] Intercept ptrace.
Evgeniy Stepanov [Fri, 28 Jun 2013 11:02:43 +0000 (11:02 +0000)]
[sanitizer] Intercept ptrace.

llvm-svn: 185142

11 years agoImprove comment.
Rafael Espindola [Fri, 28 Jun 2013 10:55:41 +0000 (10:55 +0000)]
Improve comment.

llvm-svn: 185141

11 years ago[ASan][OSX] Make sure the zones created by malloc_create_zone() are write-protected.
Alexander Potapenko [Fri, 28 Jun 2013 10:01:09 +0000 (10:01 +0000)]
[ASan][OSX]  Make sure the zones created by malloc_create_zone() are write-protected.
Add a test.

llvm-svn: 185140

11 years agoMake a switch in createBinary fully-covered. Add forgotten macho_dsym_companion case.
Alexey Samsonov [Fri, 28 Jun 2013 09:44:05 +0000 (09:44 +0000)]
Make a switch in createBinary fully-covered. Add forgotten macho_dsym_companion case.

llvm-svn: 185139

11 years ago[ASan][OSX] Fix the incorrect malloc_create_zone() implementation that led to out...
Alexander Potapenko [Fri, 28 Jun 2013 09:21:31 +0000 (09:21 +0000)]
[ASan][OSX] Fix the incorrect malloc_create_zone() implementation that led to out-of-bounds mprotect()s
(https://code.google.com/p/address-sanitizer/issues/detail?id=203)
Add a test.

llvm-svn: 185138

11 years agollvm-symbolizer: add support for Mach-O universal binaries
Alexey Samsonov [Fri, 28 Jun 2013 08:15:40 +0000 (08:15 +0000)]
llvm-symbolizer: add support for Mach-O universal binaries

llvm-svn: 185137

11 years agoSuppress GCC "control reaches end of non-void function" warning.
Patrik Hagglund [Fri, 28 Jun 2013 06:54:05 +0000 (06:54 +0000)]
Suppress GCC "control reaches end of non-void function" warning.

llvm-svn: 185136

11 years agoDebug Info: clean up usage of Verify.
Manman Ren [Fri, 28 Jun 2013 05:43:10 +0000 (05:43 +0000)]
Debug Info: clean up usage of Verify.

No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify. For cases where we know the type of a DI metadata, use
assert.

Also update testing cases to make them conform to the format of DI classes.

llvm-svn: 185135

11 years agoAdd include guard.
Rui Ueyama [Fri, 28 Jun 2013 04:52:40 +0000 (04:52 +0000)]
Add include guard.

llvm-svn: 185134

11 years ago[PECOFF][Writer] Support DIR32NB and REL32 relocation types.
Rui Ueyama [Fri, 28 Jun 2013 04:40:52 +0000 (04:40 +0000)]
[PECOFF][Writer] Support DIR32NB and REL32 relocation types.

llvm-svn: 185133

11 years agoLazily deserialize function template specializations. This fixes a cycle in
Richard Smith [Fri, 28 Jun 2013 04:37:53 +0000 (04:37 +0000)]
Lazily deserialize function template specializations. This fixes a cycle in
module deserialization / merging, and more laziness here is general goodness.

llvm-svn: 185132

11 years agoIntegrate Assembler: Support X86_64_DTPOFF64 relocations
David Blaikie [Fri, 28 Jun 2013 04:24:32 +0000 (04:24 +0000)]
Integrate Assembler: Support X86_64_DTPOFF64 relocations

llvm-svn: 185131

11 years ago[PECOFF][Writer] Fix a bug that the contents of .data and .rdata were swapped.
Rui Ueyama [Fri, 28 Jun 2013 04:15:37 +0000 (04:15 +0000)]
[PECOFF][Writer] Fix a bug that the contents of .data and .rdata were swapped.

llvm-svn: 185130

11 years ago[PECOFF][Writer] Skip ".debug$S" section in the input object file.
Rui Ueyama [Fri, 28 Jun 2013 04:06:49 +0000 (04:06 +0000)]
[PECOFF][Writer] Skip ".debug$S" section in the input object file.

llvm-svn: 185129

11 years ago[PECOFF][Writer] Use a constant instead of a magic number.
Rui Ueyama [Fri, 28 Jun 2013 03:52:41 +0000 (03:52 +0000)]
[PECOFF][Writer] Use a constant instead of a magic number.

llvm-svn: 185128

11 years agoUpdate for llvm::sys::fs::unique_file not creating directories.
Rafael Espindola [Fri, 28 Jun 2013 03:49:04 +0000 (03:49 +0000)]
Update for llvm::sys::fs::unique_file not creating directories.

llvm-svn: 185127

11 years agoImprovements to unique_file and createUniqueDirectory.
Rafael Espindola [Fri, 28 Jun 2013 03:48:47 +0000 (03:48 +0000)]
Improvements to unique_file and createUniqueDirectory.

* Don't try to create parent directories in unique_file. It had two problem:
   * It violates the contract that it is atomic. If the directory creation
     success and the file creation fails, we would return an error but the
     file system was modified.
   * When creating a temporary file clang would have to first check if the
     parent directory existed or not to avoid creating one when it was not
     supposed to.

* More efficient implementations of createUniqueDirectory and the unique_file
  that produces only the file name. Now all 3 just call into a static
  function passing what they want (name, file or directory).

Clang also has to be updated, so tests might fail if a bot picks up this commit
and not the corresponding clang one.

llvm-svn: 185126

11 years ago[PECOFF][Writer] Templatize connectAtomsWithLayoutEdge()
Rui Ueyama [Fri, 28 Jun 2013 03:41:07 +0000 (03:41 +0000)]
[PECOFF][Writer] Templatize connectAtomsWithLayoutEdge()

Templatize connectAtomsWithLayoutEdge() so that it can handle other types of
defined atoms.

llvm-svn: 185125

11 years agoConvert tests to FileCheck
Matt Arsenault [Fri, 28 Jun 2013 01:29:35 +0000 (01:29 +0000)]
Convert tests to FileCheck

llvm-svn: 185124

11 years agoDon't ask for a mode when we are not keeping the file.
Rafael Espindola [Fri, 28 Jun 2013 01:05:47 +0000 (01:05 +0000)]
Don't ask for a mode when we are not keeping the file.

llvm-svn: 185123

11 years agoLoopVectorize: Preserve debug location info
Arnold Schwaighofer [Fri, 28 Jun 2013 00:38:54 +0000 (00:38 +0000)]
LoopVectorize: Preserve debug location info

radar://14169017

llvm-svn: 185122

11 years agoFix using arg_end() - arg_begin() instead of arg_size()
Matt Arsenault [Fri, 28 Jun 2013 00:25:40 +0000 (00:25 +0000)]
Fix using arg_end() - arg_begin() instead of arg_size()

llvm-svn: 185121

11 years agoFix typo
Matt Arsenault [Fri, 28 Jun 2013 00:25:36 +0000 (00:25 +0000)]
Fix typo

llvm-svn: 185120

11 years agoDelete dead code.
Eli Friedman [Fri, 28 Jun 2013 00:23:34 +0000 (00:23 +0000)]
Delete dead code.

llvm-svn: 185119

11 years agoSwitch Decl instantiation to DeclNodes.inc.
Eli Friedman [Thu, 27 Jun 2013 23:21:55 +0000 (23:21 +0000)]
Switch Decl instantiation to DeclNodes.inc.

This replaces a long list of declarations for visitor functions with
a list generated from DeclNodes.inc.  Nothing really interesting came
out of it; we had comprehensive coverage anyway
(excluding FriendTemplateDecls).

llvm-svn: 185118

11 years agoFix nested lifetime extension when a std::initializer_list member is
Richard Smith [Thu, 27 Jun 2013 22:54:33 +0000 (22:54 +0000)]
Fix nested lifetime extension when a std::initializer_list member is
initialized during aggregate initialization of the surrounding structure.

llvm-svn: 185117

11 years agoUse the zero-argument DIBuilder::createNullPtrType in Clang.
Peter Collingbourne [Thu, 27 Jun 2013 22:51:01 +0000 (22:51 +0000)]
Use the zero-argument DIBuilder::createNullPtrType in Clang.

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

llvm-svn: 185115

11 years agoRename DIBuilder::createNullPtrType to createUnspecifiedType and introduce
Peter Collingbourne [Thu, 27 Jun 2013 22:50:59 +0000 (22:50 +0000)]
Rename DIBuilder::createNullPtrType to createUnspecifiedType and introduce
a zero-argument createNullPtrType function for creating the canonical
nullptr type.

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

llvm-svn: 185114

11 years agoAt the request of Richard Smith, swapped the order of cold/builtin so it is in alphab...
Michael Gottesman [Thu, 27 Jun 2013 22:48:08 +0000 (22:48 +0000)]
At the request of Richard Smith, swapped the order of cold/builtin so it is in alphabetical order.

llvm-svn: 185113

11 years agoEnsure that debugger calls to signature-less functions default to
John McCall [Thu, 27 Jun 2013 22:43:24 +0000 (22:43 +0000)]
Ensure that debugger calls to signature-less functions default to
passing arguments in the fixed style.

We have an abstraction for deciding this, but it's (1) deep in
IR-generation, (2) necessarily tied to exact argument lists, and
(3) triggered by unprototyped function types, which we can't
legitimately make in C++ mode.  So this solution, wherein Sema
rewrites the function type to an exact prototype but leaves the
variadic bit enabled so as to request x86-64-like platforms to
pass the extra variadic info, is very much a hack, but it's one
that works in practice on the platforms that LLDB will support
in the medium term --- the only place we know of where it's a
problem is instance methods in Windows, where variadic functions
are implicitly cdecl.  We may have a more abstracted base on which
to build a solution by then.

rdar://13731520

llvm-svn: 185112

11 years agoRevert "Revert "[APFloat] Removed APFloat constructor which initialized to either...
Michael Gottesman [Thu, 27 Jun 2013 21:58:19 +0000 (21:58 +0000)]
Revert "Revert "[APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowed you to arbitrarily set the category of the float.""

This reverts commit r185099.

Looks like both the ppc-64 and mips bots are still failing after I reverted this
change.

Since:

1. The mips bot always performs a clean build,
2. The ppc64-bot failed again after a clean build (I asked the ppc-64
maintainers to clean the bot which they did... Thanks Will!),

I think it is safe to assume that this change was not the cause of the failures
that said builders were seeing. Thus I am recomitting.

llvm-svn: 185111

11 years agoRevert "Revert r184787: "Added arm_neon intrinsic tests.""
Michael Gottesman [Thu, 27 Jun 2013 21:52:01 +0000 (21:52 +0000)]
Revert "Revert r184787: "Added arm_neon intrinsic tests.""

This reverts commit r184817. The failure Chandler was seeing was most likely the
bug that Bob Wilson fixed in r184870 (which was a bug caught by these tests).

To be safe, I just checked again on x86-64 mac os x/linux that this test passed
(which it did).

llvm-svn: 185110

11 years agoRemove bogus VarDecl::extendsLifetimeOfTemporary function and inline it into
Richard Smith [Thu, 27 Jun 2013 21:43:17 +0000 (21:43 +0000)]
Remove bogus VarDecl::extendsLifetimeOfTemporary function and inline it into
its only caller with a FIXME explaining why it's bogus.

llvm-svn: 185109

11 years agoRemove unnecessary check.
Eli Friedman [Thu, 27 Jun 2013 21:20:28 +0000 (21:20 +0000)]
Remove unnecessary check.

llvm-svn: 185108

11 years agoPrevent race in when stopping a "read thread"
Tim Northover [Thu, 27 Jun 2013 21:19:30 +0000 (21:19 +0000)]
Prevent race in when stopping a "read thread"

Both StopReadThread and the thread being stopped set the thread id to
0 after m_read_thread_enabled was set to false. If the thread being
stopped got there first then StopReadThread called pthread_join on an
invalid thread number. This is not a Good Thing,

Should fix a fairly regular segfault when quitting on Linux.

llvm-svn: 185107

11 years agoRevert hack that omits errno on Darwin platforms. We now have an acceptable 'errno...
Bill Wendling [Thu, 27 Jun 2013 21:17:53 +0000 (21:17 +0000)]
Revert hack that omits errno on Darwin platforms. We now have an acceptable 'errno' header.

llvm-svn: 185106

11 years agoDeclare 'strerror' so that we can use it with errno.
Bill Wendling [Thu, 27 Jun 2013 21:17:24 +0000 (21:17 +0000)]
Declare 'strerror' so that we can use it with errno.

llvm-svn: 185105

11 years agoAdd 'errno.h' to the Darwin SDK.
Bill Wendling [Thu, 27 Jun 2013 21:17:06 +0000 (21:17 +0000)]
Add 'errno.h' to the Darwin SDK.

llvm-svn: 185104

11 years agoDelete dead code.
Eli Friedman [Thu, 27 Jun 2013 21:04:24 +0000 (21:04 +0000)]
Delete dead code.

llvm-svn: 185103

11 years ago[PECOFF][Writer] Fix DLLCharacteristic flag in image header.
Rui Ueyama [Thu, 27 Jun 2013 21:03:44 +0000 (21:03 +0000)]
[PECOFF][Writer] Fix DLLCharacteristic flag in image header.

llvm-svn: 185102

11 years agoDelete dead code.
Eli Friedman [Thu, 27 Jun 2013 20:48:08 +0000 (20:48 +0000)]
Delete dead code.

llvm-svn: 185101

11 years agoUnder -fms-extensions, only inject a friend tag name when we didn't see a tag with...
Douglas Gregor [Thu, 27 Jun 2013 20:42:30 +0000 (20:42 +0000)]
Under -fms-extensions, only inject a friend tag name when we didn't see a tag with that name in an enclosing scope.

r177473 made us correctly consider only those declarations in the
enclosing namespace scope when looking for a friend declaration. Under
ms-extensions mode, where we do some level of friend injection, this
meant that we were introducing a new tag type into a different scope
than what Microsoft actually does. Address this by only doing the
friend injection when we didn't see any tag with that name in any
outer scope. Fixes <rdar://problem/14250378>.

llvm-svn: 185100

11 years agoRevert "[APFloat] Removed APFloat constructor which initialized to either zero/NaN...
Michael Gottesman [Thu, 27 Jun 2013 20:40:11 +0000 (20:40 +0000)]
Revert "[APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowed you to arbitrarily set the category of the float."

This reverts commit r185095. This is causing a FileCheck failure on
the 3dnow intrinsics on at least the mips/ppc bots but not on the x86
bots.

Reverting while I figure out what is going on.

llvm-svn: 185099

11 years agoSimplify StmtIterator.
Eli Friedman [Thu, 27 Jun 2013 20:39:04 +0000 (20:39 +0000)]
Simplify StmtIterator.

llvm-svn: 185098

11 years agoLoopVectorize: Cache edge masks created during if-conversion
Arnold Schwaighofer [Thu, 27 Jun 2013 20:31:06 +0000 (20:31 +0000)]
LoopVectorize: Cache edge masks created during if-conversion

Otherwise, we end up with an exponential IR blowup.
Fixes PR16472.

llvm-svn: 185097

11 years agoRemove unnecessary conditional checks.
Chad Rosier [Thu, 27 Jun 2013 20:19:13 +0000 (20:19 +0000)]
Remove unnecessary conditional checks.

llvm-svn: 185096

11 years ago[APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowe...
Michael Gottesman [Thu, 27 Jun 2013 19:50:52 +0000 (19:50 +0000)]
[APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowed you to arbitrarily set the category of the float.

The category which an APFloat belongs to should be dependent on the
actual value that the APFloat has, not be arbitrarily passed in by the
user. This will prevent inconsistency bugs where the category and the
actual value in APFloat differ.

I also fixed up all of the references to this constructor (which were
only in LLVM).

llvm-svn: 185095

11 years agoImprove the compression of the tablegen DiffLists by introducing a new sort
Chad Rosier [Thu, 27 Jun 2013 19:38:13 +0000 (19:38 +0000)]
Improve the compression of the tablegen DiffLists by introducing a new sort
algorithm when assigning EnumValues to the synthesized registers.

The current algorithm, LessRecord, uses the StringRef compare_numeric
function.  This function compares strings, while handling embedded numbers.
For example, the R600 backend registers are sorted as follows:

  T1
  T1_W
  T1_X
  T1_XYZW
  T1_Y
  T1_Z
  T2
  T2_W
  T2_X
  T2_XYZW
  T2_Y
  T2_Z

In this example, the 'scaling factor' is dEnum/dN = 6 because T0, T1, T2
have an EnumValue offset of 6 from one another.  However, in other parts
of the register bank, the scaling factors are different:

dEnum/dN = 5:
  KC0_128_W
  KC0_128_X
  KC0_128_XYZW
  KC0_128_Y
  KC0_128_Z
  KC0_129_W
  KC0_129_X
  KC0_129_XYZW
  KC0_129_Y
  KC0_129_Z

The diff lists do not work correctly because different kinds of registers have
different 'scaling factors'.  This new algorithm, LessRecordRegister, tries to
enforce a scaling factor of 1.  For example, the registers are now sorted as
follows:

  T1
  T2
  T3
  ...
  T0_W
  T1_W
  T2_W
  ...
  T0_X
  T1_X
  T2_X
  ...
  KC0_128_W
  KC0_129_W
  KC0_130_W
  ...

For the Mips and R600 I see a 19% and 6% reduction in size, respectively.  I
did see a few small regressions, but the differences were on the order of a
few bytes (e.g., AArch64 was 16 bytes).  I suspect there will be even
greater wins for targets with larger register files.

Patch reviewed by Jakob.
rdar://14006013

llvm-svn: 185094

11 years agoImplement full support for non-pointer pointers in custom allocators for vector.
Howard Hinnant [Thu, 27 Jun 2013 19:35:32 +0000 (19:35 +0000)]
Implement full support for non-pointer pointers in custom allocators for vector.

llvm-svn: 185093

11 years agoRan clang-format on Modularize.cpp to get a baseline for future changes.
John Thompson [Thu, 27 Jun 2013 18:52:23 +0000 (18:52 +0000)]
Ran clang-format on Modularize.cpp to get a baseline for future changes.

llvm-svn: 185092

11 years agoSmall improvements to createOutputFile.
Rafael Espindola [Thu, 27 Jun 2013 18:26:26 +0000 (18:26 +0000)]
Small improvements to createOutputFile.

* Use a single stat to find out if the file exists and if it is a regular file.
* Use early returns when possible.
* Add comments explaining why we have each check.

llvm-svn: 185091

11 years agoA bit more cleanup on the process_events.py to use best practices for event handling.
Greg Clayton [Thu, 27 Jun 2013 18:08:32 +0000 (18:08 +0000)]
A bit more cleanup on the process_events.py to use best practices for event handling.

llvm-svn: 185089

11 years agoCleanup of IRForTarget. Removed some relics of
Sean Callanan [Thu, 27 Jun 2013 18:08:02 +0000 (18:08 +0000)]
Cleanup of IRForTarget.  Removed some relics of
the time when the IRInterpreter ran inside
IRForTarget.

llvm-svn: 185088