platform/upstream/llvm.git
11 years agoAdd an MF argument to MachineInstr::addOperand().
Jakob Stoklund Olesen [Wed, 19 Dec 2012 19:19:01 +0000 (19:19 +0000)]
Add an MF argument to MachineInstr::addOperand().

Just like for addMemOperand(), the function pointer provides a context
for allocating memory. This will make it possible to use a better memory
allocation strategy for the MI operand list, which is currently a slow
std::vector.

Most calls to addOperand() come from MachineInstrBuilder, so give that
class an MF reference as well. Code using BuildMI() won't need changing
at all since the MF reference is already required to allocate a
MachineInstr.

Future patches will fix code that calls MI::addOperand(Op) directly, as
well as code that uses the now deprecated MachineInstrBuilder(MI)
constructor.

llvm-svn: 170574

11 years agoobjective-C: Don't warn of unimplemented property of protocols in
Fariborz Jahanian [Wed, 19 Dec 2012 18:58:55 +0000 (18:58 +0000)]
objective-C: Don't warn of unimplemented property of protocols in
category, when those properties will be implemented in category's
primary class or one of its super classes. // rdar://12568064

llvm-svn: 170573

11 years agoForgot to remove trailing whitespace when I converted the BlockLanguageSpec.txt ...
Michael Gottesman [Wed, 19 Dec 2012 18:42:42 +0000 (18:42 +0000)]
Forgot to remove trailing whitespace when I converted the BlockLanguageSpec.txt => BlockLanguageSpec.rst. It has been eliminated.

llvm-svn: 170572

11 years agoConverted BlockLanguageSpec.txt => BlockLanguageSpec.rst.
Michael Gottesman [Wed, 19 Dec 2012 18:41:09 +0000 (18:41 +0000)]
Converted BlockLanguageSpec.txt => BlockLanguageSpec.rst.

llvm-svn: 170571

11 years agoChange test to dump Filecheck output to an intermediate file. This makes it easier...
Ted Kremenek [Wed, 19 Dec 2012 18:30:38 +0000 (18:30 +0000)]
Change test to dump Filecheck output to an intermediate file.  This makes it easier to update this test.

llvm-svn: 170570

11 years agoRemove superfluous brief command from getAsString.
Chad Rosier [Wed, 19 Dec 2012 18:06:44 +0000 (18:06 +0000)]
Remove superfluous brief command from getAsString.

llvm-svn: 170569

11 years agodoc: add subsections.
Nadav Rotem [Wed, 19 Dec 2012 18:04:44 +0000 (18:04 +0000)]
doc: add subsections.

llvm-svn: 170568

11 years agoDOC: document the use of O2, O3 and Os with -fvectorize.
Nadav Rotem [Wed, 19 Dec 2012 18:02:36 +0000 (18:02 +0000)]
DOC: document the use of O2, O3 and Os with -fvectorize.

llvm-svn: 170567

11 years agoFix PR14591: Windows newlines in doxygen comments cause failed assertion in
Dmitri Gribenko [Wed, 19 Dec 2012 17:34:55 +0000 (17:34 +0000)]
Fix PR14591: Windows newlines in doxygen comments cause failed assertion in
TextDiagnostic

Patch by Janusz Chorko.

llvm-svn: 170566

11 years agoAdd a missing 'else'. Found by grep '} if'
Dmitri Gribenko [Wed, 19 Dec 2012 17:29:30 +0000 (17:29 +0000)]
Add a missing 'else'.  Found by grep '} if'

No testcase because this did not affect correctness: a declaration can only be
ClassTemplateDecl or a FunctionTemplateDecl, not both.

llvm-svn: 170565

11 years agoTest suite cleanup for Linux: mark test cases expected to fail due to open bugzillas
Daniel Malea [Wed, 19 Dec 2012 17:19:28 +0000 (17:19 +0000)]
Test suite cleanup for Linux: mark test cases expected to fail due to open bugzillas
- bugzillas covered: 14323, 14600, 14541, 14437, 14540, 14541

llvm-svn: 170564

11 years agoComment parsing: add a missing 'else'. Found by inspection.
Dmitri Gribenko [Wed, 19 Dec 2012 17:17:09 +0000 (17:17 +0000)]
Comment parsing: add a missing 'else'.  Found by inspection.

No testcase because we were just building an extra AST node and eventually
throwing it away, so it did not affect correctness.

llvm-svn: 170563

11 years agoImprove on header comment suggested by James Dennet.
Fariborz Jahanian [Wed, 19 Dec 2012 17:03:46 +0000 (17:03 +0000)]
Improve on header comment suggested by James Dennet.

llvm-svn: 170555

11 years ago[ASan] explicitly link with dynamic ASan runtime when building unittests on Android
Alexey Samsonov [Wed, 19 Dec 2012 15:52:30 +0000 (15:52 +0000)]
[ASan] explicitly link with dynamic ASan runtime when building unittests on Android

llvm-svn: 170552

11 years agoPowerPC: Expand VSELECT nodes.
Benjamin Kramer [Wed, 19 Dec 2012 15:49:14 +0000 (15:49 +0000)]
PowerPC: Expand VSELECT nodes.

There's probably a better expansion for those nodes than the default for
altivec, but this is better than crashing. VSELECTs occur in loop vectorizer
output.

llvm-svn: 170551

11 years agoChange AsmOperandInfo::ConstraintVT to MVT, instead of EVT.
Patrik Hagglund [Wed, 19 Dec 2012 15:19:11 +0000 (15:19 +0000)]
Change AsmOperandInfo::ConstraintVT to MVT, instead of EVT.

Accordingly, add MVT::getVT.

llvm-svn: 170550

11 years ago[ASan] Support building both 32- and 64-bit unit tests if we can target both architec...
Alexey Samsonov [Wed, 19 Dec 2012 15:17:23 +0000 (15:17 +0000)]
[ASan] Support building both 32- and 64-bit unit tests if we can target both architectures

llvm-svn: 170549

11 years ago[asan] asan_allocator2: add mmap/munmap stats
Kostya Serebryany [Wed, 19 Dec 2012 14:56:38 +0000 (14:56 +0000)]
[asan] asan_allocator2: add mmap/munmap stats

llvm-svn: 170548

11 years agoRevert 170545 while I debug the ppc failures.
Rafael Espindola [Wed, 19 Dec 2012 14:48:05 +0000 (14:48 +0000)]
Revert 170545 while I debug the ppc failures.

llvm-svn: 170547

11 years agoMake TargetLowering::getTypeConversion more resilient against odd illegal MVTs.
Benjamin Kramer [Wed, 19 Dec 2012 14:34:28 +0000 (14:34 +0000)]
Make TargetLowering::getTypeConversion more resilient against odd illegal MVTs.

- An MVT can become an EVT when being split (e.g. v2i8 -> v1i8, the latter doesn't exist)
- Return the scalar value when an MVT is scalarized (v1i64 -> i64)

Fixes PR14639ff.

llvm-svn: 170546

11 years agoAdd r170095 back.
Rafael Espindola [Wed, 19 Dec 2012 14:15:04 +0000 (14:15 +0000)]
Add r170095 back.

I cannot reproduce it the failures locally, so I will keep an eye at the ppc
bots. This patch does add the change to the "Disassembly of section" message,
but that is not what was failing on the bots.

Original message:

Add a funciton to get the segment name of a section.

On MachO, sections also have segment names. When a tool looking at a .o file
prints a segment name, this is what they mean. In reality, a .o has only one
anonymous, segment.

This patch adds a MachO only function to fetch that segment name. I named it
getSectionFinalSegmentName since the main use for the name seems to be infor
the linker with segment this section should go to.

The patch also changes MachOObjectFile::getSectionName to return just the
section name instead of computing SegmentName,SectionName.

llvm-svn: 170545

11 years ago[msan] Add track-origins argument to the pass constructor.
Evgeniy Stepanov [Wed, 19 Dec 2012 13:55:51 +0000 (13:55 +0000)]
[msan] Add track-origins argument to the pass constructor.

llvm-svn: 170544

11 years ago[ASan] make sure Android unittests depend on ASan runtime
Alexey Samsonov [Wed, 19 Dec 2012 13:46:58 +0000 (13:46 +0000)]
[ASan] make sure Android unittests depend on ASan runtime

llvm-svn: 170543

11 years agoDocumentation: add a missing space
Dmitri Gribenko [Wed, 19 Dec 2012 12:51:48 +0000 (12:51 +0000)]
Documentation: add a missing space

llvm-svn: 170542

11 years agoSignificantly change the way we build ASan unittests in CMake
Alexey Samsonov [Wed, 19 Dec 2012 12:33:39 +0000 (12:33 +0000)]
Significantly change the way we build ASan unittests in CMake
build tree. Now just-built Clang is used to:
  1) compile instrumented sources (as before);
  2) compile non-instrumented sources;
  3) compile our own instrumented version of googletest;
  4) link it all together using -fsanitize=address flag
     (instead of trying to copy linker behavior in
      CMake build rules).

This makes ASan unittests pretty much self-consistent
and independent of other LLVM libraries.

llvm-svn: 170541

11 years agoSplit the usage of 'EVT PartVT' into 'MVT PartVT' and 'EVT PartEVT'.
Patrik Hagglund [Wed, 19 Dec 2012 12:33:30 +0000 (12:33 +0000)]
Split the usage of 'EVT PartVT' into 'MVT PartVT' and 'EVT PartEVT'.

llvm-svn: 170540

11 years agoCMake: factor out a function that returns the expected directory for unit test
Alexey Samsonov [Wed, 19 Dec 2012 12:30:33 +0000 (12:30 +0000)]
CMake: factor out a function that returns the expected directory for unit test

llvm-svn: 170539

11 years agoChange RegVT in BitTestBlock and RegsForValue, to contain MVTs,
Patrik Hagglund [Wed, 19 Dec 2012 12:23:01 +0000 (12:23 +0000)]
Change RegVT in BitTestBlock and RegsForValue, to contain MVTs,
instead of EVTs.

llvm-svn: 170538

11 years agoChange TargetLowering::getTypeForExtArgOrReturn to take and return
Patrik Hagglund [Wed, 19 Dec 2012 12:02:25 +0000 (12:02 +0000)]
Change TargetLowering::getTypeForExtArgOrReturn to take and return
MVTs, instead of EVTs.

llvm-svn: 170537

11 years agoChange a parameter of TargetLowering::getVectorTypeBreakdown to MVT,
Patrik Hagglund [Wed, 19 Dec 2012 11:53:21 +0000 (11:53 +0000)]
Change a parameter of TargetLowering::getVectorTypeBreakdown to MVT,
from EVT.

llvm-svn: 170536

11 years agoChange TargetLowering::RegisterTypeForVT to contain MVTs, instead of
Patrik Hagglund [Wed, 19 Dec 2012 11:48:16 +0000 (11:48 +0000)]
Change TargetLowering::RegisterTypeForVT to contain MVTs, instead of
EVTs.

llvm-svn: 170535

11 years agoChange TargetLowering::TransformToType to contain MVTs, instead of
Patrik Hagglund [Wed, 19 Dec 2012 11:42:00 +0000 (11:42 +0000)]
Change TargetLowering::TransformToType to contain MVTs, instead of
EVTs.

llvm-svn: 170534

11 years agoChange TargetLowering::getRepRegClassCostFor, getIndexedLoadAction,
Patrik Hagglund [Wed, 19 Dec 2012 11:37:12 +0000 (11:37 +0000)]
Change TargetLowering::getRepRegClassCostFor, getIndexedLoadAction,
getIndexedStoreAction, and addRegisterClass to take and MVT, instead
of EVT.

llvm-svn: 170533

11 years agoChange TargetLowering::findRepresentativeClass to take an MVT, instead
Patrik Hagglund [Wed, 19 Dec 2012 11:30:36 +0000 (11:30 +0000)]
Change TargetLowering::findRepresentativeClass to take an MVT, instead
of EVT.

llvm-svn: 170532

11 years ago[ASan] Change the boilerplate check in the libdispatch tests to fix them.
Alexander Potapenko [Wed, 19 Dec 2012 11:26:41 +0000 (11:26 +0000)]
[ASan] Change the boilerplate check in the libdispatch tests to fix them.

llvm-svn: 170531

11 years ago[msan] Heuristically instrument unknown intrinsics.
Evgeniy Stepanov [Wed, 19 Dec 2012 11:22:04 +0000 (11:22 +0000)]
[msan] Heuristically instrument unknown intrinsics.

This changes adds shadow and origin propagation for unknown intrinsics
by examining the arguments and ModRef behaviour. For now, only 3 classes
of intrinsics are handled:
- those that look like simple SIMD store
- those that look like simple SIMD load
- those that don't have memory effects and look like arithmetic/logic/whatever
  operation on simple types.

llvm-svn: 170530

11 years agoChange TargetLowering::getTypeToPromoteTo to take and return MVTs,
Patrik Hagglund [Wed, 19 Dec 2012 11:21:04 +0000 (11:21 +0000)]
Change TargetLowering::getTypeToPromoteTo to take and return MVTs,
instead of EVTs.

llvm-svn: 170529

11 years agoLoopVectorize: Make iteration over induction variables not depend on pointer values.
Benjamin Kramer [Wed, 19 Dec 2012 11:09:15 +0000 (11:09 +0000)]
LoopVectorize: Make iteration over induction variables not depend on pointer values.

MapVector is a bit heavyweight, but I don't see a simpler way. Also the
InductionList is unlikely to be large. This should help 3-stage selfhost
compares (PR14647).

llvm-svn: 170528

11 years agoMapVector: Add lookup().
Benjamin Kramer [Wed, 19 Dec 2012 11:08:33 +0000 (11:08 +0000)]
MapVector: Add lookup().

llvm-svn: 170527

11 years agoChange TargetLowering::isCondCodeLegal to take an MVT, instead of EVT.
Patrik Hagglund [Wed, 19 Dec 2012 10:19:55 +0000 (10:19 +0000)]
Change TargetLowering::isCondCodeLegal to take an MVT, instead of EVT.

llvm-svn: 170524

11 years agoX86ISelLowering.cpp: Fix warnings. [-Wlogical-op-parentheses]
NAKAMURA Takumi [Wed, 19 Dec 2012 10:12:48 +0000 (10:12 +0000)]
X86ISelLowering.cpp: Fix warnings. [-Wlogical-op-parentheses]

llvm-svn: 170523

11 years agoChange TargetLowering::getCondCodeAction to take an MVT, instead of
Patrik Hagglund [Wed, 19 Dec 2012 10:09:26 +0000 (10:09 +0000)]
Change TargetLowering::getCondCodeAction to take an MVT, instead of
EVT.

llvm-svn: 170522

11 years ago[asan] print the shadow bytes in different colors and also output the shadow byte...
Kostya Serebryany [Wed, 19 Dec 2012 09:53:32 +0000 (09:53 +0000)]
[asan] print the shadow bytes in different colors and also output the shadow byte legend

llvm-svn: 170520

11 years ago[TSan] build only gtest-all.o when building TSan unit tests
Alexey Samsonov [Wed, 19 Dec 2012 09:19:57 +0000 (09:19 +0000)]
[TSan] build only gtest-all.o when building TSan unit tests

llvm-svn: 170519

11 years agoInline hasFunctionOnlyAttrs into its only use.
Bill Wendling [Wed, 19 Dec 2012 09:15:11 +0000 (09:15 +0000)]
Inline hasFunctionOnlyAttrs into its only use.

llvm-svn: 170518

11 years agoInline the only use of the hasParameterOnlyAttrs method.
Bill Wendling [Wed, 19 Dec 2012 09:04:58 +0000 (09:04 +0000)]
Inline the only use of the hasParameterOnlyAttrs method.

llvm-svn: 170517

11 years agoInline the 'hasIncompatibleWithVarArgsAttrs' method into its only uses. And some...
Bill Wendling [Wed, 19 Dec 2012 08:57:40 +0000 (08:57 +0000)]
Inline the 'hasIncompatibleWithVarArgsAttrs' method into its only uses. And some minor comment reformatting.

llvm-svn: 170516

11 years agotsan: add lint check back into presubmit script
Dmitry Vyukov [Wed, 19 Dec 2012 08:53:31 +0000 (08:53 +0000)]
tsan: add lint check back into presubmit script

llvm-svn: 170515

11 years ago[Sanitizer] add missing header on Windows
Alexey Samsonov [Wed, 19 Dec 2012 08:51:39 +0000 (08:51 +0000)]
[Sanitizer] add missing header on Windows

llvm-svn: 170514

11 years agoDOC: fix the url format.
Nadav Rotem [Wed, 19 Dec 2012 08:43:05 +0000 (08:43 +0000)]
DOC: fix the url format.

llvm-svn: 170513

11 years ago[asan] asan_allocator2: improve FindHeapChunkByAddress to find memory chunks to the...
Kostya Serebryany [Wed, 19 Dec 2012 08:32:50 +0000 (08:32 +0000)]
[asan] asan_allocator2: improve FindHeapChunkByAddress to find memory chunks to the left of a given address. Almost all tests pass with the new allocator now, only 6 are left to fix.

llvm-svn: 170511

11 years agoChange TargetLowering::getTruncStoreAction to take MVTs, instead of EVTs.
Patrik Hagglund [Wed, 19 Dec 2012 08:28:51 +0000 (08:28 +0000)]
Change TargetLowering::getTruncStoreAction to take MVTs, instead of EVTs.

llvm-svn: 170510

11 years agoDOC: add a benchmarks that compares us to gcc and icc.
Nadav Rotem [Wed, 19 Dec 2012 08:28:24 +0000 (08:28 +0000)]
DOC: add a benchmarks that compares us to gcc and icc.

llvm-svn: 170509

11 years ago[Sanitizer] implement internal_isatty on Windows
Alexey Samsonov [Wed, 19 Dec 2012 07:57:42 +0000 (07:57 +0000)]
[Sanitizer] implement internal_isatty on Windows

llvm-svn: 170507

11 years agoOptimized load + SIGN_EXTEND patterns in the X86 backend.
Elena Demikhovsky [Wed, 19 Dec 2012 07:50:20 +0000 (07:50 +0000)]
Optimized load + SIGN_EXTEND patterns in the X86 backend.

llvm-svn: 170506

11 years agoAfter reducing the size of an operation in the DAG we zero-extend the reduced
Nadav Rotem [Wed, 19 Dec 2012 07:39:08 +0000 (07:39 +0000)]
After reducing the size of an operation in the DAG we zero-extend the reduced
bitwidth op back to the original size. If we reduce ANDs then this can cause
an endless loop. This patch changes the ZEXT to ANY_EXTEND if the demanded bits
are equal or smaller than the size of the reduced operation.

llvm-svn: 170505

11 years agodocs: fix typos.
Nadav Rotem [Wed, 19 Dec 2012 07:36:35 +0000 (07:36 +0000)]
docs: fix typos.

llvm-svn: 170504

11 years agoDOC: Add a webpage that describes the loop and bb vectorizers.
Nadav Rotem [Wed, 19 Dec 2012 07:22:24 +0000 (07:22 +0000)]
DOC: Add a webpage that describes the loop and bb vectorizers.

llvm-svn: 170503

11 years agoRename the 'Attributes' class to 'Attribute'. It's going to represent a single attrib...
Bill Wendling [Wed, 19 Dec 2012 07:18:57 +0000 (07:18 +0000)]
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

llvm-svn: 170502

11 years agoRename the 'Attributes' class to 'Attribute'. It's going to represent a single attrib...
Bill Wendling [Wed, 19 Dec 2012 07:18:12 +0000 (07:18 +0000)]
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

llvm-svn: 170500

11 years agotsan: fix -Wgnu warnings
Dmitry Vyukov [Wed, 19 Dec 2012 06:59:45 +0000 (06:59 +0000)]
tsan: fix -Wgnu warnings

llvm-svn: 170499

11 years ago[sanitizer] one more stability fix in 64-bit allocator
Kostya Serebryany [Wed, 19 Dec 2012 06:51:45 +0000 (06:51 +0000)]
[sanitizer] one more stability fix in 64-bit allocator

llvm-svn: 170498

11 years agoRemove more of 'else's after 'returns'. No functional change.
Craig Topper [Wed, 19 Dec 2012 06:43:58 +0000 (06:43 +0000)]
Remove more  of 'else's after 'returns'. No functional change.

llvm-svn: 170497

11 years agoRemove a bunch of 'else's after 'returns'
Craig Topper [Wed, 19 Dec 2012 06:39:17 +0000 (06:39 +0000)]
Remove a bunch of 'else's after 'returns'

llvm-svn: 170496

11 years agoTeach SimplifySetCC that comparing AssertZext i1 against a constant 1 can be rewritte...
Craig Topper [Wed, 19 Dec 2012 06:12:28 +0000 (06:12 +0000)]
Teach SimplifySetCC that comparing AssertZext i1 against a constant 1 can be rewritten as a compare against a constant 0 with the opposite condition.

llvm-svn: 170495

11 years agoAdd some missing Defs and Uses.
Reed Kotler [Wed, 19 Dec 2012 04:06:15 +0000 (04:06 +0000)]
Add some missing Defs and Uses.

llvm-svn: 170493

11 years agoAttempt to clarify a vexing-parse diagnostic.
Richard Smith [Wed, 19 Dec 2012 03:15:32 +0000 (03:15 +0000)]
Attempt to clarify a vexing-parse diagnostic.

llvm-svn: 170492

11 years ago<rdar://problem/11961650>
Jason Molenda [Wed, 19 Dec 2012 02:54:03 +0000 (02:54 +0000)]
<rdar://problem/11961650>

Update the debugserver "qProcessInfo" implementation to return the
cpu type, cpu subtype, OS and vendor information just like qHostInfo
does so lldb can create an ArchSpec based on the returned values.

Add a new GetProcessArchitecture to GDBRemoteCommunicationClient akin
to GetHostArchitecture.  If the qProcessInfo packet is supported,
GetProcessArchitecture will return the cpu type / subtype of the
process -- e.g. a 32-bit user process running on a 64-bit x86_64 Mac
system.

Have ProcessGDBRemote set the Target's architecture based on the
GetProcessArchitecture when we've completed an attach/launch/connect.

llvm-svn: 170491

11 years agoFix assertion failure in self-host (and probably bogus template instantiation
Richard Smith [Wed, 19 Dec 2012 02:27:38 +0000 (02:27 +0000)]
Fix assertion failure in self-host (and probably bogus template instantiation
too). When instantiating a direct-initializer, if we find it has zero
arguments, produce an empty ParenListExpr rather than returning a null
expression.

llvm-svn: 170490

11 years agoPR13470: Ensure that copy-list-initialization isntantiates as
Richard Smith [Wed, 19 Dec 2012 01:39:02 +0000 (01:39 +0000)]
PR13470: Ensure that copy-list-initialization isntantiates as
copy-list-initialization (and doesn't add an additional copy step):

Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it
when instantiating initializers in order to correctly handle instantiation of
copy-list-initialization. Teach TreeTransform that function arguments are
initializations, and so need this special treatment too. Finally, remove some
hacks which were working around SubstInitializer's shortcomings.

llvm-svn: 170489

11 years agoPass AnalyzerOptions to PathDiagnosticConsumer to make analyzer options accessible...
Ted Kremenek [Wed, 19 Dec 2012 01:35:35 +0000 (01:35 +0000)]
Pass AnalyzerOptions to PathDiagnosticConsumer to make analyzer options accessible there.

This is plumbing needed for later functionality changes.

llvm-svn: 170488

11 years agoSimplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.
Ted Kremenek [Wed, 19 Dec 2012 01:16:49 +0000 (01:16 +0000)]
Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.

llvm-svn: 170487

11 years agoMake sure the buffer, which containas an instance of APFloat, has proper alignment.
Shuxin Yang [Wed, 19 Dec 2012 01:10:17 +0000 (01:10 +0000)]
Make sure the buffer, which containas an instance of APFloat, has proper alignment.

llvm-svn: 170486

11 years agofixes a doxygen comment.
Fariborz Jahanian [Wed, 19 Dec 2012 01:00:36 +0000 (01:00 +0000)]
fixes a doxygen comment.

llvm-svn: 170485

11 years agotest/Index/preamble_macro_template.cpp: Suppress this probably due to Lit/win32 issue...
NAKAMURA Takumi [Wed, 19 Dec 2012 00:57:48 +0000 (00:57 +0000)]
test/Index/preamble_macro_template.cpp: Suppress this probably due to Lit/win32 issue. Investigating.

llvm-svn: 170484

11 years ago[Core][ErrorOr] Add support for user error data.
Michael J. Spencer [Wed, 19 Dec 2012 00:51:07 +0000 (00:51 +0000)]
[Core][ErrorOr] Add support for user error data.

llvm-svn: 170483

11 years agoChange DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review...
David Blaikie [Wed, 19 Dec 2012 00:45:41 +0000 (00:45 +0000)]
Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review discussion in r170365

This does limit these typedefs to being sequences, but no current usage
requires them to be contiguous (we could expand this to a more general
iterator pair range concept at some point).

Also, it'd be nice if SmallVector were constructible directly from an ArrayRef
but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the
inverse conversion. (& generalizing over all range-like things, while nice,
would require some nontrivial SFINAE I haven't thought about yet)

llvm-svn: 170482

11 years agoIncreas number of iterations before a new libclang format object
Fariborz Jahanian [Wed, 19 Dec 2012 00:35:23 +0000 (00:35 +0000)]
Increas number of iterations before a new libclang format object
is created to 1000.

llvm-svn: 170481

11 years agoMake sure CodeGen uses a value of the correct type as the result of
Eli Friedman [Wed, 19 Dec 2012 00:26:58 +0000 (00:26 +0000)]
Make sure CodeGen uses a value of the correct type as the result of
of assignment to a bool bitfield.  PR14638.

llvm-svn: 170480

11 years agohttp://llvm.org/bugs/show_bug.cgi?id=14629
Greg Clayton [Wed, 19 Dec 2012 00:15:34 +0000 (00:15 +0000)]
http://llvm.org/bugs/show_bug.cgi?id=14629

Fixed incorrect documentation.

llvm-svn: 170479

11 years agoSome code refactoring per Dimitri's comment.
Fariborz Jahanian [Wed, 19 Dec 2012 00:01:48 +0000 (00:01 +0000)]
Some code refactoring per Dimitri's comment.

llvm-svn: 170478

11 years agoAdd to the disassembler C API an option to print the disassembled
Kevin Enderby [Tue, 18 Dec 2012 23:47:28 +0000 (23:47 +0000)]
Add to the disassembler C API an option to print the disassembled
instructions in the assembly code variant if one exists.

The intended use for this is so tools like lldb and darwin's otool(1)
can be switched to print Intel-flavored disassembly.

I discussed extensively this API with Jim Grosbach and we feel
while it may not be fully general, in reality there is only one syntax
for each assembly with the exception of X86 which has exactly
two for historical reasons.

rdar://10989182

llvm-svn: 170477

11 years agoDon't read the SP when getting argument values from registers in case the SP isn...
Greg Clayton [Tue, 18 Dec 2012 23:45:33 +0000 (23:45 +0000)]
Don't read the SP when getting argument values from registers in case the SP isn't available. We don't want the availability of SP to limit when we get get arguments from registers.

llvm-svn: 170476

11 years agoRemove MachineInstr::setIsInsideBundle().
Jakob Stoklund Olesen [Tue, 18 Dec 2012 23:40:14 +0000 (23:40 +0000)]
Remove MachineInstr::setIsInsideBundle().

The bundle flags are now maintained by the slightly higher-level
functions bundleWithPred() / bundleWithSucc() which enforce consistent
bundle flags between neighboring instructions.

See also MIBundleBuilder for an even higher-level approach to building
bundles.

llvm-svn: 170475

11 years agoFix a crash in diagnostic printing when a template class type is diff'ed
Eli Friedman [Tue, 18 Dec 2012 23:32:47 +0000 (23:32 +0000)]
Fix a crash in diagnostic printing when a template class type is diff'ed
against itself. PR14489.

llvm-svn: 170474

11 years agoUse bidirectional bundle flags to simplify important functions.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 23:21:49 +0000 (23:21 +0000)]
Use bidirectional bundle flags to simplify important functions.

The bundle_iterator::operator++ function now doesn't need to dig out the
basic block and check against end(). It can use the isBundledWithSucc()
flag to find the last bundled instruction safely.

Similarly, MachineInstr::isBundled() no longer needs to look at
iterators etc. It only has to look at flags.

llvm-svn: 170473

11 years agoEnable the loop vectorizer in clang via -fvectorize
Nadav Rotem [Tue, 18 Dec 2012 23:10:16 +0000 (23:10 +0000)]
Enable the loop vectorizer in clang via -fvectorize

llvm-svn: 170472

11 years agordar://12801297
Shuxin Yang [Tue, 18 Dec 2012 23:10:12 +0000 (23:10 +0000)]
rdar://12801297

 InstCombine for unsafe floating-point add/sub.

llvm-svn: 170471

11 years agoEnable the loop vectorizer in clang and not in the pass manager, so that we can disab...
Nadav Rotem [Tue, 18 Dec 2012 23:09:44 +0000 (23:09 +0000)]
Enable the loop vectorizer in clang and not in the pass manager, so that we can disable it in clang.

llvm-svn: 170470

11 years agoFix the fvectorize testcase
Nadav Rotem [Tue, 18 Dec 2012 23:08:58 +0000 (23:08 +0000)]
Fix the fvectorize testcase

llvm-svn: 170469

11 years agoHave clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing...
Ted Kremenek [Tue, 18 Dec 2012 23:07:30 +0000 (23:07 +0000)]
Have clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing through macros.

This fixes a subtle bug reported in <rdar://problem/12584554> where a double-nested
macro could lead to an incorrect fixit location with live issues.

This fix also uncovers a bunch of subtle bugs in our indexer test cases which
are now fixed (mostly around source ranges for attributes).

llvm-svn: 170468

11 years agoThis is the libclang patch providing minimal API to
Fariborz Jahanian [Tue, 18 Dec 2012 23:02:59 +0000 (23:02 +0000)]
This is the libclang patch providing minimal API to
use clang's formatter. Currently, formatter is used
to format declaration tags for xml comments. Since formatter
is in flux and its change will break several of the clang comment
tests, only a single tests is formatted using this facility.
Doug has reviewed and approved it for check-in.

llvm-svn: 170467

11 years agoBe defensive when printing module import locations; the diagnostic printer needs...
Douglas Gregor [Tue, 18 Dec 2012 23:02:07 +0000 (23:02 +0000)]
Be defensive when printing module import locations; the diagnostic printer needs to be robust

llvm-svn: 170466

11 years agoVerify bundle flag consistency when setting them.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 23:00:28 +0000 (23:00 +0000)]
Verify bundle flag consistency when setting them.

Now that the bundle flag aware APIs are all in place, it is possible to
continuously verify the flag consistency.

llvm-svn: 170465

11 years agoReverse order of checking SSE level when calculating compare cost, so we check
Jakub Staszak [Tue, 18 Dec 2012 22:57:56 +0000 (22:57 +0000)]
Reverse order of checking SSE level when calculating compare cost, so we check
AVX2 before AVX.

llvm-svn: 170464

11 years agoVerify bundle flags for consistency in MachineVerifier.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 22:55:07 +0000 (22:55 +0000)]
Verify bundle flags for consistency in MachineVerifier.

The new bidirectional bundle flags are redundant, so inadvertent bundle
tearing can be detected in the machine code verifier.

llvm-svn: 170463

11 years agoDisable ARM partial flag dependency optimization at -Oz
Quentin Colombet [Tue, 18 Dec 2012 22:47:16 +0000 (22:47 +0000)]
Disable ARM partial flag dependency optimization at -Oz

To not over constrain the scheduler for ARM in thumb mode, some optimizations  for code size reduction, specific to ARM thumb, are blocked when they add a dependency (like write after read dependency).

Disables this check when code size is the priority, i.e., code is compiled with -Oz.

llvm-svn: 170462

11 years agoSimilar to 170440 - fix build warning with gcc
Eli Bendersky [Tue, 18 Dec 2012 22:22:16 +0000 (22:22 +0000)]
Similar to 170440 - fix build warning with gcc

llvm-svn: 170461

11 years agoDon't allow the automatically updated MI flags to be set directly.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 21:36:05 +0000 (21:36 +0000)]
Don't allow the automatically updated MI flags to be set directly.

The bundle-related MI flags need to be kept in sync with the neighboring
instructions. Don't allow the bulk flag-setting setFlags() function to
change them.

Also don't copy MI flags when cloning an instruction. The clone's bundle
flags will be set when it is explicitly inserted into a bundle.

llvm-svn: 170459

11 years agoAdd tests to check recent changes to some builtins.
Bill Wendling [Tue, 18 Dec 2012 21:09:25 +0000 (21:09 +0000)]
Add tests to check recent changes to some builtins.

llvm-svn: 170458