platform/upstream/llvm.git
11 years agoMake the nomathbuiltin.c test less demanding.
Eli Bendersky [Tue, 23 Jul 2013 01:09:17 +0000 (01:09 +0000)]
Make the nomathbuiltin.c test less demanding.

This should hopefully unbreak the Windows bots at http://bb.pgr.jp

llvm-svn: 186906

11 years agoFurther simplify test case from r186894
David Blaikie [Tue, 23 Jul 2013 01:01:17 +0000 (01:01 +0000)]
Further simplify test case from r186894

llvm-svn: 186905

11 years agoAdd aliases to map 'imm, mem' form of x86 bts/btr/btc without a size suffix to their...
Craig Topper [Tue, 23 Jul 2013 00:56:15 +0000 (00:56 +0000)]
Add aliases to map 'imm, mem' form of x86 bts/btr/btc without a size suffix to their 32-bit forms.

This makes them consistent with 'bt' which already had this handling. gas has the same behavior. There have been discussions on the mailing list about determining size based on the immediate, but my goal here was just to remove the inconsistency.

llvm-svn: 186904

11 years agoIntegers which are too large should be an error.
Eli Friedman [Tue, 23 Jul 2013 00:25:18 +0000 (00:25 +0000)]
Integers which are too large should be an error.

Switch some warnings over to errors which should never have been warnings
in the first place.  (Also, a minor fix to the preprocessor rules for
integer literals while I'm here.)

llvm-svn: 186903

11 years agoDebug Info Finder: use processDeclare and processValue to list debug info
Manman Ren [Tue, 23 Jul 2013 00:22:51 +0000 (00:22 +0000)]
Debug Info Finder: use processDeclare and processValue to list debug info
MDNodes used by DbgDeclareInst and DbgValueInst.

Another 16 testing cases failed and they are disabled with
-disable-debug-info-verifier.
A total of 34 cases are disabled with -disable-debug-info-verifier and will be
corrected.

llvm-svn: 186902

11 years agoSimplify testcase.
Adrian Prantl [Tue, 23 Jul 2013 00:21:48 +0000 (00:21 +0000)]
Simplify testcase.
rdar://problem/14386148

llvm-svn: 186901

11 years agoExplicitly don't let the asm printer use the clrb/w/l aliases for xor %reg, %reg.
Craig Topper [Tue, 23 Jul 2013 00:15:19 +0000 (00:15 +0000)]
Explicitly don't let the asm printer use the clrb/w/l aliases for xor %reg, %reg.

It only didn't use it before because it seems InstAlias handling in the asm printer fails to count tied operands so it tried to find an xor with 2 operands instead of the 3 it wfails to count tied.

llvm-svn: 186900

11 years agoAdd a -fno-math-builtin option to the Clang -cc1
Eli Bendersky [Tue, 23 Jul 2013 00:13:01 +0000 (00:13 +0000)]
Add a -fno-math-builtin option to the Clang -cc1

llvm-svn: 186899

11 years agoImplement a better fix for r186894 by setting the appropriate type for __byref_variab...
Adrian Prantl [Tue, 23 Jul 2013 00:12:14 +0000 (00:12 +0000)]
Implement a better fix for r186894 by setting the appropriate type for __byref_variable_layout.

rdar://problem/14386148

llvm-svn: 186898

11 years agoSuppress argumentless aliases for some x86 FP operations from being used by the asm...
Craig Topper [Tue, 23 Jul 2013 00:03:33 +0000 (00:03 +0000)]
Suppress argumentless aliases for some x86 FP operations from being used by the asm writer. Prefer to use the explicit %st(1) form.

llvm-svn: 186897

11 years agoFix typo (ponted -> pointed)
Matt Arsenault [Mon, 22 Jul 2013 23:52:23 +0000 (23:52 +0000)]
Fix typo (ponted -> pointed)

llvm-svn: 186896

11 years agoObjectiveC migration. Better handle migration to conforming
Fariborz Jahanian [Mon, 22 Jul 2013 23:50:04 +0000 (23:50 +0000)]
ObjectiveC migration. Better handle migration to conforming
protocols by ignoring cases where all protocol properties
and methods are optional.

llvm-svn: 186895

11 years agoDebug Info: Acknowledge the alignment when locating byref block variables.
Adrian Prantl [Mon, 22 Jul 2013 23:44:26 +0000 (23:44 +0000)]
Debug Info: Acknowledge the alignment when locating byref block variables.
Fixes rdar://problem/14386148

llvm-svn: 186894

11 years agoRemove extraneous null statement. No functionality change!
Nick Lewycky [Mon, 22 Jul 2013 23:38:27 +0000 (23:38 +0000)]
Remove extraneous null statement. No functionality change!

llvm-svn: 186893

11 years agoUse switch instead of if. No functionality change.
Jakub Staszak [Mon, 22 Jul 2013 23:38:16 +0000 (23:38 +0000)]
Use switch instead of if. No functionality change.

llvm-svn: 186892

11 years agoTestcase for PR16673.
Eli Friedman [Mon, 22 Jul 2013 23:30:13 +0000 (23:30 +0000)]
Testcase for PR16673.

llvm-svn: 186891

11 years agoRemove trailing spaces.
Jakub Staszak [Mon, 22 Jul 2013 23:16:36 +0000 (23:16 +0000)]
Remove trailing spaces.

llvm-svn: 186890

11 years agoDon't emit open-paren fixit without close-paren.
Eli Friedman [Mon, 22 Jul 2013 23:09:39 +0000 (23:09 +0000)]
Don't emit open-paren fixit without close-paren.

getLocForEndOfToken() isn't guaranteed to succeed; if it doesn't, make sure
we do something sane.

Fixes PR16673.  I'm not sure how to write a testcase for this short of grepping
through the diagnostic output.

llvm-svn: 186889

11 years ago[PECOFF] Replace magic numbers with offsetof().
Rui Ueyama [Mon, 22 Jul 2013 23:02:08 +0000 (23:02 +0000)]
[PECOFF] Replace magic numbers with offsetof().

llvm-svn: 186888

11 years agoAdd a simple unit test for MemoryBuffer::getOpenFile
Eli Bendersky [Mon, 22 Jul 2013 22:46:21 +0000 (22:46 +0000)]
Add a simple unit test for MemoryBuffer::getOpenFile

llvm-svn: 186887

11 years agoTypo.
Eric Christopher [Mon, 22 Jul 2013 22:25:09 +0000 (22:25 +0000)]
Typo.

llvm-svn: 186886

11 years ago80-column tidying. Formatting choices by clang-format.
Eric Christopher [Mon, 22 Jul 2013 22:25:07 +0000 (22:25 +0000)]
80-column tidying. Formatting choices by clang-format.

llvm-svn: 186885

11 years agoFix -Wsign-compare warnings.
Rui Ueyama [Mon, 22 Jul 2013 22:21:39 +0000 (22:21 +0000)]
Fix -Wsign-compare warnings.

llvm-svn: 186884

11 years agoWhen we vectorize across multiple basic blocks we may vectorize PHINodes that create...
Nadav Rotem [Mon, 22 Jul 2013 22:18:07 +0000 (22:18 +0000)]
When we vectorize across multiple basic blocks we may vectorize PHINodes that create a cycle. We already break the cycle on phi-nodes, but arithmetic operations are still uplicated. This patch adds code that checks if the operation that we are vectorizing was vectorized during the visit of the operands and uses this value if it can.

llvm-svn: 186883

11 years ago[PECOFF][Driver] Show error message if no input file is given.
Rui Ueyama [Mon, 22 Jul 2013 22:17:24 +0000 (22:17 +0000)]
[PECOFF][Driver] Show error message if no input file is given.

llvm-svn: 186882

11 years agoWhen a Cortex-M3 target is selected (armv7m), force disassembly to be in
Jason Molenda [Mon, 22 Jul 2013 22:11:53 +0000 (22:11 +0000)]
When a Cortex-M3 target is selected (armv7m), force disassembly to be in
thumb mode.
<rdar://problem/14107444>, <rdar://problem/14107405>

llvm-svn: 186881

11 years agoOldPtr is llvm::Instruction. Remove unneeded cast<>.
Jakub Staszak [Mon, 22 Jul 2013 22:10:43 +0000 (22:10 +0000)]
OldPtr is llvm::Instruction. Remove unneeded cast<>.

llvm-svn: 186880

11 years agoSilence gcc warning.
Richard Trieu [Mon, 22 Jul 2013 21:29:28 +0000 (21:29 +0000)]
Silence gcc warning.

llvm-svn: 186879

11 years agoFix the move to/from accumulator register instructions that use a full 64-bit
Kevin Enderby [Mon, 22 Jul 2013 21:25:31 +0000 (21:25 +0000)]
Fix the move to/from accumulator register instructions that use a full 64-bit
absolute address encoded in the instruction.

rdar://8612627 and rdar://14299221

llvm-svn: 186878

11 years agoChange tabs to spaces.
Jakub Staszak [Mon, 22 Jul 2013 21:11:30 +0000 (21:11 +0000)]
Change tabs to spaces.

llvm-svn: 186877

11 years agoFix typo in test.
Jakub Staszak [Mon, 22 Jul 2013 21:10:42 +0000 (21:10 +0000)]
Fix typo in test.

llvm-svn: 186876

11 years agoFix a bug in std::fill_n where memset would end up being called in cases when it...
Anders Carlsson [Mon, 22 Jul 2013 21:08:00 +0000 (21:08 +0000)]
Fix a bug in std::fill_n where memset would end up being called in cases when it shouldn’t.

Reviewed by Howard.

llvm-svn: 186875

11 years ago[stackprotector] Changed isNoopBitcast/sameNoopInput to take TargetLoweringBase inste...
Michael Gottesman [Mon, 22 Jul 2013 21:05:47 +0000 (21:05 +0000)]
[stackprotector] Changed isNoopBitcast/sameNoopInput to take TargetLoweringBase instead of TargetLowering.

Both functions only use functionality from TargetLoweringBase.

rdar://13935163

llvm-svn: 186874

11 years agoRevert "cp11-migrate: Integration with LibFormat"
Michael Gottesman [Mon, 22 Jul 2013 21:03:56 +0000 (21:03 +0000)]
Revert "cp11-migrate: Integration with LibFormat"

This reverts commit r186866.

This breaks the build and the original author Guillaume Papin
<guillaume.papin@epitech.eu> asked me to revert so he could look at it more with
revane.

llvm-svn: 186873

11 years agoRevert commit 186833 (no longer needed after the fix in 186859).
Enea Zaffanella [Mon, 22 Jul 2013 20:58:30 +0000 (20:58 +0000)]
Revert commit 186833 (no longer needed after the fix in 186859).

llvm-svn: 186872

11 years agoFix i386 FreeBSD build
Ed Maste [Mon, 22 Jul 2013 20:51:08 +0000 (20:51 +0000)]
Fix i386 FreeBSD build

llvm-svn: 186871

11 years agoMake modules depend on the compiler's own module.map, as a proxy for the compiler...
Douglas Gregor [Mon, 22 Jul 2013 20:48:33 +0000 (20:48 +0000)]
Make modules depend on the compiler's own module.map, as a proxy for the compiler itself.

The headers in the compiler's own resource include directory are
system headers, which means we don't stat() them eagerly when loading
a module. Use module.map as a proxy for these headers and the compiler
itself. Fixes <rdar://problem/13856838>.

llvm-svn: 186870

11 years agoRecommit r186813: More Intel syntax alias fixes. With the addition of suppressing...
Craig Topper [Mon, 22 Jul 2013 20:46:37 +0000 (20:46 +0000)]
Recommit r186813: More Intel syntax alias fixes. With the addition of suppressing some of the aliases from being emitted by the asm printer.

llvm-svn: 186869

11 years ago[stackprotector] Refactored ssp prologue creation code into its own helper function.
Michael Gottesman [Mon, 22 Jul 2013 20:44:11 +0000 (20:44 +0000)]
[stackprotector] Refactored ssp prologue creation code into its own helper function.

No functionality change.

rdar://13935163

llvm-svn: 186868

11 years agoDebug Info Finder: add processScope to actually handle the Scope.
Manman Ren [Mon, 22 Jul 2013 20:28:53 +0000 (20:28 +0000)]
Debug Info Finder: add processScope to actually handle the Scope.

Instead of just adding the scope to the list, we actually handle the scope.

llvm-svn: 186867

11 years agocp11-migrate: Integration with LibFormat
Edwin Vane [Mon, 22 Jul 2013 20:26:29 +0000 (20:26 +0000)]
cp11-migrate: Integration with LibFormat

Adding a feature to optionally reformat code changed by the migrator. Like
LibFormat, can choose between built-in styles (LLVM, Mozilla, Google, Chromium)
or use a YAML-format config file.

Author: Guillaume Papin <guillaume.papin@epitech.eu>
llvm-svn: 186866

11 years agoelf-core: Run-time reg context selection
Ed Maste [Mon, 22 Jul 2013 20:20:55 +0000 (20:20 +0000)]
elf-core: Run-time reg context selection

Instantiate RegisterContextCore... based on getOS() instead of with
compile-time #ifdef-ery.

The assert()s here are unfortunate, but better than crashing with no
explanation.  (This would previously happen for an unsupported
architecture, anyhow.)

We should add an equivalent OS and architecture test to
ProcessElfCore::DoLoadCore() and cleanly report the error to the user.

llvm-svn: 186865

11 years agoUse the updated name for the attribute.
Bill Wendling [Mon, 22 Jul 2013 20:15:41 +0000 (20:15 +0000)]
Use the updated name for the attribute.

llvm-svn: 186864

11 years agoRecommit r186217 with testcase fix:
Bill Wendling [Mon, 22 Jul 2013 20:15:21 +0000 (20:15 +0000)]
Recommit r186217 with testcase fix:

 Use the function attributes to pass along the stack protector buffer size.

 Now that we have robust function attributes, don't use a command line option to
 specify the stack protecto buffer size.

llvm-svn: 186863

11 years agoelf-core: Remove SetTriple workaround
Ed Maste [Mon, 22 Jul 2013 20:01:34 +0000 (20:01 +0000)]
elf-core: Remove SetTriple workaround

On FreeBSD I see that Arch, Vendor, OS, and Environment are unchanged
after this call (for x86_64, at least), and core debugging works without
it.

If we need to restore it we should be able to switch on
arch.GetTriple.getOS() instead of a compile-time #ifdef.

Thanks to Daniel Malea for testing on Linux.

llvm-svn: 186862

11 years ago[mips] Fix MipsAsmParser::parseCCRRegs.
Akira Hatanaka [Mon, 22 Jul 2013 19:30:38 +0000 (19:30 +0000)]
[mips] Fix MipsAsmParser::parseCCRRegs.

Enable parsing all 32 floating point control registers $0-31 and stop trying to
parse floating point condition code register $fcc0. Also, return ParseFail if
the operand being parsed is not in the expected format.

llvm-svn: 186861

11 years agoMark ELF's first symbol as format specific so that llvm-nm ignores it.
Rafael Espindola [Mon, 22 Jul 2013 19:24:34 +0000 (19:24 +0000)]
Mark ELF's first symbol as format specific so that llvm-nm ignores it.

llvm-svn: 186860

11 years agoFixed implementation of C89 6.5.7 p3.
Enea Zaffanella [Mon, 22 Jul 2013 19:10:20 +0000 (19:10 +0000)]
Fixed implementation of C89 6.5.7 p3.
Warning should be emitted only for InitListExpr nodes.

llvm-svn: 186859

11 years agoFix spelling and grammar
Matt Arsenault [Mon, 22 Jul 2013 18:59:58 +0000 (18:59 +0000)]
Fix spelling and grammar

llvm-svn: 186858

11 years agoFix missing const
Matt Arsenault [Mon, 22 Jul 2013 18:58:53 +0000 (18:58 +0000)]
Fix missing const

llvm-svn: 186857

11 years agoObjective-C migration: Use NS_OPTIONS when enumerators
Fariborz Jahanian [Mon, 22 Jul 2013 18:53:45 +0000 (18:53 +0000)]
Objective-C migration: Use NS_OPTIONS when enumerators
have shift/bitwise operators or are power of 2.

llvm-svn: 186856

11 years ago[mips] Use ADDu instead of OR to copy general purpose registers. Also, delete
Akira Hatanaka [Mon, 22 Jul 2013 18:52:22 +0000 (18:52 +0000)]
[mips] Use ADDu instead of OR to copy general purpose registers. Also, delete
the InstAlias pattern which maps "move" to OR to resolve ambiguity in
MatchTable.

llvm-svn: 186855

11 years agoAdding example source to support MCJIT/Kaleidoscope blog posts.
Andrew Kaylor [Mon, 22 Jul 2013 18:47:24 +0000 (18:47 +0000)]
Adding example source to support MCJIT/Kaleidoscope blog posts.

llvm-svn: 186854

11 years agoInitialize/Register LTO passes to enable flags like -print-after=<lto-pass>
Shuxin Yang [Mon, 22 Jul 2013 18:40:34 +0000 (18:40 +0000)]
Initialize/Register LTO passes to enable flags like -print-after=<lto-pass>

There already have two "dead" functions, initialize{IPO|IPA}, defined for
similar purpose. I decide not to call these two functions for two reasons:
  o. they don't cover all LTO passes (which will soon be separated into IPO
     and post-IPO passes)
  o. We have not yet figured out the right passes and the ordering for IPO
     and post-IPO stages, meaning this change is only for the time being.

Since LTO passes are registered, we are now able to print IR before and
after particular point.

For OSX users:
--------------
  "...-Wl,-mllvm -Wl,-print-after=<pass-name>" will print IR after the
  specified pass.

For Other UNIX with GNU gold linker:
------------------------------------
  "-Wl,-plugin-opt=-print-after=<pass-name>" should work.
  (NOTE: no need for "-Wl,-mllvm")

  Strip "-Wl," if flags are fed directly to linker instead of clang/clang++.

llvm-svn: 186853

11 years agoFix typo.
Eric Christopher [Mon, 22 Jul 2013 18:26:18 +0000 (18:26 +0000)]
Fix typo.

llvm-svn: 186852

11 years agoFormatting.
Eric Christopher [Mon, 22 Jul 2013 18:26:15 +0000 (18:26 +0000)]
Formatting.

llvm-svn: 186851

11 years ago[arcmt] Only disable ARC in the second compilation if there were actually ARC errors...
Argyrios Kyrtzidis [Mon, 22 Jul 2013 18:13:54 +0000 (18:13 +0000)]
[arcmt] Only disable ARC in the second compilation if there were actually ARC errors in the checking phase.

rdar://14490204

llvm-svn: 186850

11 years agoAdd testcase for PR16134, which no longer crashes with ToT.
Richard Smith [Mon, 22 Jul 2013 18:09:32 +0000 (18:09 +0000)]
Add testcase for PR16134, which no longer crashes with ToT.

llvm-svn: 186849

11 years agoUpdate comment to refer to core issue number.
Richard Smith [Mon, 22 Jul 2013 18:06:23 +0000 (18:06 +0000)]
Update comment to refer to core issue number.

llvm-svn: 186848

11 years agoThis test was missing its -verify argument.
Aaron Ballman [Mon, 22 Jul 2013 17:55:04 +0000 (17:55 +0000)]
This test was missing its -verify argument.

llvm-svn: 186847

11 years agoMC: mayAffectControlFlow() handling for variadic instructions.
Jim Grosbach [Mon, 22 Jul 2013 17:45:55 +0000 (17:45 +0000)]
MC: mayAffectControlFlow() handling for variadic instructions.

Variadic MC instructions don't note whether the variable operands
are uses or defs, so mayAffectControlFlow() must conservatively
assume they are defs and return true if the PC is in the operand
list.

rdar://14488628

llvm-svn: 186846

11 years agoFix an obvious typo in the loop vectorizer where the cost model uses the wrong variab...
Nadav Rotem [Mon, 22 Jul 2013 17:10:48 +0000 (17:10 +0000)]
Fix an obvious typo in the loop vectorizer where the cost model uses the wrong variable. The variable BlockCost is ignored.
We don't have tests for the effect of if-conversion loops because it requires a big test (that includes if-converted loops) and it is difficult to find and balance a loop to do the right thing.

llvm-svn: 186845

11 years ago[NVPTX] Remove unused prototypes
Justin Holewinski [Mon, 22 Jul 2013 17:04:40 +0000 (17:04 +0000)]
[NVPTX] Remove unused prototypes

llvm-svn: 186844

11 years agoRename ReaderCOFF members to follow the LLD coding style.
Rui Ueyama [Mon, 22 Jul 2013 16:56:34 +0000 (16:56 +0000)]
Rename ReaderCOFF members to follow the LLD coding style.

llvm-svn: 186843

11 years agocpp11-migrate: Make a VirtualFilesHelper class for the unit tests.
Edwin Vane [Mon, 22 Jul 2013 16:36:58 +0000 (16:36 +0000)]
cpp11-migrate: Make a VirtualFilesHelper class for the unit tests.

This change makes it easier for new unit tests to create virtual files.

Author: Guillaume Papin <guillaume.papin@epitech.eu>
llvm-svn: 186842

11 years agoFix bug in clang-format's vim integration cause by r186789.
Daniel Jasper [Mon, 22 Jul 2013 16:22:13 +0000 (16:22 +0000)]
Fix bug in clang-format's vim integration cause by r186789.

After the first operation, the buffer contents has changed and thus all
other operations would be invalid. Executing the operations in reversed
order should fix this.

llvm-svn: 186840

11 years agoOption parsing: allow aliases in groups
Hans Wennborg [Mon, 22 Jul 2013 16:18:13 +0000 (16:18 +0000)]
Option parsing: allow aliases in groups

Option aliases in option groups were previously disallowed by an assert.
As far as I can tell, there was no technical reason for this, and I would
like to be able to put cl.exe compatible options in their own group for Clang,
so let's change the assert.

llvm-svn: 186838

11 years ago[sanitizer] Change strip_path_prefix flag behavior.
Sergey Matveev [Mon, 22 Jul 2013 16:14:38 +0000 (16:14 +0000)]
[sanitizer] Change strip_path_prefix flag behavior.

Previously (in tools other than TSan) the entire prefix of the path had to mach
the argument. With this change, only some suffix of the prefix has to match.
This is the same way this flag works in TSan.

llvm-svn: 186837

11 years agoAdd support for overloaded matchers. ie different matcher function signatures with...
Samuel Benzaquen [Mon, 22 Jul 2013 16:13:57 +0000 (16:13 +0000)]
Add support for overloaded matchers. ie different matcher function signatures with the same name.

Summary:
Add support for overloaded matchers.
This composes with other features, like supporting polymorphic matchers.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1188

llvm-svn: 186836

11 years agoMake tuple's constructor and std::get<>(tuple) constexpr. Final stage of fixing bug...
Marshall Clow [Mon, 22 Jul 2013 16:02:19 +0000 (16:02 +0000)]
Make tuple's constructor and std::get<>(tuple) constexpr. Final stage of fixing bug #16599. Thanks to Howard for the review and updates.

llvm-svn: 186834

11 years agoc-index-test.c: Let this C89-compliant since r186817.
NAKAMURA Takumi [Mon, 22 Jul 2013 15:59:52 +0000 (15:59 +0000)]
c-index-test.c: Let this C89-compliant since r186817.

  warning: initializer for aggregate is not a compile-time constant [-Wc99-extensions]

llvm-svn: 186833

11 years agoThis adds range checking for "ldr Rn, [pc, #imm]" Thumb
Mihai Popa [Mon, 22 Jul 2013 15:49:36 +0000 (15:49 +0000)]
This adds range checking for "ldr Rn, [pc, #imm]" Thumb
instructions. With this patch:

1. ldr.n is recognized as mnemonic for the short encoding
2. ldr.w is recognized as menmonic for the long encoding
3. ldr will map to either short or long encodings depending on the size of the offset

llvm-svn: 186831

11 years agoReplace archive members in the old position.
Rafael Espindola [Mon, 22 Jul 2013 15:11:51 +0000 (15:11 +0000)]
Replace archive members in the old position.

This matches gnu archive behavior and since archive member order can change
which member is used, not changing the order on replacement looks like the
right thing to do.

This patch also refactors the logic for which archive member to keep and
whether to move it to a helper function (computeInsertAction). The
nesting in computeNewArchiveMembers was getting a bit confusing.

llvm-svn: 186829

11 years ago[ms-cxxabi] Emit linkonce complete dtors in TUs that need them
Reid Kleckner [Mon, 22 Jul 2013 13:51:44 +0000 (13:51 +0000)]
[ms-cxxabi] Emit linkonce complete dtors in TUs that need them

Based on Peter Collingbourne's destructor patches.

Prior to this change, clang was considering ?1 to be the complete
destructor and the base destructor, which was wrong.  This lead to
crashes when clang tried to emit two LLVM functions with the same name.

In this ABI, TUs with non-inline dtors might not emit a complete
destructor.  They are emitted as inline thunks in TUs that need them,
and they always delegate to the base dtors of the complete class and its
virtual bases.  This change uses the DeferredDecls machinery to emit
complete dtors as needed.

Currently in clang try body destructors can catch exceptions thrown by
virtual base destructors.  In the Microsoft C++ ABI, clang may not have
the destructor definition, in which case clang won't wrap the virtual
virtual base destructor calls in a try-catch.  Diagnosing this in user
code is TODO.

Finally, for classes that don't use virtual inheritance, MSVC always
calls the base destructor (?1) directly.  This is a useful code size
optimization that avoids emitting lots of extra thunks or aliases.
Implementing it also means our existing tests continue to pass, and is
consistent with MSVC's output.

We can do the same for Itanium by tweaking GetAddrOfCXXDestructor, but
it will require further testing.

Reviewers: rjmccall

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1066

llvm-svn: 186828

11 years agoRename D to GD to match the type, which is GlobalDecl
Reid Kleckner [Mon, 22 Jul 2013 13:07:10 +0000 (13:07 +0000)]
Rename D to GD to match the type, which is GlobalDecl

Now we can save GD.getDecl() in D and shorten some casts.

llvm-svn: 186826

11 years agoInstall git-clang-format along with clang-format by default.
Daniel Jasper [Mon, 22 Jul 2013 12:51:47 +0000 (12:51 +0000)]
Install git-clang-format along with clang-format by default.

llvm-svn: 186825

11 years agoForward declare OMPClause in Sema.h to avoid an include
Reid Kleckner [Mon, 22 Jul 2013 12:47:44 +0000 (12:47 +0000)]
Forward declare OMPClause in Sema.h to avoid an include

llvm-svn: 186824

11 years agoDon't depend on a llvm-ar specific behavior.
Rafael Espindola [Mon, 22 Jul 2013 12:41:04 +0000 (12:41 +0000)]
Don't depend on a llvm-ar specific behavior.

GNU ar when not given the a or b modifiers replaces archive members in the
same location of the old ones. I am about to implement that in llvm-ar. For
now, just don't depend on the current llvm-ar behavior on this test.

llvm-svn: 186823

11 years agoFactor out common string match code for POSIX log enable/disable
Ed Maste [Mon, 22 Jul 2013 12:39:17 +0000 (12:39 +0000)]
Factor out common string match code for POSIX log enable/disable

llvm-svn: 186822

11 years ago[lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.
Sergey Matveev [Mon, 22 Jul 2013 12:38:17 +0000 (12:38 +0000)]
[lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.

Also move detect_leaks to common flags.

llvm-svn: 186821

11 years ago[NVPTX] Use approximate FP ops when unsafe-fp-math is used, and append
Justin Holewinski [Mon, 22 Jul 2013 12:18:04 +0000 (12:18 +0000)]
[NVPTX] Use approximate FP ops when unsafe-fp-math is used, and append
.ftz to instructions if the nvptx-f32ftz attribute is set to "true"

llvm-svn: 186820

11 years ago[lsan] Print direct leaks first.
Sergey Matveev [Mon, 22 Jul 2013 11:18:32 +0000 (11:18 +0000)]
[lsan] Print direct leaks first.

Direct leaks are higher priority, so it makes sense to have them on top.

llvm-svn: 186819

11 years agoRevert "More Intel syntax alias fixes."
Tim Northover [Mon, 22 Jul 2013 11:02:32 +0000 (11:02 +0000)]
Revert "More Intel syntax alias fixes."

This reverts commit r186813, which broke the bots.

llvm-svn: 186818

11 years agoImplement the part of C89 6.5.7 p3 requiring a constant initializer list
Enea Zaffanella [Mon, 22 Jul 2013 10:58:26 +0000 (10:58 +0000)]
Implement the part of C89 6.5.7 p3 requiring a constant initializer list
when initializing aggregate/union types, no matter if static or not.

llvm-svn: 186817

11 years agoImprove clarity/consistency of a few UsingDecl methods and related helpers.
Enea Zaffanella [Mon, 22 Jul 2013 10:54:09 +0000 (10:54 +0000)]
Improve clarity/consistency of a few UsingDecl methods and related helpers.
No functionality change.

In Sema helper functions:
 * renamed isTypeName as HasTypenameKeyword
In UsingDecl:
 * renamed get/setUsingLocation to get/setUsingLoc
 * renamed is/setTypeName as has/setTypename

llvm-svn: 186816

11 years agoFix typo. Change %cl to CL in Intel pattern.
Craig Topper [Mon, 22 Jul 2013 10:07:26 +0000 (10:07 +0000)]
Fix typo. Change %cl to CL in Intel pattern.

llvm-svn: 186815

11 years agoMore Intel syntax alias fixes.
Craig Topper [Mon, 22 Jul 2013 09:58:07 +0000 (09:58 +0000)]
More Intel syntax alias fixes.

llvm-svn: 186814

11 years agoMore Intel syntax alias fixes.
Craig Topper [Mon, 22 Jul 2013 09:42:31 +0000 (09:42 +0000)]
More Intel syntax alias fixes.

llvm-svn: 186813

11 years agoChange %xmm0 to XMM0 in Intel side of asm strings for PBLENDVB.
Craig Topper [Mon, 22 Jul 2013 09:22:49 +0000 (09:22 +0000)]
Change %xmm0 to XMM0 in Intel side of asm strings for PBLENDVB.

llvm-svn: 186812

11 years agoAdd Intel variants to aliases for some FP instructions.
Craig Topper [Mon, 22 Jul 2013 09:18:43 +0000 (09:18 +0000)]
Add Intel variants to aliases for some FP instructions.

llvm-svn: 186811

11 years agoARM: remove now unneeded custom Asm converters
Tim Northover [Mon, 22 Jul 2013 09:06:12 +0000 (09:06 +0000)]
ARM: remove now unneeded custom Asm converters

After Ulrich's r180677 (thanks!) TableGen is intelligent enough to
handle tied constraints involving complex operands properly, so
virtually all of the ARM custom converters are now unnecessary.

llvm-svn: 186810

11 years agoReverse operands for Intel syntax form of 'bt' alias.
Craig Topper [Mon, 22 Jul 2013 07:47:51 +0000 (07:47 +0000)]
Reverse operands for Intel syntax form of 'bt' alias.

llvm-svn: 186809

11 years agoDelete unused helper functions.
Nadav Rotem [Mon, 22 Jul 2013 05:19:22 +0000 (05:19 +0000)]
Delete unused helper functions.

llvm-svn: 186808

11 years agoRemove superfluous cast.
Robert Wilhelm [Mon, 22 Jul 2013 05:04:01 +0000 (05:04 +0000)]
Remove superfluous cast.

llvm-svn: 186807

11 years agoRegisterPass: Unhide -polly-show and -polly-show-only
Tobias Grosser [Mon, 22 Jul 2013 04:11:00 +0000 (04:11 +0000)]
RegisterPass: Unhide -polly-show and -polly-show-only

llvm-svn: 186806

11 years agoScopDetect: move "return false" out of INVALID macro.
Tobias Grosser [Mon, 22 Jul 2013 03:50:33 +0000 (03:50 +0000)]
ScopDetect: move "return false" out of INVALID macro.

Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 186805

11 years agoPR16288: A template is only missing a default template argument if it provides
Richard Smith [Mon, 22 Jul 2013 03:31:14 +0000 (03:31 +0000)]
PR16288: A template is only missing a default template argument if it provides
any default template arguments, not if it inherits some.

llvm-svn: 186804

11 years agoImplement DR257 / fix PR16659:
Richard Smith [Mon, 22 Jul 2013 02:56:56 +0000 (02:56 +0000)]
Implement DR257 / fix PR16659:
  A constructor for an abstract class does not call constructors for virtual
  base classes, so it is not an error if no initializer is present for the
  virtual base and the virtual base cannot be default initialized.

Also provide a (disabled by default, for now) warning for the case where a
virtual base class's initializer is ignored in an abstract class's constructor,
and address a defect in DR257 where it was not carried through to C++11's rules
for implicit deletion of special member functions.

Based on a patch by Maurice Bos.

llvm-svn: 186803

11 years agoSemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. [-Wdocumentation]
NAKAMURA Takumi [Mon, 22 Jul 2013 01:27:42 +0000 (01:27 +0000)]
SemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. [-Wdocumentation]

llvm-svn: 186802

11 years agoAdded missing - in the header of PrologEpilogInserter.h so that editors properly...
Michael Gottesman [Mon, 22 Jul 2013 00:52:55 +0000 (00:52 +0000)]
Added missing - in the header of PrologEpilogInserter.h so that editors properly realize it is a c++ header and not a c header.

llvm-svn: 186801