platform/upstream/llvm.git
11 years agoatomic_bool was missing (just a typedef to atomic<bool>).
Howard Hinnant [Fri, 4 Jan 2013 18:58:50 +0000 (18:58 +0000)]
atomic_bool was missing (just a typedef to atomic<bool>).

llvm-svn: 171498

11 years agoAdd the module name to the 'incomplete umbrella header' warning.
Douglas Gregor [Fri, 4 Jan 2013 18:58:28 +0000 (18:58 +0000)]
Add the module name to the 'incomplete umbrella header' warning.

llvm-svn: 171497

11 years agoAdd Textmate bundle for Tablegen syntax-highlighting
Joel Jones [Fri, 4 Jan 2013 18:55:24 +0000 (18:55 +0000)]
Add Textmate bundle for Tablegen syntax-highlighting

llvm-svn: 171496

11 years agoLet the formatter ignore UnwrappedLines containing errors.
Daniel Jasper [Fri, 4 Jan 2013 18:52:56 +0000 (18:52 +0000)]
Let the formatter ignore UnwrappedLines containing errors.

This prevents code like:

namespace {
class Foo {
  Foo(
  };
}  // comment

from causing segfaults (see llvm.org/PR14774).

llvm-svn: 171495

11 years agoAdd file added in r171484 to CMakelists.txt.
Filipe Cabecinhas [Fri, 4 Jan 2013 18:52:29 +0000 (18:52 +0000)]
Add file added in r171484 to CMakelists.txt.

llvm-svn: 171494

11 years agoDebug Info: fix the line location for cleanup code of a block function
Manman Ren [Fri, 4 Jan 2013 18:51:35 +0000 (18:51 +0000)]
Debug Info: fix the line location for cleanup code of a block function

The line information was changed when emitting debug information for all the
DeclRefExprs and we should change it back to get ready for PopClenupBlocks
called from FinishFunction.

rdar://11562117

llvm-svn: 171493

11 years agoFix up various builtin declaration of objc_msgSend families
Fariborz Jahanian [Fri, 4 Jan 2013 18:45:40 +0000 (18:45 +0000)]
Fix up various builtin declaration of objc_msgSend families
to match those foung in objc.h an avoid spurious warnings.
// rdar://12489098

llvm-svn: 171492

11 years agoChange the default number of registers to prevent unrolling on targets that dont...
Nadav Rotem [Fri, 4 Jan 2013 18:40:39 +0000 (18:40 +0000)]
Change the default number of registers to prevent unrolling on targets that dont have this hook.

llvm-svn: 171489

11 years agoAdd a space to the end of the line so we don't get "itsbounds" in output.
Eric Christopher [Fri, 4 Jan 2013 18:30:36 +0000 (18:30 +0000)]
Add a space to the end of the line so we don't get "itsbounds" in output.

llvm-svn: 171487

11 years ago[libclang] Introduce clang_getFileLocation.
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:13 +0000 (18:30 +0000)]
[libclang] Introduce clang_getFileLocation.

Uses of clang_getSpellingLocation should eventually move to calling
clang_getFileLocation, and clang_getSpellingLocation should do what
its name represents and actually point at the 'spelling' location, e.g.
inside a macro definition if the spelling of a token came from that.

llvm-svn: 171486

11 years ago[arcmt] Allow removing an -autorelease of a variable initialized in the previous...
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:11 +0000 (18:30 +0000)]
[arcmt] Allow removing an -autorelease of a variable initialized in the previous statement.

rdar://11074996

llvm-svn: 171485

11 years ago[arcmt] Adds brackets in case statements that "contain" initialization of retaining
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:08 +0000 (18:30 +0000)]
[arcmt] Adds brackets in case statements that "contain" initialization of retaining
variable, thus emitting the "switch case is in protected scope" error.

rdar://12952016

llvm-svn: 171484

11 years agoMove the common source locations of CastStmt & DefaultStmt into their base class...
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:04 +0000 (18:30 +0000)]
Move the common source locations of CastStmt & DefaultStmt into their base class, SwitchCase.

llvm-svn: 171483

11 years ago[arcmt] Don't error if an autoreleased variable is returned after the -autorelease.
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:29:59 +0000 (18:29 +0000)]
[arcmt] Don't error if an autoreleased variable is returned after the -autorelease.

rdar://12952025

llvm-svn: 171482

11 years agoPort loop-convert into cpp11-migrate
Edwin Vane [Fri, 4 Jan 2013 18:25:18 +0000 (18:25 +0000)]
Port loop-convert into cpp11-migrate

Took existing code from loop-convert tool and made it into a cpp11-migrate
transform. Pattern now set for having transform code in subdirectories. Related
changes:
- Makefile and CMakeLists.txt updated to support source files in
  subdirectories.
- At least one transform must be specified. syntax-only tests removed to
  reflect this.
- TODO: port over loop-convert tests.

Reviewers: klimek, silvas
llvm-svn: 171481

11 years agoHandle segfaults in clang-format vim-integration.
Daniel Jasper [Fri, 4 Jan 2013 18:24:12 +0000 (18:24 +0000)]
Handle segfaults in clang-format vim-integration.

A segfault used to clear the entire buffer. With this change, a message
to report a bug is displayed instead.

This should solve most cases similar to llvm.org/PR14774.

llvm-svn: 171480

11 years ago...and then there was one. Only one copy of 'iterators.h' in the test tree for libc++
Marshall Clow [Fri, 4 Jan 2013 18:24:04 +0000 (18:24 +0000)]
...and then there was one. Only one copy of 'iterators.h' in the test tree for libc++

llvm-svn: 171479

11 years agoRemove -Wmodule-build; it was a dumb idea anyway. <rdar://problem/12957525>
Douglas Gregor [Fri, 4 Jan 2013 18:22:19 +0000 (18:22 +0000)]
Remove -Wmodule-build; it was a dumb idea anyway. <rdar://problem/12957525>

llvm-svn: 171478

11 years agoAdded a page that describes how to to manual symbolication with LLDB from the command...
Greg Clayton [Fri, 4 Jan 2013 18:18:21 +0000 (18:18 +0000)]
Added a page that describes how to to manual symbolication with LLDB from the command line, from python, and also how to use the build in modules to do symbolication.

llvm-svn: 171477

11 years ago<rdar://problem/12928282>
Greg Clayton [Fri, 4 Jan 2013 18:10:18 +0000 (18:10 +0000)]
<rdar://problem/12928282>

Added SBTarget::EvaluateExpression() so expressions can be evaluated without needing a process.

Also fixed many functions that deal with clang AST types to be able to properly handle the clang::Type::Elaborated types ("struct foo", "class bar").

llvm-svn: 171476

11 years agosmall fixes to enable the reuse of the pass manager across multiple modules
Pedro Artigas [Fri, 4 Jan 2013 18:04:42 +0000 (18:04 +0000)]
small fixes to enable the reuse of the pass manager across multiple modules

llvm-svn: 171475

11 years agoAdd section information for the DWARF5 split debug proposal
Eric Christopher [Fri, 4 Jan 2013 17:59:22 +0000 (17:59 +0000)]
Add section information for the DWARF5 split debug proposal
string offset section.

llvm-svn: 171474

11 years agoMake comment a bit more clear.
Eric Christopher [Fri, 4 Jan 2013 17:59:17 +0000 (17:59 +0000)]
Make comment a bit more clear.

llvm-svn: 171473

11 years agoFix fieldNo usage for lambdas. No behavior change since the
Eric Christopher [Fri, 4 Jan 2013 17:59:07 +0000 (17:59 +0000)]
Fix fieldNo usage for lambdas. No behavior change since the
field number was 0 anyhow.

llvm-svn: 171472

11 years agoMove the loop vectorizer from O2 to O3. It looks like the increase in code size actua...
Nadav Rotem [Fri, 4 Jan 2013 17:57:44 +0000 (17:57 +0000)]
Move the loop vectorizer from O2 to O3. It looks like the increase in code size actually hurts the performance on many programs.

llvm-svn: 171471

11 years agoUpdate the docs about the new unroll features.
Nadav Rotem [Fri, 4 Jan 2013 17:49:45 +0000 (17:49 +0000)]
Update the docs about the new unroll features.

llvm-svn: 171470

11 years agoLoopVectorizer:
Nadav Rotem [Fri, 4 Jan 2013 17:48:25 +0000 (17:48 +0000)]
LoopVectorizer:

1. Add code to estimate register pressure.
2. Add code to select the unroll factor based on register pressure.
3. Add bits to TargetTransformInfo to provide the number of registers.

llvm-svn: 171469

11 years agoRevert revision: 171467. This transformation is incorrect and makes some tests fail...
Nadav Rotem [Fri, 4 Jan 2013 17:35:21 +0000 (17:35 +0000)]
Revert revision: 171467. This transformation is incorrect and makes some tests fail. Original message:

Simplified TRUNCATE operation that comes after SETCC. It is possible since SETCC result is 0 or -1.
Added a test.

llvm-svn: 171468

11 years agoSimplified TRUNCATE operation that comes after SETCC. It is possible since SETCC...
Elena Demikhovsky [Thu, 3 Jan 2013 08:48:33 +0000 (08:48 +0000)]
Simplified TRUNCATE operation that comes after SETCC. It is possible since SETCC result is 0 or -1.
Added a test.

llvm-svn: 171467

11 years agoRevert "Mark DIV/IDIV instructions hasSideEffects=1 because they can trap when dividi...
Michael Gottesman [Thu, 3 Jan 2013 08:18:30 +0000 (08:18 +0000)]
Revert "Mark DIV/IDIV instructions hasSideEffects=1 because they can trap when dividing by 0. This is needed to keep early if conversion from moving them across basic blocks."

This reverts commit r171461 since it breaks the following tests:

Clang :: Analysis/outofbound-notwork.c
Clang :: Analysis/string-fail.c
Clang :: CXX/basic/basic.lookup/basic.lookup.qual/p6-0x.cpp
Clang :: CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp
Clang :: CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp
Clang :: CXX/dcl.dcl/dcl.spec/dcl.stc/p10.cpp
Clang :: CXX/temp/temp.param/p14.cpp
Clang :: CXX/temp/temp.res/temp.dep.res/temp.point/p1.cpp
Clang :: CodeGen/2009-02-13-zerosize-union-field-ppc.c
Clang :: CodeGen/blocks-2.c
Clang :: CodeGen/libcalls-d.c
Clang :: CodeGen/libcalls-ld.c
Clang :: CodeGenCXX/conversion-function.cpp
Clang :: CodeGenCXX/debug-info-limit-type.cpp
Clang :: CodeGenCXX/inheriting-constructor.cpp
Clang :: FixIt/fixit-errors.c
Clang :: FixIt/fixit-pmem.cpp
Clang :: Modules/namespaces.cpp
Clang :: PCH/changed-files.c
Clang :: PCH/pr4489.c
Clang :: PCH/source-manager-stack.c
Clang :: Parser/cxx-ambig-decl-expr-xfail.cpp
Clang :: SemaCXX/switch-implicit-fallthrough-cxx98.cpp
Clang :: SemaTemplate/instantiate-function-1.mm

llvm-svn: 171466

11 years agoChanged two debug statements that state that a queue had finished being processed...
Michael Gottesman [Thu, 3 Jan 2013 08:09:27 +0000 (08:09 +0000)]
Changed two debug statements that state that a queue had finished being processed when said queue was really a list to state a list had finished being processed.

llvm-svn: 171465

11 years agoAdded DEBUG message for ObjCARC when we zap a push/pop pair in ObjCARCAPElim::OptimizeBB.
Michael Gottesman [Thu, 3 Jan 2013 08:09:17 +0000 (08:09 +0000)]
Added DEBUG message for ObjCARC when we zap a push/pop pair in ObjCARCAPElim::OptimizeBB.

llvm-svn: 171464

11 years agoAdded DEBUG message to ObjCARC when we transform objc_initWeak(p, null) => *p = null.
Michael Gottesman [Thu, 3 Jan 2013 07:32:53 +0000 (07:32 +0000)]
Added DEBUG message to ObjCARC when we transform objc_initWeak(p, null) => *p = null.

llvm-svn: 171463

11 years agoAdded DEBUG message for ObjCARC when an inline asm marker is inserted for architectur...
Michael Gottesman [Thu, 3 Jan 2013 07:32:41 +0000 (07:32 +0000)]
Added DEBUG message for ObjCARC when an inline asm marker is inserted for architectures where this is required to perform a retainAutoreleasedReturnValue optimization.

llvm-svn: 171462

11 years agoMark DIV/IDIV instructions hasSideEffects=1 because they can trap when dividing by...
Craig Topper [Thu, 3 Jan 2013 06:40:20 +0000 (06:40 +0000)]
Mark DIV/IDIV instructions hasSideEffects=1 because they can trap when dividing by 0. This is needed to keep early if conversion from moving them across basic blocks.

llvm-svn: 171461

11 years agoBetter comment on VTTI::getShuffleCost
Hal Finkel [Thu, 3 Jan 2013 05:02:41 +0000 (05:02 +0000)]
Better comment on VTTI::getShuffleCost

llvm-svn: 171459

11 years agoWarn on unused auto variables.
Rafael Espindola [Thu, 3 Jan 2013 04:29:20 +0000 (04:29 +0000)]
Warn on unused auto variables.

To do so we have to wait until we know that the type of a variable has been
deduced. Sema::FinalizeDeclaration is the first callback that is used for
decl with or without initializers.

llvm-svn: 171458

11 years agoUse early returns to reduce indentation.
Rafael Espindola [Thu, 3 Jan 2013 04:05:19 +0000 (04:05 +0000)]
Use early returns to reduce indentation.

llvm-svn: 171457

11 years agoRemoved another copy of 'iterators.h' files in libcxx/test
Marshall Clow [Thu, 3 Jan 2013 03:57:56 +0000 (03:57 +0000)]
Removed another copy of  'iterators.h' files in libcxx/test

llvm-svn: 171456

11 years agoCompiler.h: Leave LLVM_BUILTIN_UNREACHABLE undefined if it is unavailable in host...
NAKAMURA Takumi [Thu, 3 Jan 2013 03:30:22 +0000 (03:30 +0000)]
Compiler.h: Leave LLVM_BUILTIN_UNREACHABLE undefined if it is unavailable in host compiler.

Users of LLVM_BUILTIN_UNREACHABLE should be responsible in the case when LLVM_BUILTIN_UNREACHABLE is undefined.

Actually, (0, (p)) in LLVM_ASSUME_ALIGNED(p, a) caused thousands of warnings on g++-4.4. It was a motivation in this commit.

llvm-svn: 171455

11 years ago[arcmt] Rewrite uses of Block_copy/Block_release macros.
Argyrios Kyrtzidis [Thu, 3 Jan 2013 03:17:17 +0000 (03:17 +0000)]
[arcmt] Rewrite uses of Block_copy/Block_release macros.

  c = Block_copy(b);
  Block_release(c);
 ---->
  c = [b copy];
  <removed>

rdar://9408211

llvm-svn: 171454

11 years agoAdd a subtype parameter to VTTI::getShuffleCost
Hal Finkel [Thu, 3 Jan 2013 02:34:09 +0000 (02:34 +0000)]
Add a subtype parameter to VTTI::getShuffleCost

In order to cost subvector insertion and extraction, we need to know
the type of the subvector being extracted.

No functionality change.

llvm-svn: 171453

11 years agoRemoved several more different 'iterators.h' files in libcxx/test
Marshall Clow [Thu, 3 Jan 2013 02:29:29 +0000 (02:29 +0000)]
Removed several more different 'iterators.h' files in libcxx/test

llvm-svn: 171452

11 years agoAdd .arcconfig for Phabricator command-line support
Alex Rosenberg [Thu, 3 Jan 2013 02:15:37 +0000 (02:15 +0000)]
Add .arcconfig for Phabricator command-line support

llvm-svn: 171451

11 years agoRevert everything to r171366 to try to fix the build.
Bill Wendling [Thu, 3 Jan 2013 02:01:50 +0000 (02:01 +0000)]
Revert everything to r171366 to try to fix the build.

llvm-svn: 171450

11 years agoReformat the rst text.
Nadav Rotem [Thu, 3 Jan 2013 01:56:33 +0000 (01:56 +0000)]
Reformat the rst text.

llvm-svn: 171449

11 years agoTry again to revert the bad patch. The tree was reverted for some unknown reason
Bill Wendling [Thu, 3 Jan 2013 01:54:39 +0000 (01:54 +0000)]
Try again to revert the bad patch. The tree was reverted for some unknown reason
before the last time.

--- Reverse-merging r171442 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Attributes.cpp
U    lib/IR/AttributeImpl.h

llvm-svn: 171448

11 years agoAdd a default Index for VTTI::getShuffleCost
Hal Finkel [Thu, 3 Jan 2013 01:50:51 +0000 (01:50 +0000)]
Add a default Index for VTTI::getShuffleCost

When Kind == (Broadcast or Reverse) then Index is not used; make it an optional parameter.

No functionality change.

llvm-svn: 171447

11 years agoLoopVectorizer: Test the unrolling flag.
Nadav Rotem [Thu, 3 Jan 2013 01:47:31 +0000 (01:47 +0000)]
LoopVectorizer: Test the unrolling flag.

llvm-svn: 171446

11 years agoLoopVectorizer: Document the unrolling feature.
Nadav Rotem [Thu, 3 Jan 2013 01:47:02 +0000 (01:47 +0000)]
LoopVectorizer: Document the unrolling feature.

llvm-svn: 171445

11 years agoRevert patch. Something snuck in there that shouldn't be.
Bill Wendling [Thu, 3 Jan 2013 01:46:27 +0000 (01:46 +0000)]
Revert patch. Something snuck in there that shouldn't be.

--- Reverse-merging r171441 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Attributes.cpp

llvm-svn: 171444

11 years agoRemoved 7 (of 8) different 'iterators.h' files in test/localization
Marshall Clow [Thu, 3 Jan 2013 01:45:09 +0000 (01:45 +0000)]
Removed 7 (of 8) different 'iterators.h' files in test/localization

llvm-svn: 171443

11 years agoRemove the 'contains' methods in favor of the 'operator==' method.
Bill Wendling [Thu, 3 Jan 2013 01:43:05 +0000 (01:43 +0000)]
Remove the 'contains' methods in favor of the 'operator==' method.

The 'operator==' method is a bit clearer and much less verbose for somethings
that should have only one value. Remove from the AttrBuilder for consistency.

llvm-svn: 171442

11 years agoRevert r171427, "An intermediate step in the Attributes rewrite."
NAKAMURA Takumi [Thu, 3 Jan 2013 01:42:06 +0000 (01:42 +0000)]
Revert r171427, "An intermediate step in the Attributes rewrite."

llvm-svn: 171441

11 years agoFix capitalization of Objective-C in diagnostic.
Ted Kremenek [Thu, 3 Jan 2013 01:30:20 +0000 (01:30 +0000)]
Fix capitalization of Objective-C in diagnostic.

llvm-svn: 171440

11 years agoMake MallocChecker debug output useful.
Ted Kremenek [Thu, 3 Jan 2013 01:30:12 +0000 (01:30 +0000)]
Make MallocChecker debug output useful.

llvm-svn: 171439

11 years ago[Object] Temporarily disable these tests.
Michael J. Spencer [Thu, 3 Jan 2013 01:24:32 +0000 (01:24 +0000)]
[Object] Temporarily disable these tests.

They are failing because archives create unaligned ELF files. The recent
Endian change added a __builtin_unreachable() when this happens. I will be
committing a fix for this soon.

llvm-svn: 171438

11 years ago[MC][COFF] Switch the COFF streamer over to using the MCObjectStreamer version of...
Michael J. Spencer [Thu, 3 Jan 2013 01:09:22 +0000 (01:09 +0000)]
[MC][COFF] Switch the COFF streamer over to using the MCObjectStreamer version of EmitInstruction.

llvm-svn: 171437

11 years agoLoopVectorizer: Add support for loop-unrolling during vectorization for increasing...
Nadav Rotem [Thu, 3 Jan 2013 00:52:27 +0000 (00:52 +0000)]
LoopVectorizer: Add support for loop-unrolling during vectorization for increasing the ILP. At the moment this feature is disabled by default and this commit should not cause any functional changes.

llvm-svn: 171436

11 years agoFix PR14732 by handling all kinds of IMPLICIT_DEF live ranges.
Jakob Stoklund Olesen [Thu, 3 Jan 2013 00:47:51 +0000 (00:47 +0000)]
Fix PR14732 by handling all kinds of IMPLICIT_DEF live ranges.

Most IMPLICIT_DEF instructions are removed by the ProcessImplicitDefs
pass, and a few are reinserted by PHIElimination when a PHI argument is
<undef>.

RegisterCoalescer was assuming that all IMPLICIT_DEF live ranges look
like those created by PHIElimination, and that their live range never
leaves the basic block.

The PR14732 test case does tricks with PHI nodes that causes a longer
IMPLICIT_DEF live range to appear. This happens very rarely, but
RegisterCoalescer should be able to handle it.

llvm-svn: 171435

11 years agoMake the type signature more strict.
Bill Wendling [Thu, 3 Jan 2013 00:46:43 +0000 (00:46 +0000)]
Make the type signature more strict.

llvm-svn: 171434

11 years agoDon't assert/crash on reference variables in lambdas bound to a
Eli Friedman [Thu, 3 Jan 2013 00:39:26 +0000 (00:39 +0000)]
Don't assert/crash on reference variables in lambdas bound to a
static local variable from the parent scope.  PR14773.

llvm-svn: 171433

11 years ago[analyzer] Rename callback EndPath -> EndFunction
Anna Zaks [Thu, 3 Jan 2013 00:25:29 +0000 (00:25 +0000)]
[analyzer] Rename callback EndPath -> EndFunction

This better reflects when callback is called and what the checkers
are relying on. (Both names meant the same pre-IPA.)

llvm-svn: 171432

11 years agoClang sometimes emits "objc_object*" rather than "id"
Sean Callanan [Thu, 3 Jan 2013 00:05:56 +0000 (00:05 +0000)]
Clang sometimes emits "objc_object*" rather than "id"
for id types with protocols on them.  We detect this
and report "id" instead.

Also added a testcase.

<rdar://problem/12595644>

llvm-svn: 171431

11 years ago[CMake] MSVC is incorrectly emitting C4239 in some cases. Disable it.
Michael J. Spencer [Thu, 3 Jan 2013 00:00:40 +0000 (00:00 +0000)]
[CMake] MSVC is incorrectly emitting C4239 in some cases. Disable it.

llvm-svn: 171430

11 years agoAvoid vectorization when the function has the "noimplicitflot" attribute.
Nadav Rotem [Wed, 2 Jan 2013 23:54:43 +0000 (23:54 +0000)]
Avoid vectorization when the function has the "noimplicitflot" attribute.

llvm-svn: 171429

11 years agoExtend the dumping infrastructure to deal with additional
Eric Christopher [Wed, 2 Jan 2013 23:52:13 +0000 (23:52 +0000)]
Extend the dumping infrastructure to deal with additional
sections for debug info. These are some of the dwo sections from the
DWARF5 split debug info proposal. Update the fission-cu.ll testcase
to show what we should be able to dump more of now.

Work in progress: Ultimately the relocations will be gone for the
dwo section and the strings will be a different form (as well as
the rest of the sections will be included).

llvm-svn: 171428

11 years agoAn intermediate step in the Attributes rewrite.
Bill Wendling [Wed, 2 Jan 2013 23:45:09 +0000 (23:45 +0000)]
An intermediate step in the Attributes rewrite.

Modify the AttrBuilder class to store the attributes as a set instead of as a
bit mask. The Attribute class will represent only one attribute instead of a
collection of attributes.

This is the wave of the future!

llvm-svn: 171427

11 years agoAdd docs/README.txt to point to llvm/docs/README.txt.
Sean Silva [Wed, 2 Jan 2013 23:25:41 +0000 (23:25 +0000)]
Add docs/README.txt to point to llvm/docs/README.txt.

llvm-svn: 171426

11 years agoanalyzer: add initial Sphinx configuration
Sean Silva [Wed, 2 Jan 2013 23:07:22 +0000 (23:07 +0000)]
analyzer: add initial Sphinx configuration

This is just the output of sphinx-quickstart. Now all that is needed
to begin converting the analyzer docs to reST is the server-side setup.

The analyzer folks have asked me to keep this segregated from the other
clang docs since the analyzer is a logically separate project (and has
its own separate web page) even though it resides in the clang tree.

llvm-svn: 171425

11 years agoExclude docs/analyzer/ from the default Sphinx build.
Sean Silva [Wed, 2 Jan 2013 22:48:50 +0000 (22:48 +0000)]
Exclude docs/analyzer/ from the default Sphinx build.

This paves the way for converting the analyzer docs to Sphinx (by
setting up a nested Sphinx tree in this directory).

llvm-svn: 171424

11 years ago[python bindings] Expose cursor.referenced (clang_getCursorReferenced).
Argyrios Kyrtzidis [Wed, 2 Jan 2013 22:31:57 +0000 (22:31 +0000)]
[python bindings] Expose cursor.referenced (clang_getCursorReferenced).

Patch by Matthew King!

llvm-svn: 171423

11 years agohexagon-target-basic.c test: add REQUIRES line for hexagon target
Dmitri Gribenko [Wed, 2 Jan 2013 22:30:14 +0000 (22:30 +0000)]
hexagon-target-basic.c test: add REQUIRES line for hexagon target

llvm-svn: 171422

11 years agoDiagnosticIds: Fix offset/ID calculation, no impact outside this code.
Argyrios Kyrtzidis [Wed, 2 Jan 2013 22:26:07 +0000 (22:26 +0000)]
DiagnosticIds: Fix offset/ID calculation, no impact outside this code.

Patch by Will Dietz:

Minor touchup so the values of Offset/ID reflect their intention.
Previously, the sum (Offset+ID) was correct, but Offset/ID
individually were wrong.

Caught by investigating unsigned overflow reported by -fsanitize=integer.

llvm-svn: 171421

11 years agoDAGCombiner: Avoid generating illegal vector INT_TO_FP nodes
Tom Stellard [Wed, 2 Jan 2013 22:13:01 +0000 (22:13 +0000)]
DAGCombiner: Avoid generating illegal vector INT_TO_FP nodes

DAGCombiner::reduceBuildVecConvertToConvertBuildVec() was making two
mistakes:

1. It was checking the legality of scalar INT_TO_FP nodes and then generating
vector nodes.

2. It was passing the result value type to
TargetLoweringInfo::getOperationAction() when it should have been
passing the value type of the first operand.

llvm-svn: 171420

11 years agodocs: Mark ReleaseNotes as "In-Progress"
Sean Silva [Wed, 2 Jan 2013 22:05:33 +0000 (22:05 +0000)]
docs: Mark ReleaseNotes as "In-Progress"

Even though we do have a `.. warning::` directive on the page, hopefully
having "In-Progress" in the title will help to condition people's
expectations a bit for when they run into the extremely bare-bones
release notes.

Also, when release season comes around again, maybe this will get
people's attention and avoid confusion about what is going into the
upcoming release, and what is for changes to trunk for the next version.

llvm-svn: 171419

11 years agodocs: Take advantage of extra level of headings.
Sean Silva [Wed, 2 Jan 2013 21:50:48 +0000 (21:50 +0000)]
docs: Take advantage of extra level of headings.

The way Sphinx treats the "top-level" adornments is weird. It usually
uses the first top-level adornment as the page title, even if the
top-level adornment is just one "section" out of many (i.e. if the first
section is "Introduction", then it will make the page title be
"Introduction"). This behavior can be overriden by using an explicit
`..  title::` directive to set the title.

Since the Sphinx stylesheet that Clang is currently using ('haiku')
nicely puts the document title at the top of the page in the header,
this weird default behavior was resulting in a redundant "title" in the
body content. Getting rid of this redundant level of headings
effectively "exposes" one more level of heading from the stylesheet to
which now makes the real "sections" more distinct.

llvm-svn: 171417

11 years agoCorrect Hexagon DataLayout string. Fixes bug 14744.
Anshuman Dasgupta [Wed, 2 Jan 2013 21:25:57 +0000 (21:25 +0000)]
Correct Hexagon DataLayout string. Fixes bug 14744.

Patch by Krzysztof Parzyszek!

llvm-svn: 171415

11 years agoAdds missing aliases for fcom and fcomp instructions without arguments.
Kevin Enderby [Wed, 2 Jan 2013 21:20:15 +0000 (21:20 +0000)]
Adds missing aliases for fcom and fcomp instructions without arguments.
Patch by Michael M Kuperstein!

llvm-svn: 171414

11 years agoUse a bool instead of a bitfield in llvm/ADT/Optional.
Argyrios Kyrtzidis [Wed, 2 Jan 2013 21:19:08 +0000 (21:19 +0000)]
Use a bool instead of a bitfield in llvm/ADT/Optional.

Fixes Valgrind failures and removes bitwise operations that don't provide any benefit.
Valgrind failures reported by NAKAMURA Takumi.

llvm-svn: 171413

11 years agoType safety attributes: add tests for enumerations (users are actually doing
Dmitri Gribenko [Wed, 2 Jan 2013 21:12:03 +0000 (21:12 +0000)]
Type safety attributes: add tests for enumerations (users are actually doing
this, ensure we don't regress)

llvm-svn: 171412

11 years agodocs: Curb excessive table-of-contents depth.
Sean Silva [Wed, 2 Jan 2013 21:09:58 +0000 (21:09 +0000)]
docs: Curb excessive table-of-contents depth.

llvm-svn: 171410

11 years agodocs: Reorganize landing page.
Sean Silva [Wed, 2 Jan 2013 21:03:11 +0000 (21:03 +0000)]
docs: Reorganize landing page.

Language extensions are highly relevant to using clang as a compiler, so
move LanguageExtensions up into `Using Clang as a Compiler` on the
landing page.

The other documents from the now-gone `Language Extensions and Specs`
section on the landing page nicely fit hierarchically under
LanguageExtensions.rst, so put them under LanguageExtensions.rst's
toctree instead of on the landing page.

Impetus from Jordan Rose.

llvm-svn: 171409

11 years agoRestrict __builtin_assume_aligned to gcc 4.7+
Michael J. Spencer [Wed, 2 Jan 2013 20:23:49 +0000 (20:23 +0000)]
Restrict __builtin_assume_aligned to gcc 4.7+

llvm-svn: 171408

11 years agodocs: Fix spelling error.
Sean Silva [Wed, 2 Jan 2013 20:22:14 +0000 (20:22 +0000)]
docs: Fix spelling error.

Spotted by Nikola Smiljanic.

llvm-svn: 171407

11 years ago[Support][Endian] Add support for specifying the alignment and native unaligned types.
Michael J. Spencer [Wed, 2 Jan 2013 20:14:11 +0000 (20:14 +0000)]
[Support][Endian] Add support for specifying the alignment and native unaligned types.

* Add support for specifying the alignment to use.
* Add the concept of native endianness. Used for unaligned native types.

The native alignment and read/write simplification is based on a patch by Richard Smith.

llvm-svn: 171406

11 years agoDon't #include stuff outside the include guards.
Argyrios Kyrtzidis [Wed, 2 Jan 2013 19:42:53 +0000 (19:42 +0000)]
Don't #include stuff outside the include guards.

This defeats the include-guard optimization when parsing.

llvm-svn: 171405

11 years agoRemove the anonymous namespace from lib/Sema/TreeTransform.h
Argyrios Kyrtzidis [Wed, 2 Jan 2013 19:10:22 +0000 (19:10 +0000)]
Remove the anonymous namespace from lib/Sema/TreeTransform.h

llvm-svn: 171402

11 years agoFixes multiple formatting bugs.
Manuel Klimek [Wed, 2 Jan 2013 18:33:23 +0000 (18:33 +0000)]
Fixes multiple formatting bugs.

Fixes:
- incorrect handling of multiple consecutive preprocessor directives
- crash when trying to right align the escpaed newline for a line that
  is longer than the column limit
- using only ColumnLimit-1 columns when layouting with escaped newlines
  inside preprocessor directives

llvm-svn: 171401

11 years agoDon't allow line breaks after template parameters.
Daniel Jasper [Wed, 2 Jan 2013 18:30:06 +0000 (18:30 +0000)]
Don't allow line breaks after template parameters.

This fixes llvm.org/PR14786.

We will need to split there as a last resort, but that should be done
consistently independent of whether the type is a template type or not.

Before:
template <typename T>
aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<T>
                    ::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
template <typename T>
aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 171400

11 years ago- Add comment to two functions which might be considered as dead code.
Shuxin Yang [Wed, 2 Jan 2013 18:26:31 +0000 (18:26 +0000)]
- Add comment to two functions which might be considered as dead code.
- Fix a typo

llvm-svn: 171399

11 years agoAVX: Fix a bug in WidenMaskArithmetic.
Nadav Rotem [Wed, 2 Jan 2013 17:41:03 +0000 (17:41 +0000)]
AVX: Fix a bug in WidenMaskArithmetic.

llvm-svn: 171398

11 years agoAVX: Fix a bug in WidenMaskArithmetic.
Nadav Rotem [Wed, 2 Jan 2013 17:40:39 +0000 (17:40 +0000)]
AVX: Fix a bug in WidenMaskArithmetic.

llvm-svn: 171397

11 years agoFormat */& as binary operator if followed by a unary operator.
Daniel Jasper [Wed, 2 Jan 2013 17:21:36 +0000 (17:21 +0000)]
Format */& as binary operator if followed by a unary operator.

This fixes llvm.org/PR14687.
Also fixes segfault for lines starting with * or &.

Before:
a *~b;
*a = 1;  // <- this segfaulted

After:
a * ~b;
*a = 1;  // no segfault :-)

llvm-svn: 171396

11 years agoFixes use of unescaped newlines when formatting preprocessor directives.
Manuel Klimek [Wed, 2 Jan 2013 16:30:12 +0000 (16:30 +0000)]
Fixes use of unescaped newlines when formatting preprocessor directives.

This is the first step towards handling preprocessor directives. This
patch only fixes the most pressing issue, namely correctly escaping
newlines for tokens within a sequence of a preprocessor directive.

The next step will be to fix incorrect format decisions on #define
directives.

llvm-svn: 171393

11 years agoCorrectly format pointers and references in casts.
Daniel Jasper [Wed, 2 Jan 2013 15:46:59 +0000 (15:46 +0000)]
Correctly format pointers and references in casts.

This fixes llvm.org/PR14747.

Before: Type *A = (Type * ) P;
After:  Type *A = (Type *) P;
llvm-svn: 171390

11 years agoUnderstand unary operators after "return" and "case".
Daniel Jasper [Wed, 2 Jan 2013 15:26:16 +0000 (15:26 +0000)]
Understand unary operators after "return" and "case".

This fixes llvm.org/PR14746.

Before: return - 1;
After:  return -1;
llvm-svn: 171389

11 years agoPrefer splitting after "template <...>" and fix indentation.
Daniel Jasper [Wed, 2 Jan 2013 15:08:56 +0000 (15:08 +0000)]
Prefer splitting after "template <...>" and fix indentation.

This addresses llvm.org/PR14699

Before:
template <typename T>
    void looooooooooooooooooooooongFunction(int Param1, int Param2);
template <typename T> void looooooooooooooooooooongFunction(
    int Paaaaaaaaaaaaaaaaaaaaram1, int Paaaaaaaaaaaaaaaaaaaaram2);

After:
template <typename T>
void looooooooooooooooooooooongFunction(int Param1, int Param2);
template <typename T>
void looooooooooooooooooooongFunction(int Paaaaaaaaaaaaaaaaaaaaram1,
                                      int Paaaaaaaaaaaaaaaaaaaaram2);

llvm-svn: 171388

11 years agoPrefer to break after operators over breaking after "(".
Daniel Jasper [Wed, 2 Jan 2013 14:40:02 +0000 (14:40 +0000)]
Prefer to break after operators over breaking after "(".

Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
                                 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 171386

11 years agodocs: `3.2` -> `3.3`
Sean Silva [Wed, 2 Jan 2013 13:25:05 +0000 (13:25 +0000)]
docs: `3.2` -> `3.3`

llvm-svn: 171384