platform/upstream/llvm.git
8 years agoUpdate lldb's ExternalASTSources to match Clang r244161.
Richard Smith [Thu, 6 Aug 2015 05:13:41 +0000 (05:13 +0000)]
Update lldb's ExternalASTSources to match Clang r244161.

llvm-svn: 244194

8 years ago[ObjC] Circular containers: add support of subclasses
Alex Denisov [Thu, 6 Aug 2015 04:51:14 +0000 (04:51 +0000)]
[ObjC] Circular containers: add support of subclasses

llvm-svn: 244193

8 years ago[modules] Defer setting up the lookup table for a DeclContext until we can
Richard Smith [Thu, 6 Aug 2015 04:23:48 +0000 (04:23 +0000)]
[modules] Defer setting up the lookup table for a DeclContext until we can
determine the primary context, rather than sometimes registering the lookup
table on the wrong context.

This exposed a couple of bugs:
 * the odr violation check didn't deal properly with mergeable declarations
   if the declaration retained by name lookup wasn't in the canonical
   definition of the class
 * the (broken) RewriteDecl mechanism would emit two name lookup tables for
   the same DeclContext into the same module file (one as part of the
   rewritten declaration and one as a visible update for the old declaration)
These are both fixed too.

llvm-svn: 244192

8 years agoCOFF: ARM: Sort .pdata section correctly.
Rui Ueyama [Thu, 6 Aug 2015 03:45:27 +0000 (03:45 +0000)]
COFF: ARM: Sort .pdata section correctly.

On ARM, exception handler entries in .pdata section are 8 byte long.

llvm-svn: 244191

8 years agoSecond part of indicating when the user is stopped in optimized code.
Jason Molenda [Thu, 6 Aug 2015 03:27:10 +0000 (03:27 +0000)]
Second part of indicating when the user is stopped in optimized code.

The first part was in r243508 -- the extent of the UI changes in that
patchset was to add "[opt]" to the frame-format when a stack frame was
built with optimized code.

In this change, when a stack frame built with optimization is selected,
a message will be printed to the async output channel --

opt1.c was compiled with optimization - stepping may behave oddly; variables may not be available.

The warning will be only be printed once per source file in a debug session.
These warnings may be disabled by

settings set target.process.optimization-warnings false

Internally, a new Process::PrintWarning() method has been added for
warnings that we want to print only once to the user.  It takes a type
of warning (currently only eWarningsOptimization) and an object
pointer (CompileUnit*) - the warning will only be printed once for a
given object pointer value.

This is a bit of a prototype of this change -  I think we will be
tweaking it more in the future.  But I wanted to land this and see
how it goes.  Advanced users will find these warnings unnecessary
noise and will quickly disable them - but anyone who maintains a
debugger knows that debugging optimized code, without realizing it,
is a constant source of confusion and frustation for more typical
debugger users.

I imagine there will be more of these "warn once per whatever" style
warnings that we will want to add in the future and we'll need to
come up with a better way for enabling/disabling them.  But I'm not
srue what form that warning settings should take and I didn't want
to code up something that we regret later, so for now I just added
another process setting for this one warning.

<rdar://problem/19281172>

llvm-svn: 244190

8 years ago[PM/AA] Simplify the AliasAnalysis interface by removing a wrapper
Chandler Carruth [Thu, 6 Aug 2015 02:05:46 +0000 (02:05 +0000)]
[PM/AA] Simplify the AliasAnalysis interface by removing a wrapper
around a DataLayout interface in favor of directly querying DataLayout.

This wrapper specifically helped handle the case where this no
DataLayout, but LLVM now requires it simplifynig all of this. I've
updated callers to directly query DataLayout. This in turn exposed
a bunch of places where we should have DataLayout readily available but
don't which I've fixed. This then in turn exposed that we were passing
DataLayout around in a bunch of arguments rather than making it readily
available so I've also fixed that.

No functionality changed.

llvm-svn: 244189

8 years ago[libFuzzer] add one more mutation strategy: byte shuffling
Kostya Serebryany [Thu, 6 Aug 2015 01:29:13 +0000 (01:29 +0000)]
[libFuzzer] add one more mutation strategy: byte shuffling

llvm-svn: 244188

8 years ago[test] Another attempt to fix the test.
Argyrios Kyrtzidis [Thu, 6 Aug 2015 01:06:55 +0000 (01:06 +0000)]
[test] Another attempt to fix the test.

llvm-svn: 244187

8 years agoRename the non-coding style conformant functions in namespace Builtins
Eric Christopher [Thu, 6 Aug 2015 01:01:12 +0000 (01:01 +0000)]
Rename the non-coding style conformant functions in namespace Builtins
to match the rest of their brethren and reformat the bits that need it.

llvm-svn: 244186

8 years agoMIR Serialization: Initial serialization of the machine operand target flags.
Alex Lorenz [Thu, 6 Aug 2015 00:44:07 +0000 (00:44 +0000)]
MIR Serialization: Initial serialization of the machine operand target flags.

This commit implements the initial serialization of the machine operand target
flags. It extends the 'TargetInstrInfo' class to add two new methods that help
to provide text based serialization for the target flags.

This commit can serialize only the X86 target flags, and the target flags for
the other targets will be serialized in the follow-up commits.

Reviewers: Duncan P. N. Exon Smith
llvm-svn: 244185

8 years ago[llvm-objdump] Add missing call to exit(1).
Davide Italiano [Thu, 6 Aug 2015 00:18:52 +0000 (00:18 +0000)]
[llvm-objdump] Add missing call to exit(1).

Reported by: Rafael Espindola.

llvm-svn: 244184

8 years agoFor completeness, add a 64 bit big endian test.
Rafael Espindola [Thu, 6 Aug 2015 00:00:50 +0000 (00:00 +0000)]
For completeness, add a 64 bit big endian test.

llvm-svn: 244183

8 years agoRevert "Make sure all temporary files get created under %T."
Frederic Riss [Wed, 5 Aug 2015 23:53:38 +0000 (23:53 +0000)]
Revert "Make sure all temporary files get created under %T."

This reverts commit r244163. The workaround shouldn't be necessary
after r244172, and moreover the commit was slightly buggy as it
dis a simple mkdir without removing the directory first, which could
cause 'File exists' errors.

llvm-svn: 244182

8 years agoValueMapper: Rotate distinct node remapping algorithm
Duncan P. N. Exon Smith [Wed, 5 Aug 2015 23:52:42 +0000 (23:52 +0000)]
ValueMapper: Rotate distinct node remapping algorithm

Rotate the algorithm for remapping distinct nodes in order to simplify
how uniquing cycles get resolved.  This removes some of the recursion,
and, most importantly, exposes all uniquing cycles at the top-level.
Besides being a little more efficient -- temporary MDNodes won't live as
long -- the clearer logic should help protect against bugs like those
fixed in r243961 and r243976.

What are uniquing cycles?  Why do they present challenges when remapping
metadata?

    !0 = !{!1}
    !1 = !{!0}

!0 and !1 form a simple uniquing cycle.  When remapping from one
metadata graph to another, every uniquing cycle gets "duplicated"
through a dance:

    !0-temp = !{!1?}     ; map(!0): clone !0, VM[!0] = !0-temp
    !1-temp = !{!0?}     ; ..map(!1): clone !1, VM[!1] = !1-temp
    !1-temp = !{!0-temp} ; ..map(!1): remap !1's operands
    !2      = !{!0-temp} ; ..map(!1): uniquify: !1-temp => !2
    !0-temp = !{!2}      ; map(!0): remap !0's operands
    !3      = !{!2}      ; map(!0): uniquify: !0-temp => !3

    ; Result
    !2 = !{!3}
    !3 = !{!2}

(In the two "uniquify" steps above, the operands of !X-temp are compared
to the operands of !X.  If they're the same, then !X-temp gets RAUW'ed
to !X; if they're different, then !X-temp is promoted to a new unique
node.  The latter case always hits in for uniquing cycles, so we
duplicate all the nodes involved.)

Why is this a problem?  Uniquable Metadata nodes that have temporary
node as transitive operands keep RAUW support until the temporary nodes
get finalized.  With non-cycles, this happens automatically: when a
uniquable node's count of unresolved operands drops to zero, it
immediately sheds its own RAUW support (possibly triggering the same in
any node that references it).  However, uniquing cycles create a
reference cycle, and uniqued nodes that transitively reference a
uniquing cycle are "stuck" in an unresolved state until someone calls
`MDNode::resolveCycles()` on a node in the unresolved subgraph.

Distinct nodes should help here (and mostly do): since they aren't
uniqued anywhere, they are guaranteed not to be RAUW'ed.  They
effectively form a barrier between uniqued nodes, breaking some uniquing
cycles, and shielding uniqued nodes from uniquing cycles.

Unfortunately, with this barrier in place, the unresolved subgraph(s)
can be disjoint from the top-level node.  The mapping algorithm needs to
find at least one representative from each disjoint subgraph.  But which
nodes are *stuck*, and which will get resolved automatically?  And which
nodes are in the unresolved subgraph?  The old logic was conservative.

This commit rotates the logic for distinct nodes, so that we have access
to unresolved nodes at the top-level call to `llvm::MapMetadata()`.
Each time we return to the top-level, we know that all temporaries have
been RAUW'ed away.  Here, it's safe (and necessary) to call
`resolveCycles()` immediately on unresolved operands.

This should also perform better than the old algorithm.  The recursion
stack is shorter, temporary nodes don't live as long, and there are
fewer tracking references to unresolved nodes.  As the debug info graph
introduces more 'distinct' nodes, remapping should incrementally get
cheaper and cheaper.

Aside from possible performance improvements (and reduced cruft in the
`LLVMContext`), there should be no functionality change here.

llvm-svn: 244181

8 years agoCOFF, ELF2: Pass output file path implicitly using Config global variable.
Rui Ueyama [Wed, 5 Aug 2015 23:51:50 +0000 (23:51 +0000)]
COFF, ELF2: Pass output file path implicitly using Config global variable.

Various parameters are passed implicitly using Config global variable
already. Output file path is no different from others, so there was no
special reason to handle that differnetly.

This patch changes the signature of writeResult(SymbolTable *, StringRef)
to writeResult(SymbolTable *).

llvm-svn: 244180

8 years agoDriver: Strip -header-include-file and -diagnostic-log-file from crash repro scripts
Justin Bogner [Wed, 5 Aug 2015 23:49:44 +0000 (23:49 +0000)]
Driver: Strip -header-include-file and -diagnostic-log-file from crash repro scripts

These two arguments tend to refer to a local path that won't exist
when we try to reproduce a bug. Strip them.

llvm-svn: 244179

8 years agoRename DescriptionString -> DataLayoutString as it matches the actual
Eric Christopher [Wed, 5 Aug 2015 23:48:05 +0000 (23:48 +0000)]
Rename DescriptionString -> DataLayoutString as it matches the actual
use of the string.

llvm-svn: 244178

8 years ago[libFuzzer] avoid build warnings in non-assert build (useful warning in this case)
Kostya Serebryany [Wed, 5 Aug 2015 23:44:42 +0000 (23:44 +0000)]
[libFuzzer] avoid build warnings in non-assert build (useful warning in this case)

llvm-svn: 244177

8 years ago[test] Fix tests in non-darwin bots.
Argyrios Kyrtzidis [Wed, 5 Aug 2015 23:44:06 +0000 (23:44 +0000)]
[test] Fix tests in non-darwin bots.

llvm-svn: 244176

8 years agoCOFF: Simplify Writer interface by hiding Writer class.
Rui Ueyama [Wed, 5 Aug 2015 23:43:53 +0000 (23:43 +0000)]
COFF: Simplify Writer interface by hiding Writer class.

llvm-svn: 244175

8 years agoAdd a stat to show how often the limit to decompose GEPs in BasicAA is reached.
Wei Mi [Wed, 5 Aug 2015 23:40:30 +0000 (23:40 +0000)]
Add a stat to show how often the limit to decompose GEPs in BasicAA is reached.

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

llvm-svn: 244174

8 years agoAdd a big endian testcase.
Rafael Espindola [Wed, 5 Aug 2015 23:40:20 +0000 (23:40 +0000)]
Add a big endian testcase.

llvm-svn: 244173

8 years ago[dsymutil] Do not create temporary files in -no-output mode.
Frederic Riss [Wed, 5 Aug 2015 23:33:50 +0000 (23:33 +0000)]
[dsymutil] Do not create temporary files in -no-output mode.

The files were never written to and then deleted, but they were created
nonetheless. To prevent that, create a wrapper around the 2 variants of
createUniqueFile and use the one that only does an access(Exists) call
to check for name unicity in -no-output mode.

llvm-svn: 244172

8 years ago[dsymutil] Update source used to generate test binary.
Frederic Riss [Wed, 5 Aug 2015 23:33:45 +0000 (23:33 +0000)]
[dsymutil] Update source used to generate test binary.

Forgot to include that in the last commit.

llvm-svn: 244171

8 years agoAdd -fno-coverage-mapping flag.
Diego Novillo [Wed, 5 Aug 2015 23:27:40 +0000 (23:27 +0000)]
Add -fno-coverage-mapping flag.

This new flag allows the user to disable a previous instance of
-fcoverage-mapping, if needed.

llvm-svn: 244170

8 years agoELF2: Simplify Writer interface.
Rui Ueyama [Wed, 5 Aug 2015 23:24:46 +0000 (23:24 +0000)]
ELF2: Simplify Writer interface.

We are using Writer more like a function instead of a class.
This patch makes it a function to simplify the interface.
All details of Writer class is now hidden from other parts of the linker.

llvm-svn: 244169

8 years agoValueMapper: Simplify remap() helper function, NFC
Duncan P. N. Exon Smith [Wed, 5 Aug 2015 23:22:34 +0000 (23:22 +0000)]
ValueMapper: Simplify remap() helper function, NFC

Rename `remap()` to `remapOperands()`, and restrict its contract to
remapping operands.  Previously, it also called `mapToMetadata()`, but
this logic is hard to reason about externally.  In particular, this
refactors `mapUniquedNode()` to avoid redundant mapping calls, taking
advantage of the RAUWs that are already in place.

llvm-svn: 244168

8 years agox86: NFC remove needless InstrCompiler cast
JF Bastien [Wed, 5 Aug 2015 23:15:37 +0000 (23:15 +0000)]
x86: NFC remove needless InstrCompiler cast

Summary: The casts from String to PatFrag weren't needed if we instead provided an SDNode. This fix was suggested by @pete in D11382.

Subscribers: pete, llvm-commits

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

llvm-svn: 244167

8 years ago[NVPTX] Use LDG for pointer induction variables.
Bjarke Hammersholt Roune [Wed, 5 Aug 2015 23:11:57 +0000 (23:11 +0000)]
[NVPTX] Use LDG for pointer induction variables.

More specifically, make NVPTXISelDAGToDAG able to emit cached loads (LDG) for pointer induction variables.

Also fix latent bug where LDG was not restricted to kernel functions. I believe that this could not be triggered so far since we do not currently infer that a pointer is global outside a kernel function, and only loads of global pointers are considered for cached loads.

llvm-svn: 244166

8 years ago[libFuzzer] in dfsan mode, set labels every time we start recording traces as opposed...
Kostya Serebryany [Wed, 5 Aug 2015 23:02:57 +0000 (23:02 +0000)]
[libFuzzer] in dfsan mode, set labels every time we start recording traces as opposed to doing it at process startup. This ensures that the labels are fresh.

llvm-svn: 244165

8 years agoAdd a TrailingObjects template class.
James Y Knight [Wed, 5 Aug 2015 22:57:34 +0000 (22:57 +0000)]
Add a TrailingObjects template class.

This is intended to help support the idiom of a class that has some
other objects (or multiple arrays of different types of objects)
appended on the end, which is used quite heavily in clang.

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

llvm-svn: 244164

8 years agoMake sure all temporary files get created under %T.
Artem Belevich [Wed, 5 Aug 2015 22:54:36 +0000 (22:54 +0000)]
Make sure all temporary files get created under %T.

llvm-svn: 244163

8 years agoAdd flag to request codeview debug info on Windows
Reid Kleckner [Wed, 5 Aug 2015 22:48:26 +0000 (22:48 +0000)]
Add flag to request codeview debug info on Windows

Needed after fixing PR22032.

llvm-svn: 244162

8 years agofunction_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove its
Richard Smith [Wed, 5 Aug 2015 22:41:45 +0000 (22:41 +0000)]
function_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove its
useless return value. Switch to using it directly when completing the
redeclaration chain for an anonymous declaration, and reduce the set of
declarations that we load in the process to just those of the right kind.

llvm-svn: 244161

8 years ago[dsymutil] Add support for the -arch option.
Frederic Riss [Wed, 5 Aug 2015 22:33:28 +0000 (22:33 +0000)]
[dsymutil] Add support for the -arch option.

This option allows to select a subset of the architectures when
performing a universal binary link. The filter is done completely
in the mach-o specific part of the code.

llvm-svn: 244160

8 years agoFix Windows test failure with triple instead of using the native OS
Reid Kleckner [Wed, 5 Aug 2015 22:27:08 +0000 (22:27 +0000)]
Fix Windows test failure with triple instead of using the native OS

llvm-svn: 244159

8 years agoIf the "CodeView" module flag is set, emit codeview instead of DWARF
Reid Kleckner [Wed, 5 Aug 2015 22:26:20 +0000 (22:26 +0000)]
If the "CodeView" module flag is set, emit codeview instead of DWARF

Summary:
Emit both DWARF and CodeView if "CodeView" and "Dwarf Version" module
flags are set.

Reviewers: majnemer

Subscribers: llvm-commits

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

llvm-svn: 244158

8 years agoMIR Serialization: Serialize the machine operand's offset.
Alex Lorenz [Wed, 5 Aug 2015 22:26:15 +0000 (22:26 +0000)]
MIR Serialization: Serialize the machine operand's offset.

This commit serializes the offset for the following operands: target index,
global address, external symbol, constant pool index, and block address.

llvm-svn: 244157

8 years agoAdd <numeric> header for use of std::accumulate().
Cong Hou [Wed, 5 Aug 2015 22:13:43 +0000 (22:13 +0000)]
Add <numeric> header for use of std::accumulate().

llvm-svn: 244156

8 years agoDivide the primitive size in bits by eight so the initial load's alignment is in
Richard Diamond [Wed, 5 Aug 2015 22:10:57 +0000 (22:10 +0000)]
Divide the primitive size in bits by eight so the initial load's alignment is in
bytes as expected. Tested with the included unit test.

llvm-svn: 244155

8 years agoRecord whether the weights on out-edges from a MBB are normalized.
Cong Hou [Wed, 5 Aug 2015 22:01:20 +0000 (22:01 +0000)]
Record whether the weights on out-edges from a MBB are normalized.

1. Create a utility function normalizeEdgeWeights() in MachineBranchProbabilityInfo that normalizes a list of edge weights so that the sum of then can fit in uint32_t.
2. Provide an interface in MachineBasicBlock to normalize its successors' weights.
3. Add a flag in MachineBasicBlock that tracks whether its successors' weights are normalized.
4. Provide an overload of getSumForBlock that accepts a non-const pointer to a MBB so that it can force normalizing this MBB's successors' weights.
5. Update several uses of getSumForBlock() by eliminating the once needed weight scale.

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

llvm-svn: 244154

8 years agoAdd flags to disable profile generation.
Diego Novillo [Wed, 5 Aug 2015 21:49:51 +0000 (21:49 +0000)]
Add flags to disable profile generation.

This patch adds flags -fno-profile-instr-generate and
-fno-profile-instr-use, and the GCC aliases -fno-profile-generate and
-fno-profile-use.

These flags are used in situations where users need to disable profile
generation or use for specific files in a build, without affecting other
files.

llvm-svn: 244153

8 years ago[libFuzzer] add option -report_slow_units=Nsec to control when slow units are printed
Kostya Serebryany [Wed, 5 Aug 2015 21:43:48 +0000 (21:43 +0000)]
[libFuzzer] add option -report_slow_units=Nsec to control when slow units are printed

llvm-svn: 244152

8 years ago[libFuzzer] add a missing test file
Kostya Serebryany [Wed, 5 Aug 2015 21:32:13 +0000 (21:32 +0000)]
[libFuzzer] add a missing test file

llvm-svn: 244151

8 years agoReword a comment about IncludeDirGroup. NFC
Douglas Katzman [Wed, 5 Aug 2015 21:31:54 +0000 (21:31 +0000)]
Reword a comment about IncludeDirGroup. NFC

Referring to the groups by mixing the enumerated name
with the command-line flag was not as clear as could be.

llvm-svn: 244150

8 years ago[sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE crashes...
Kostya Serebryany [Wed, 5 Aug 2015 21:19:11 +0000 (21:19 +0000)]
[sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski

llvm-svn: 244136

8 years agoDrop the defaulted CallGraph move ctor, since it's unused and MSVC doesn't support...
David Blaikie [Wed, 5 Aug 2015 21:16:46 +0000 (21:16 +0000)]
Drop the defaulted CallGraph move ctor, since it's unused and MSVC doesn't support defaulted move ops

llvm-svn: 244135

8 years agoReplace &vector[0] with vector.data() to avoid invalid dereference caught by debug...
Nick Lewycky [Wed, 5 Aug 2015 21:16:02 +0000 (21:16 +0000)]
Replace &vector[0] with vector.data() to avoid invalid dereference caught by debug STL. Also move a '*' for consistency and fix an 80-col violation.

llvm-svn: 244134

8 years ago-Wdeprecated: Remove some dead code that was relying on a questionable (rule-of-3...
David Blaikie [Wed, 5 Aug 2015 21:15:48 +0000 (21:15 +0000)]
-Wdeprecated: Remove some dead code that was relying on a questionable (rule-of-3-violating) copy ctor in MCInstPrinter

llvm-svn: 244133

8 years ago[LoopUnswitch] Preserve make.implicit metadata for unswitched conditions
Chen Li [Wed, 5 Aug 2015 21:13:26 +0000 (21:13 +0000)]
[LoopUnswitch] Preserve make.implicit metadata for unswitched conditions

Summary: This patch adds support to preserve make.implicit metadata for unswitched conditions in loop pre-header.

Reviewers: sanjoy, weimingz

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 244132

8 years agoRemove unused header includes.
Eric Christopher [Wed, 5 Aug 2015 21:11:56 +0000 (21:11 +0000)]
Remove unused header includes.

llvm-svn: 244131

8 years ago[Hexagon] Edit a comment. NFC
Krzysztof Parzyszek [Wed, 5 Aug 2015 21:08:26 +0000 (21:08 +0000)]
[Hexagon] Edit a comment. NFC

llvm-svn: 244130

8 years ago-Wdeprecated clean by making LogBuilder move constructible so it can be returned...
David Blaikie [Wed, 5 Aug 2015 21:06:50 +0000 (21:06 +0000)]
-Wdeprecated clean by making LogBuilder move constructible so it can be returned by value (in DifferenceEngine::logf)

llvm-svn: 244129

8 years agox86 atomic: optimize a.store(reg op a.load(acquire), release)
JF Bastien [Wed, 5 Aug 2015 21:04:59 +0000 (21:04 +0000)]
x86 atomic: optimize a.store(reg op a.load(acquire), release)

Summary: PR24191 finds that the expected memory-register operations aren't generated when relaxed { load ; modify ; store } is used. This is similar to PR17281 which was addressed in D4796, but only for memory-immediate operations (and for memory orderings up to acquire and release). This patch also handles some floating-point operations.

Reviewers: reames, kcc, dvyukov, nadav, morisset, chandlerc, t.p.northover, pete

Subscribers: llvm-commits

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

llvm-svn: 244128

8 years ago[PM] Remove a failed attempt to port the CallGraph analysis to the new
Chandler Carruth [Wed, 5 Aug 2015 21:04:31 +0000 (21:04 +0000)]
[PM] Remove a failed attempt to port the CallGraph analysis to the new
pass manager.

This never worked, and won't ever work. It was actually why I ended up
building the LazyCallGraph set of code which is more more effectively
wired up to the new pass manager. This accidentally got committed when
I was trying to land a cleanup of the code organization in the other
parts of this file. =[ My bad, but fortunately Dave was keen eyed enough
to spot that this code couldn't possibly work. =]

llvm-svn: 244127

8 years agoRename builtin_lang -> Langs to match the rest of the code a bit better.
Eric Christopher [Wed, 5 Aug 2015 21:04:28 +0000 (21:04 +0000)]
Rename builtin_lang -> Langs to match the rest of the code a bit better.

llvm-svn: 244126

8 years agoRemove unused function GetBuiltinNames.
Eric Christopher [Wed, 5 Aug 2015 21:04:24 +0000 (21:04 +0000)]
Remove unused function GetBuiltinNames.

llvm-svn: 244125

8 years agoDocumentation: fix another typo, "arrays types" -> "array types".
James Dennett [Wed, 5 Aug 2015 20:58:23 +0000 (20:58 +0000)]
Documentation: fix another typo, "arrays types" -> "array types".

Thanks to Kim Gräsman <kim.grasman@gmail.com> for pointing this out.

llvm-svn: 244124

8 years agoUpdate GettingStarted docs list of LLVM_TARGETS_TO_BUILD to match cmake.
Pete Cooper [Wed, 5 Aug 2015 20:55:53 +0000 (20:55 +0000)]
Update GettingStarted docs list of LLVM_TARGETS_TO_BUILD to match cmake.

Since the docs were written, we've added the BPF backend to the list.
Updating the docs to take this in to account.  Also sorted them to
match cmake while I was changing these lines.

Reviewed by Chris B.

llvm-svn: 244123

8 years ago-Wdeprecated cleanup: Make CallGraph movable by default by using unique_ptr members...
David Blaikie [Wed, 5 Aug 2015 20:55:50 +0000 (20:55 +0000)]
-Wdeprecated cleanup: Make CallGraph movable by default by using unique_ptr members rather than raw pointers.

The only place that tries to return a CallGraph by value
(CallGraphAnalysis::run) doesn't seem to be used right now, but it's a
reasonable bit of cleanup anyway.

llvm-svn: 244122

8 years agoRevert "Fix MO's analyzePhysReg, it was confusing sub- and super-registers. Problem...
JF Bastien [Wed, 5 Aug 2015 20:53:56 +0000 (20:53 +0000)]
Revert "Fix MO's analyzePhysReg, it was confusing sub- and super-registers. Problem pointed out by Michael Hordijk."

I mistakenly committed the patch for D6629, and was trying to commit another. Reverting until it gets proper signoff.

llvm-svn: 244121

8 years agoFix MO's analyzePhysReg, it was confusing sub- and super-registers. Problem pointed...
JF Bastien [Wed, 5 Aug 2015 20:49:46 +0000 (20:49 +0000)]
Fix MO's analyzePhysReg, it was confusing sub- and super-registers. Problem pointed out by Michael Hordijk.

llvm-svn: 244120

8 years ago[CMake] Add USES_TERMINAL 1 to ExternalProject_Add_Step calls on 3.3.20150708 and...
Chris Bieneman [Wed, 5 Aug 2015 20:46:39 +0000 (20:46 +0000)]
[CMake] Add USES_TERMINAL 1 to ExternalProject_Add_Step calls on 3.3.20150708 and later.

llvm-svn: 244119

8 years ago-Wdeprecated-clean: Remove uses of throw() in favor of noexcept
David Blaikie [Wed, 5 Aug 2015 20:38:57 +0000 (20:38 +0000)]
-Wdeprecated-clean: Remove uses of throw() in favor of noexcept

llvm-svn: 244115

8 years agoNFC.
Cong Hou [Wed, 5 Aug 2015 20:30:11 +0000 (20:30 +0000)]
NFC.

Convert comments in MachineBasicBlock.h into new style.

llvm-svn: 244113

8 years ago-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated...
David Blaikie [Wed, 5 Aug 2015 20:20:29 +0000 (20:20 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

LoadedObjectInfo was depending on the implicit copy ctor in the presence
of a user-declared dtor. Default (and protect) it in the base class and
make the devired classes final to avoid any risk of a public API that
would enable slicing.

llvm-svn: 244112

8 years agoRemove unused comparison operators from the Builtin Info struct.
Eric Christopher [Wed, 5 Aug 2015 20:11:04 +0000 (20:11 +0000)]
Remove unused comparison operators from the Builtin Info struct.

llvm-svn: 244111

8 years agoRemove unnecessary ClangLibdirSuffix variable.
Yaron Keren [Wed, 5 Aug 2015 20:06:56 +0000 (20:06 +0000)]
Remove unnecessary ClangLibdirSuffix variable.
Twine + const char * is supported.

llvm-svn: 244110

8 years agoHandle writeImportLibrary failing.
Rafael Espindola [Wed, 5 Aug 2015 20:03:57 +0000 (20:03 +0000)]
Handle writeImportLibrary failing.

We were printing an error but exiting with 0.

Not sure how to test this. We could add a no-winlib feature,
but that is probably not worth it.

llvm-svn: 244109

8 years agoRevert "Fix `llvm-config` to emit the linker flag for the combined shared object...
Richard Diamond [Wed, 5 Aug 2015 20:03:26 +0000 (20:03 +0000)]
Revert "Fix `llvm-config` to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components."

It seems I was wrong thinking `autoconf`/`make` only installed shared libraries if configured with `--enable-shared`, even if `--disable-static` is present. I'll re-address with a followup patch.

This reverts commit r243297 for causing PR#24154.

llvm-svn: 244108

8 years agolit fixes for lld.
Rafael Espindola [Wed, 5 Aug 2015 19:55:17 +0000 (19:55 +0000)]
lit fixes for lld.

It was not using LLVM_LIT_TOOLS_DIR and at least on my VM never finding lib.exe.

With this all the COFF tests show up as supported and pass.

llvm-svn: 244107

8 years agoCOFF: Fix bad #includes.
Rui Ueyama [Wed, 5 Aug 2015 19:51:28 +0000 (19:51 +0000)]
COFF: Fix bad #includes.

Writer.h is intended to be included only by Writer.cpp and Driver.cpp.
Use of the header in other files are bad.

llvm-svn: 244106

8 years ago[AArch64] Stable runtime required for proc maps test
Renato Golin [Wed, 5 Aug 2015 19:45:26 +0000 (19:45 +0000)]
[AArch64] Stable runtime required for proc maps test

llvm-svn: 244105

8 years agoDocumentation: fix a typo, "This flag is determines" -> "This flag determines".
James Dennett [Wed, 5 Aug 2015 19:44:47 +0000 (19:44 +0000)]
Documentation: fix a typo, "This flag is determines" -> "This flag determines".

No functional change.

llvm-svn: 244104

8 years agoWrite access test.
Richard Diamond [Wed, 5 Aug 2015 19:40:39 +0000 (19:40 +0000)]
Write access test.

llvm-svn: 244103

8 years agoCOFF: ARM: Implepment BLX23T relocation and fix Branch20T.
Rui Ueyama [Wed, 5 Aug 2015 19:40:07 +0000 (19:40 +0000)]
COFF: ARM: Implepment BLX23T relocation and fix Branch20T.

I fed the same test to MSVC linker and got the same output,
so I believe this implementation is correct.

llvm-svn: 244102

8 years ago[UBSan] Fix UBSan-vptr false positive.
Alexey Samsonov [Wed, 5 Aug 2015 19:35:46 +0000 (19:35 +0000)]
[UBSan] Fix UBSan-vptr false positive.

Offset from vptr to the start of most-derived object can actually
be positive in some virtual base class vtables.

Patch by Stephan Bergmann!

llvm-svn: 244101

8 years agoMIR Parser: Report an error when parsing large immediate operands.
Alex Lorenz [Wed, 5 Aug 2015 19:03:42 +0000 (19:03 +0000)]
MIR Parser: Report an error when parsing large immediate operands.

llvm-svn: 244100

8 years ago[sanitizer] fix the Mac build (hopefully)
Kostya Serebryany [Wed, 5 Aug 2015 18:56:42 +0000 (18:56 +0000)]
[sanitizer] fix the Mac build (hopefully)

llvm-svn: 244099

8 years agoMIR Serialization: Serialize the typed immediate integer machine operands.
Alex Lorenz [Wed, 5 Aug 2015 18:52:21 +0000 (18:52 +0000)]
MIR Serialization: Serialize the typed immediate integer machine operands.

llvm-svn: 244098

8 years agoAdd -gcodeview and -gdwarf to control which type Clang emits
Reid Kleckner [Wed, 5 Aug 2015 18:51:13 +0000 (18:51 +0000)]
Add -gcodeview and -gdwarf to control which type Clang emits

Summary:
By default, 'clang' emits dwarf and 'clang-cl' emits codeview.  You can
force emission of one or both by passing -gcodeview and -gdwarf to
either driver.

Reviewers: dblaikie, hans

Subscribers: cfe-commits

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

llvm-svn: 244097

8 years ago[Unroll] Switch to using 'int' cost types in preparation for a somewhat
Chandler Carruth [Wed, 5 Aug 2015 18:46:21 +0000 (18:46 +0000)]
[Unroll] Switch to using 'int' cost types in preparation for a somewhat
more involved change to the cost computation pattern.

llvm-svn: 244095

8 years ago[dsymutil] Fix test patterns.
Frederic Riss [Wed, 5 Aug 2015 18:45:13 +0000 (18:45 +0000)]
[dsymutil] Fix test patterns.

Depending on the filesystem paths, the YAML dump might quote paths.
Account for that in the regex patterns.

llvm-svn: 244094

8 years agoMIR Parser: Extract the IR constant parsing code into a new method. NFC.
Alex Lorenz [Wed, 5 Aug 2015 18:44:00 +0000 (18:44 +0000)]
MIR Parser: Extract the IR constant parsing code into a new method. NFC.

This commit extracts the code that parses the IR constant values into a new
method named 'parseIRConstant' in the 'MIParser' class. The new method will
be reused by the code that parses the typed integer immediate machine operands.

llvm-svn: 244093

8 years ago[AArch64] Enable thread sanitizer on clang
Renato Golin [Wed, 5 Aug 2015 18:42:41 +0000 (18:42 +0000)]
[AArch64] Enable thread sanitizer on clang

With this option, clang can use -fsanitize=thread on AArch64.

Patch by Adhemerval Zanella.

llvm-svn: 244091

8 years ago[Hexagon] Implement TargetTransformInfo for Hexagon
Krzysztof Parzyszek [Wed, 5 Aug 2015 18:35:37 +0000 (18:35 +0000)]
[Hexagon] Implement TargetTransformInfo for Hexagon

Author: Brendon Cahoon <bcahoon@codeaurora.org>
llvm-svn: 244089

8 years ago[AArch64] Fixes broken bot fue to TSAN patch
Renato Golin [Wed, 5 Aug 2015 18:34:20 +0000 (18:34 +0000)]
[AArch64] Fixes broken bot fue to TSAN patch

Patch by Adhemerval Zanella.

llvm-svn: 244088

8 years ago[dsymutil] Implement support for handling mach-o universal binaries as main input...
Frederic Riss [Wed, 5 Aug 2015 18:27:44 +0000 (18:27 +0000)]
[dsymutil] Implement support for handling mach-o universal binaries as main input/output.

The DWARF linker isn't touched by this, the implementation links
individual files and merges them together into a fat binary by
calling out to the 'lipo' utility.

The main change is that the MachODebugMapParser can now return
multiple debug maps for a single binary.

The test just verifies that lipo would be invoked correctly, but
doesn't actually generate a binary. This mimics the way clang
tests its external iplatform tools integration.

llvm-svn: 244087

8 years ago[dsymutil] Introduce exit helper. NFC.
Frederic Riss [Wed, 5 Aug 2015 18:27:38 +0000 (18:27 +0000)]
[dsymutil] Introduce exit helper. NFC.

llvm-dsymutil will start creating temporary files in a followup
commit. To ease the correct cleanup of this files, introduce a
helper called to exit dsymutil.

llvm-svn: 244086

8 years ago[dsymutil] Split some logic into a helper function. NFC
Frederic Riss [Wed, 5 Aug 2015 18:27:34 +0000 (18:27 +0000)]
[dsymutil] Split some logic into a helper function. NFC

llvm-svn: 244085

8 years ago[libFuzzer] use data-flow feedback from strcmp
Kostya Serebryany [Wed, 5 Aug 2015 18:23:01 +0000 (18:23 +0000)]
[libFuzzer] use data-flow feedback from strcmp

llvm-svn: 244084

8 years ago[libFuzzer] add weak hooks for strcmp
Kostya Serebryany [Wed, 5 Aug 2015 18:20:54 +0000 (18:20 +0000)]
[libFuzzer] add weak hooks for strcmp

llvm-svn: 244083

8 years ago[libFuzzer/DFSan] add more __sanitizer callbacks to dfsan blacklist
Kostya Serebryany [Wed, 5 Aug 2015 18:20:15 +0000 (18:20 +0000)]
[libFuzzer/DFSan] add more __sanitizer callbacks to dfsan blacklist

llvm-svn: 244082

8 years agoMIR Parser: Report an error when parsing duplicate register flags.
Alex Lorenz [Wed, 5 Aug 2015 18:09:03 +0000 (18:09 +0000)]
MIR Parser: Report an error when parsing duplicate register flags.

llvm-svn: 244081

8 years ago[TTI] Make the cost APIs in TargetTransformInfo consistently use 'int'
Chandler Carruth [Wed, 5 Aug 2015 18:08:10 +0000 (18:08 +0000)]
[TTI] Make the cost APIs in TargetTransformInfo consistently use 'int'
rather than 'unsigned' for their costs.

For something like costs in particular there is a natural "negative"
value, that of savings or saved cost. As a consequence, there is a lot
of code that subtracts or creates negative values based on cost, all of
which is prone to awkwardness or bugs when dealing with an unsigned
type. Similarly, we *never* want these values to wrap, as that would
cause Very Bad code generation (likely percieved as an infinite loop as
we try to emit over 2^32 instructions or some such insanity).

All around 'int' seems a much better fit for these basic metrics. I've
added asserts to ensure that at least the TTI interface never returns
negative numbers here. If we ever have a use case for negative numbers,
we can remove this, but this way a bug where someone used '-1' to
produce a 'very large' cost will be caught by the assert.

This passes all tests, and is also UBSan clean.

No functional change intended.

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

llvm-svn: 244080

8 years agoClaim arguments that belong to 'clang_ignored_gcc_optimization_f_Group'
Douglas Katzman [Wed, 5 Aug 2015 18:03:47 +0000 (18:03 +0000)]
Claim arguments that belong to 'clang_ignored_gcc_optimization_f_Group'

This seems preferable to printing two warnings per unsupported option-
one warning about not supporting it, and one about not using it.
It also makes the '-Wno-' option do what you mean.

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

llvm-svn: 244079

8 years ago[GMR] Teach the conservative path of GMR to catch even more easy cases.
Chandler Carruth [Wed, 5 Aug 2015 17:58:30 +0000 (17:58 +0000)]
[GMR] Teach the conservative path of GMR to catch even more easy cases.

In PR24288 it was pointed out that the easy case of a non-escaping
global and something that *obviously* required an escape sometimes is
hidden behind PHIs (or selects in theory). Because we have this binary
test, we can easily just check that all possible input values satisfy
the requirement. This is done with a (very small) recursion through PHIs
and selects. With this, the specific example from the PR is correctly
folded by GVN.

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

llvm-svn: 244078

8 years agoTry to fix sanitizer_win.cc compile error on 64-bit after r243895
Hans Wennborg [Wed, 5 Aug 2015 17:55:26 +0000 (17:55 +0000)]
Try to fix sanitizer_win.cc compile error on 64-bit after r243895

llvm-svn: 244077

8 years ago[test] Attempt a change to see if it fixes the test for the windows bot.
Argyrios Kyrtzidis [Wed, 5 Aug 2015 17:52:57 +0000 (17:52 +0000)]
[test] Attempt a change to see if it fixes the test for the windows bot.

llvm-svn: 244076

8 years agoMIR Serialization: Serialize the 'early-clobber' register operand flag.
Alex Lorenz [Wed, 5 Aug 2015 17:49:03 +0000 (17:49 +0000)]
MIR Serialization: Serialize the 'early-clobber' register operand flag.

llvm-svn: 244075