platform/upstream/llvm.git
11 years agoReinitialize the ivars in the subtarget so that they can be reset with the new features.
Bill Wendling [Sat, 16 Feb 2013 01:36:26 +0000 (01:36 +0000)]
Reinitialize the ivars in the subtarget so that they can be reset with the new features.

llvm-svn: 175336

11 years agolibAnalysis: Add a case for TypeAliasDecl in CFGRecStmtDeclVisitor.
Jordan Rose [Sat, 16 Feb 2013 01:33:16 +0000 (01:33 +0000)]
libAnalysis: Add a case for TypeAliasDecl in CFGRecStmtDeclVisitor.

Neither of the current clients of CFGRecStmtDeclVisitor are doing
anything with typedefs, so I assume type aliases (C++11 "using")
can be safely ignored. This was causing assertion failures in
the analyzer.

<rdar://problem/13228440>

llvm-svn: 175335

11 years ago[ms-inline asm] Do not omit the frame pointer if we have ms-inline assembly.
Chad Rosier [Sat, 16 Feb 2013 01:25:28 +0000 (01:25 +0000)]
[ms-inline asm] Do not omit the frame pointer if we have ms-inline assembly.

If the frame pointer is omitted, and any stack changes occur in the inline
assembly, e.g.: "pusha", then any C local variable or C argument references
will be incorrect.

I pass no judgement on anyone who would do such a thing. ;)
rdar://13218191

llvm-svn: 175334

11 years agolibclang: remove reinterpret_casts by using SourceLocation::getPtrEncoding
Dmitri Gribenko [Sat, 16 Feb 2013 01:07:48 +0000 (01:07 +0000)]
libclang: remove reinterpret_casts by using SourceLocation::getPtrEncoding

llvm-svn: 175333

11 years agoRemove unused forward declarations
Dmitri Gribenko [Sat, 16 Feb 2013 01:06:07 +0000 (01:06 +0000)]
Remove unused forward declarations

clang/AST/Decl.h is included to see the TypeSourceInfo definition anyway.

llvm-svn: 175332

11 years agoDon't warn on conversion from NULL to nullptr_t
David Blaikie [Sat, 16 Feb 2013 00:56:22 +0000 (00:56 +0000)]
Don't warn on conversion from NULL to nullptr_t

llvm-svn: 175331

11 years agoEmit vtables for an extern template class as available_externally, not as
Richard Smith [Sat, 16 Feb 2013 00:51:21 +0000 (00:51 +0000)]
Emit vtables for an extern template class as available_externally, not as
linkonce_odr. Emit construction vtables as internal in this case, since the ABI
does not guarantee that they will be availble externally.

llvm-svn: 175330

11 years ago[PCH] Deserializing the DeclContext of a template parameter is not safe
Argyrios Kyrtzidis [Sat, 16 Feb 2013 00:48:59 +0000 (00:48 +0000)]
[PCH] Deserializing the DeclContext of a template parameter is not safe
until recursive loading is finished.

Otherwise we may end up with a template trying to deserialize a template
parameter that is in the process of getting loaded.

rdar://13135282

llvm-svn: 175329

11 years agoRemove unused forward declarations
Dmitri Gribenko [Sat, 16 Feb 2013 00:41:34 +0000 (00:41 +0000)]
Remove unused forward declarations

llvm-svn: 175328

11 years agoDerive ELF section type from the name in some cases where GNU as does
Joerg Sonnenberger [Sat, 16 Feb 2013 00:32:53 +0000 (00:32 +0000)]
Derive ELF section type from the name in some cases where GNU as does
so.

llvm-svn: 175327

11 years agoRework the visibility computation algorithm in preparation
John McCall [Sat, 16 Feb 2013 00:17:33 +0000 (00:17 +0000)]
Rework the visibility computation algorithm in preparation
for distinguishing type vs. value visibility.

The changes to the visibility of explicit specializations
are intentional.  The change to the "ugly" test case is
a consequence of a sensible implementation, and I am happy
to argue that this is better behavior.  Other changes may
or may not be intended;  it is quite difficult to divine
intent from some of the code I altered.

I've left behind a comment which I hope explains the
philosophy behind visibility computation.

llvm-svn: 175326

11 years ago[mips] Remove SDNPWantParent from the list of SDNodeProperties.
Akira Hatanaka [Sat, 16 Feb 2013 00:14:37 +0000 (00:14 +0000)]
[mips] Remove SDNPWantParent from the list of SDNodeProperties.

No functionality change intended.

llvm-svn: 175325

11 years agoPacify -Wnon-virtual-dtor
Matt Beaumont-Gay [Fri, 15 Feb 2013 23:51:59 +0000 (23:51 +0000)]
Pacify -Wnon-virtual-dtor

llvm-svn: 175324

11 years agoNSSet formatter is now C++ code
Enrico Granata [Fri, 15 Feb 2013 23:38:37 +0000 (23:38 +0000)]
NSSet formatter is now C++ code
Split some NS* formatters in their own source files
Refactored a utility function for the C++ formatters to use
Fixed the skip-summary test case to be explicit about requiring libstdc++ for operation

llvm-svn: 175323

11 years agoTemporary revert of 175320.
Bill Wendling [Fri, 15 Feb 2013 23:22:32 +0000 (23:22 +0000)]
Temporary revert of 175320.

llvm-svn: 175322

11 years agoReinitialize the ivars in the subtarget.
Bill Wendling [Fri, 15 Feb 2013 23:18:01 +0000 (23:18 +0000)]
Reinitialize the ivars in the subtarget.

When we're recalculating the feature set of the subtarget, we need to have the
ivars in their initial state.

llvm-svn: 175320

11 years agoSuppress a GCC -Wunused-variable warning in -Asserts builds
Matt Beaumont-Gay [Fri, 15 Feb 2013 23:12:33 +0000 (23:12 +0000)]
Suppress a GCC -Wunused-variable warning in -Asserts builds

llvm-svn: 175319

11 years agoFixes in the IRInterpreter:
Sean Callanan [Fri, 15 Feb 2013 23:07:52 +0000 (23:07 +0000)]
Fixes in the IRInterpreter:

- removed an unnecessary variable
- fixed an issue where we sometimes
  wrote too much data into a buffer
- made the recognition of variables
  as "this" a little more conservative

<rdar://problem/13216268>

llvm-svn: 175318

11 years agoc[ms-inline asm] It's possible to have a SizeDirective rewrite and an
Chad Rosier [Fri, 15 Feb 2013 22:54:16 +0000 (22:54 +0000)]
c[ms-inline asm] It's possible to have a SizeDirective rewrite and an
Input/Output rewrite to the same location.  Make sure the SizeDirective rewrite
is performed first.  This also ensure the sort algorithm is stable.

llvm-svn: 175317

11 years agoIf bundle alignment is enabled, do not add data to a fragment with instructions
Derek Schuff [Fri, 15 Feb 2013 22:50:52 +0000 (22:50 +0000)]
If bundle alignment is enabled, do not add data to a fragment with instructions

With bundle alignment, instructions all get their own MCFragments
(unless they are in a bundle-locked group). For instructions with
fixups, this is an MCDataFragment. Emitting actual data (e.g. for
.long) attempts to re-use MCDataFragments, which we don't want int
this case since it leads to fragments which exceed the bundle size.
So, don't reuse them in this case.
Also adds a test and fixes some formatting.

llvm-svn: 175316

11 years agoSupport changing the subtarget features in ARM.
Bill Wendling [Fri, 15 Feb 2013 22:41:25 +0000 (22:41 +0000)]
Support changing the subtarget features in ARM.

llvm-svn: 175315

11 years agoUse the 'target-features' and 'target-cpu' attributes to reset the subtarget features.
Bill Wendling [Fri, 15 Feb 2013 22:31:27 +0000 (22:31 +0000)]
Use the 'target-features' and 'target-cpu' attributes to reset the subtarget features.

If two functions require different features (e.g., `-mno-sse' vs. `-msse') then
we want to honor that, especially during LTO. We can do that by resetting the
subtarget's features depending upon the 'target-feature' attribute.

llvm-svn: 175314

11 years agoAdd test case for r175312.
Chad Rosier [Fri, 15 Feb 2013 21:58:41 +0000 (21:58 +0000)]
Add test case for r175312.

llvm-svn: 175313

11 years ago[ms-inline asm] Adjust the EndLoc to account for the ']'.
Chad Rosier [Fri, 15 Feb 2013 21:58:13 +0000 (21:58 +0000)]
[ms-inline asm] Adjust the EndLoc to account for the ']'.

llvm-svn: 175312

11 years agoForgot to 'svn add' the LoopVectorizer tests for the new parallel loop metadata,...
Pekka Jaaskelainen [Fri, 15 Feb 2013 21:50:19 +0000 (21:50 +0000)]
Forgot to 'svn add' the LoopVectorizer tests for the new parallel loop metadata, sorry.

llvm-svn: 175311

11 years ago[mips] Clean up class MipsCCInfo.
Akira Hatanaka [Fri, 15 Feb 2013 21:45:11 +0000 (21:45 +0000)]
[mips] Clean up class MipsCCInfo.

No functionality change intended.

llvm-svn: 175310

11 years agoImprove test harness for the buildbots
Daniel Malea [Fri, 15 Feb 2013 21:31:37 +0000 (21:31 +0000)]
Improve test harness for the buildbots
- Add a "parsable" mode to dotest.py that outputs test results in exactly the same format as clang's lit tests
- Improve dosep script to output list of failing tests (output should look like clang test failure summaries)
- Cleanup lldb/test/Makefile to remove needless parameters and environment variables
- Switch makefile tests to use parsable-mode output; should make the buildbot results parsable
- Switch makefile tests to use dosep to log catch crashing tests (instead of halting the test suite)

llvm-svn: 175309

11 years agoAdd the 'target-cpu' and 'target-features' attributes to functions.
Bill Wendling [Fri, 15 Feb 2013 21:30:01 +0000 (21:30 +0000)]
Add the 'target-cpu' and 'target-features' attributes to functions.

The back-end will use these values to reconfigure code generation for different
features.

llvm-svn: 175308

11 years agoMore test case cleanup (Linux and Mac):
Daniel Malea [Fri, 15 Feb 2013 21:27:14 +0000 (21:27 +0000)]
More test case cleanup (Linux and Mac):
- remove expectedFailure decorator from resolved rdar 12566646 and 10887661
- remove expectedFailure from TestBitfields testcase not actually affected by bug
- skip the (non-deterministic) TestStopHookMechanism.py to avoid a noisy suite on Linux

llvm-svn: 175307

11 years agocapitalize SCEV to match the current naming convention
Sebastian Pop [Fri, 15 Feb 2013 21:26:53 +0000 (21:26 +0000)]
capitalize SCEV to match the current naming convention

llvm-svn: 175306

11 years agocheck that clang-format exists
Sebastian Pop [Fri, 15 Feb 2013 21:26:50 +0000 (21:26 +0000)]
check that clang-format exists

llvm-svn: 175305

11 years agodon't store a pointer to the loop in IVS
Sebastian Pop [Fri, 15 Feb 2013 21:26:48 +0000 (21:26 +0000)]
don't store a pointer to the loop in IVS

llvm-svn: 175304

11 years agoadd NestLoops to remove some uses of IVS
Sebastian Pop [Fri, 15 Feb 2013 21:26:44 +0000 (21:26 +0000)]
add NestLoops to remove some uses of IVS

llvm-svn: 175303

11 years agocapitalize SCEV to match the current naming convention
Sebastian Pop [Fri, 15 Feb 2013 21:26:36 +0000 (21:26 +0000)]
capitalize SCEV to match the current naming convention

llvm-svn: 175302

11 years agoFix misuse of python subprocess module (caused "leaking" processes and garbling the...
Daniel Malea [Fri, 15 Feb 2013 21:21:52 +0000 (21:21 +0000)]
Fix misuse of python subprocess module (caused "leaking" processes and garbling the terminal)
- fixed cleanup of Popen objects by pushing spawn logic into test Base and out of test cases
- connect subprocess stdin to PIPE (rather than the parent's STDIN) to fix silent terminal issue

Tested on Linux and Mac OS X

llvm-svn: 175301

11 years ago[mips] Split SelectAddr, which was used to match address patterns, into two
Akira Hatanaka [Fri, 15 Feb 2013 21:20:45 +0000 (21:20 +0000)]
[mips] Split SelectAddr, which was used to match address patterns, into two
functions. Set AddedComplexity to determine the order in which patterns are
matched.

This simplifies selection of floating point loads/stores.

No functionality change intended.

llvm-svn: 175300

11 years agolibclang: add clang_getTypeSpelling(CXType CT)
Dmitri Gribenko [Fri, 15 Feb 2013 21:15:49 +0000 (21:15 +0000)]
libclang: add clang_getTypeSpelling(CXType CT)

Adds a function clang_getTypeSpelling(CXType CT) that returns
a CXString containing the underlying type.

Patch by Ben Gertzfield.

llvm-svn: 175299

11 years agoobjective-C: Fixes a compiler crash when encoding
Fariborz Jahanian [Fri, 15 Feb 2013 21:14:50 +0000 (21:14 +0000)]
objective-C: Fixes a compiler crash when encoding
an ivar of type pointer to a typedef'ed object.
// rdar://13190095

llvm-svn: 175298

11 years agoRemove a final dependency on the form field in tablegen; which is a remnant
Reed Kotler [Fri, 15 Feb 2013 21:05:58 +0000 (21:05 +0000)]
Remove a final dependency on the form field in tablegen; which is a remnant
of the old jit and which we don't intend to support in mips16 or micromips.
This dependency is for the testing of whether an instruction is a pseudo.

llvm-svn: 175297

11 years agouse apply and ScevParameterRewriter::rewrite instead of SCEVRewriter
Sebastian Pop [Fri, 15 Feb 2013 20:56:01 +0000 (20:56 +0000)]
use apply and ScevParameterRewriter::rewrite instead of SCEVRewriter

llvm-svn: 175296

11 years agoadd LoopToScev maps
Sebastian Pop [Fri, 15 Feb 2013 20:55:59 +0000 (20:55 +0000)]
add LoopToScev maps

llvm-svn: 175295

11 years agoadd ScevApplyRewriter
Sebastian Pop [Fri, 15 Feb 2013 20:55:36 +0000 (20:55 +0000)]
add ScevApplyRewriter

llvm-svn: 175294

11 years agoadd SCEVParameterRewriter
Sebastian Pop [Fri, 15 Feb 2013 20:55:33 +0000 (20:55 +0000)]
add SCEVParameterRewriter

llvm-svn: 175293

11 years agoAsmParser: Reformat the MS asm parser to reduce nesting.
Benjamin Kramer [Fri, 15 Feb 2013 20:37:21 +0000 (20:37 +0000)]
AsmParser: Reformat the MS asm parser to reduce nesting.

While there postpone register name printing after uniquing.
No intended functionality change.

llvm-svn: 175292

11 years agoRecognize < and > as binary expressions in builder-type calls.
Daniel Jasper [Fri, 15 Feb 2013 20:33:06 +0000 (20:33 +0000)]
Recognize < and > as binary expressions in builder-type calls.

The current heuristic assumes that there can't be binary operators in
builder-type calls (excluding assigments). However, it also excluded
< and > in general, which is wrong. Now they are only excluded if they
are template parameters.

Before:
return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa()i
       .aaaaaa() < aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa();

After:
return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa() <
       aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa();

llvm-svn: 175291

11 years agoRename [Enable|Disable]Breakpoint() to [Enable|Disable]BreakpointSite() in POSIX...
Daniel Malea [Fri, 15 Feb 2013 20:23:25 +0000 (20:23 +0000)]
Rename [Enable|Disable]Breakpoint() to [Enable|Disable]BreakpointSite() in POSIX plugin
- needed due to r175241

llvm-svn: 175290

11 years agoFixed diagnostic nondeterministic order bug (pr14901).
Enea Zaffanella [Fri, 15 Feb 2013 20:09:55 +0000 (20:09 +0000)]
Fixed diagnostic nondeterministic order bug (pr14901).

llvm-svn: 175289

11 years agoPropagate changes through no-op transforms
Edwin Vane [Fri, 15 Feb 2013 19:38:28 +0000 (19:38 +0000)]
Propagate changes through no-op transforms

Currently, changes made by previous transforms are not kept if a transform
doesn't make any changes itself to a given file. Now file states are propagated
properly through transforms that don't make changes.

Fixes: PR15281
Author: Jack Yang <jack.yang@intel.com>
Reviewer: klimek
llvm-svn: 175288

11 years agoLinux test case cleanup:
Daniel Malea [Fri, 15 Feb 2013 19:37:48 +0000 (19:37 +0000)]
Linux test case cleanup:
- Enable TestFormatters.py: expressions with "new" work
- Enable TestChangeValueAPI.py: llvm.org/PR15039 fixed
- Disable expression_command/call-restarts due to llvm.org/PR15278
- Disable expression_command/call-throws due to ObjC test program

llvm-svn: 175287

11 years agoDone break between 'operator' and '<<'.
Daniel Jasper [Fri, 15 Feb 2013 19:24:08 +0000 (19:24 +0000)]
Done break between 'operator' and '<<'.

Before:
ostream &operator
    <<(ostream &out, some::ns::SomeReallyLongType WithSomeReallyLongValue);

After:
ostream &operator<<(ostream &out,
                    some::ns::SomeReallyLongType WithSomeReallyLongValue);

llvm-svn: 175286

11 years ago[ASan] make variables unsigned to silence warnings - attempt 2
Alexey Samsonov [Fri, 15 Feb 2013 19:22:49 +0000 (19:22 +0000)]
[ASan] make variables unsigned to silence warnings - attempt 2

llvm-svn: 175285

11 years ago[ASan] make variable unsigned to silence the warning
Alexey Samsonov [Fri, 15 Feb 2013 19:02:32 +0000 (19:02 +0000)]
[ASan] make variable unsigned to silence the warning

llvm-svn: 175284

11 years agoenable SDISel sincos optimization for GNU environments
Paul Redmond [Fri, 15 Feb 2013 18:45:18 +0000 (18:45 +0000)]
enable SDISel sincos optimization for GNU environments

- add sincos to runtime library if target triple environment is GNU
- added canCombineSinCosLibcall() which checks that sincos is in the RTL and
  if the environment is GNU then unsafe fpmath is enabled (required to
  preserve errno)
- extended sincos-opt lit test

Reviewed by: Hal Finkel

llvm-svn: 175283

11 years agoFix crash-on-invalid where a ParenListExpr shows up as a message receiver
Argyrios Kyrtzidis [Fri, 15 Feb 2013 18:34:15 +0000 (18:34 +0000)]
Fix crash-on-invalid where a ParenListExpr shows up as a message receiver
while trying to do error recovery.

rdar://13207886

llvm-svn: 175282

11 years agoWhen a statement is dropped from the AST because it was invalid, make sure
Argyrios Kyrtzidis [Fri, 15 Feb 2013 18:34:13 +0000 (18:34 +0000)]
When a statement is dropped from the AST because it was invalid, make sure
we don't do the scope checks otherwise we are going to hit assertion checks
since a label may not have been actually added.

llvm-svn: 175281

11 years agoHexagon: Set appropriate TSFlags to the loads/stores with global address to
Jyotsna Verma [Fri, 15 Feb 2013 17:52:07 +0000 (17:52 +0000)]
Hexagon: Set appropriate TSFlags to the loads/stores with global address to
support constant extension.

This patch doesn't introduce any functionality changes.

llvm-svn: 175280

11 years agoAdded missing include.
Greg Clayton [Fri, 15 Feb 2013 17:44:31 +0000 (17:44 +0000)]
Added missing include.

llvm-svn: 175279

11 years agoBBVectorize: Call a DAG and DAG instead of a tree
Hal Finkel [Fri, 15 Feb 2013 17:20:54 +0000 (17:20 +0000)]
BBVectorize: Call a DAG and DAG instead of a tree

Several functions and variable names used the term 'tree' to refer
to what is actually a DAG. Correcting this mistake will, hopefully,
prevent confusion in the future.

No functionality change intended.

llvm-svn: 175278

11 years agoRe-enable ConstructorInitializerAllOnOneLineOrOnePerLine option.
Daniel Jasper [Fri, 15 Feb 2013 16:49:44 +0000 (16:49 +0000)]
Re-enable ConstructorInitializerAllOnOneLineOrOnePerLine option.

This got lost and was untested as the same effect is achieved by
avoiding bin packing, which is active in Google style by default.
However, moving forward, we want more control over the bin packing
option(s) and thus, this flag should work as expected.

llvm-svn: 175277

11 years ago[ASan] Fix https://code.google.com/p/address-sanitizer/issues/detail?id=159
Alexander Potapenko [Fri, 15 Feb 2013 16:10:49 +0000 (16:10 +0000)]
[ASan] Fix https://code.google.com/p/address-sanitizer/issues/detail?id=159
MaybeReexec() does now a tricky job to manage DYLD_INSERT_LIBRARIES in a safe way.

Because we're using library interposition, it's critical for an instrumented app
to be executed with the runtime library present in DYLD_INSERT_LIBRARIES list.
Therefore if it's initially missing in that list, we append the runtime library name
to the value of DYLD_INSERT_LIBRARIES and then exec() ourselves.

On the other hand, some of the apps exec()ed by our program may not want to have
ASan runtime library preloaded, so we remove the runtime library from the
DYLD_INSERT_LIBRARIES if it's already there.

Users may want to preload other libraries using DYLD_INSERT_LIBRARIES, so we preserve those.

llvm-svn: 175276

11 years agoBruce Mitchener: Typo fixes.
Howard Hinnant [Fri, 15 Feb 2013 15:48:49 +0000 (15:48 +0000)]
Bruce Mitchener: Typo fixes.

llvm-svn: 175275

11 years agoBruce Mitchener: Minor typo fixes.
Howard Hinnant [Fri, 15 Feb 2013 15:37:50 +0000 (15:37 +0000)]
Bruce Mitchener: Minor typo fixes.

llvm-svn: 175274

11 years agoFix refactoring mistake in "Teach InstCombine to work with smaller legal types..."
Arnaud A. de Grandmaison [Fri, 15 Feb 2013 15:18:17 +0000 (15:18 +0000)]
Fix refactoring mistake in "Teach InstCombine to work with smaller legal types..."

llvm-svn: 175273

11 years agoSema: Unnest early exit and remove an unnecessary bad cast.
Benjamin Kramer [Fri, 15 Feb 2013 15:17:50 +0000 (15:17 +0000)]
Sema: Unnest early exit and remove an unnecessary bad cast.

cast<ObjCObjectPointerType> doesn't look through sugar, getAs does.
Fixes PR15257.

llvm-svn: 175272

11 years agoAbstract out emitting the vdtor calls and do it properly when using -cxx-abi microsof...
Timur Iskhodzhanov [Fri, 15 Feb 2013 14:45:22 +0000 (14:45 +0000)]
Abstract out emitting the vdtor calls and do it properly when using -cxx-abi microsoft; also fix vdtor calls for the ARM ABI

llvm-svn: 175271

11 years agoTeach InstCombine to work with smaller legal types in icmp (shl %v, C1), C2
Arnaud A. de Grandmaison [Fri, 15 Feb 2013 14:35:47 +0000 (14:35 +0000)]
Teach InstCombine to work with smaller legal types in icmp (shl %v, C1), C2

It enables to work with a smaller constant, which is target friendly for those which can compare to immediates.
It also avoids inserting a shift in favor of a trunc, which can be free on some targets.

This used to work until LLVM-3.1, but regressed with the 3.2 release.

llvm-svn: 175270

11 years agoAArch64: add branch fixup pass.
Tim Northover [Fri, 15 Feb 2013 14:32:20 +0000 (14:32 +0000)]
AArch64: add branch fixup pass.

This is essentially a stripped-down version of the ConstandIslands pass (which
always had these two functions), providing just the features necessary for
correctness.

In particular there needs to be a way to resolve the situation where a
conditional branch's destination block ends up out of range.

This issue crops up when self-hosting for AArch64.

llvm-svn: 175269

11 years agoGive these callbacks hidden visibility. It is better to not export them more
Rafael Espindola [Fri, 15 Feb 2013 14:15:59 +0000 (14:15 +0000)]
Give these callbacks hidden visibility. It is better to not export them more
than we need to and some ELF linkers complain about directly accessing symbols
with default visibility.

llvm-svn: 175268

11 years agoDon't make assumptions about the mangling of static functions in extern "C"
Rafael Espindola [Fri, 15 Feb 2013 14:08:43 +0000 (14:08 +0000)]
Don't make assumptions about the mangling of static functions in extern "C"
blocks. We still don't have consensus if we should try to change clang or
the standard, but llvm should work with compilers that implement the current
standard and mangle those functions.

llvm-svn: 175267

11 years ago[asan] support long double on 64-bit. See https://code.google.com/p/address-sanitizer...
Kostya Serebryany [Fri, 15 Feb 2013 12:46:06 +0000 (12:46 +0000)]
[asan] support long double on 64-bit. See https://code.google.com/p/address-sanitizer/issues/detail?id=151

llvm-svn: 175266

11 years agoMake helper functions static.
Benjamin Kramer [Fri, 15 Feb 2013 12:30:38 +0000 (12:30 +0000)]
Make helper functions static.

llvm-svn: 175265

11 years agoMake helpers static. Add missing include so LLVMInitializeObjCARCOpts gets C linkage.
Benjamin Kramer [Fri, 15 Feb 2013 12:30:38 +0000 (12:30 +0000)]
Make helpers static. Add missing include so LLVMInitializeObjCARCOpts gets C linkage.

llvm-svn: 175264

11 years ago[asan] make asan work with 7fff8000 offset and prelink
Kostya Serebryany [Fri, 15 Feb 2013 12:00:24 +0000 (12:00 +0000)]
[asan] make asan work with 7fff8000 offset and prelink

When prelink is installed in the system, prelink-ed
libraries map between 0x003000000000 and 0x004000000000 thus occupying the shadow Gap,
so we need so split the address space even further, like this:
|| [0x10007fff8000, 0x7fffffffffff] || HighMem    ||
|| [0x02008fff7000, 0x10007fff7fff] || HighShadow ||
|| [0x004000000000, 0x02008fff6fff] || ShadowGap3 ||
|| [0x003000000000, 0x003fffffffff] || MidMem     ||
|| [0x00087fff8000, 0x002fffffffff] || ShadowGap2 ||
|| [0x00067fff8000, 0x00087fff7fff] || MidShadow  ||
|| [0x00008fff7000, 0x00067fff7fff] || ShadowGap  ||
|| [0x00007fff8000, 0x00008fff6fff] || LowShadow  ||
|| [0x000000000000, 0x00007fff7fff] || LowMem     ||

Do it only if necessary.

Also added a bit of profiling code to make sure that the
mapping code is efficient.

Added a lit test to simulate prelink-ed libraries.
Unfortunately, this test does not work with binutils-gold linker.
If gold is the default linker the test silently passes.

Also replaced
__has_feature(address_sanitizer)
with
__has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
in two places.

Patch partially by Jakub Jelinek.

llvm-svn: 175263

11 years agoPrevent only breaking before "?" in conditional expressions.
Daniel Jasper [Fri, 15 Feb 2013 11:07:25 +0000 (11:07 +0000)]
Prevent only breaking before "?" in conditional expressions.

This is almost always more readable.

Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    ? aaaaaaaaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    ? aaaaaaaaaaaaaaaaaaaaaaaaaaa
    : aaaaaaaaaaaaaaaaaaaaaaaaaaa;

llvm-svn: 175262

11 years agoAArch64: remove ConstantIsland pass & put literals in separate section.
Tim Northover [Fri, 15 Feb 2013 09:33:43 +0000 (09:33 +0000)]
AArch64: remove ConstantIsland pass & put literals in separate section.

This implements the review suggestion to simplify the AArch64 backend. If we
later discover that we *really* need the extra complexity of the
ConstantIslands pass for performance reasons it can be resurrected.

llvm-svn: 175258

11 years agoAArch64: refactor frame handling to use movz/movk for overlarge offsets.
Tim Northover [Fri, 15 Feb 2013 09:33:26 +0000 (09:33 +0000)]
AArch64: refactor frame handling to use movz/movk for overlarge offsets.

In the near future litpools will be in a different section, which means that
any access to them is at least two instructions. This makes the case for a
movz/movk pair (if total offset <= 32-bits) even more compelling.

llvm-svn: 175257

11 years agoclang-formatize llvm-symbolizer code
Alexey Samsonov [Fri, 15 Feb 2013 08:54:47 +0000 (08:54 +0000)]
clang-formatize llvm-symbolizer code

llvm-svn: 175255

11 years agoUpdate testcases due to Attribute sorting improvements.
Bill Wendling [Fri, 15 Feb 2013 05:25:49 +0000 (05:25 +0000)]
Update testcases due to Attribute sorting improvements.

llvm-svn: 175253

11 years agoSimplify the 'operator<' for the attribute object.
Bill Wendling [Fri, 15 Feb 2013 05:25:26 +0000 (05:25 +0000)]
Simplify the 'operator<' for the attribute object.

llvm-svn: 175252

11 years agoBBVectorize: Cap the number of candidate pairs in each instruction group
Hal Finkel [Fri, 15 Feb 2013 04:28:42 +0000 (04:28 +0000)]
BBVectorize: Cap the number of candidate pairs in each instruction group

For some basic blocks, it is possible to generate many candidate pairs for
relatively few pairable instructions. When many (tens of thousands) of these pairs
are generated for a single instruction group, the time taken to generate and
rank the different vectorization plans can become quite large. As a result, we now
cap the number of candidate pairs within each instruction group. This is done by
closing out the group once the threshold is reached (set now at 3000 pairs).

Although this will limit the overall compile-time impact, this may not be the best
way to achieve this result. It might be better, for example, to prune excessive
candidate pairs after the fact the prevent the generation of short, but highly-connected
groups. We can experiment with this in the future.

This change reduces the overall compile-time slowdown of the csa.ll test case in
PR15222 to ~5x. If 5x is still considered too large, a lower limit can be
used as the default.

This represents a functionality change, but only for very large inputs
(thus, there is no regression test).

llvm-svn: 175251

11 years agoRevert "Simplify the attributes '<' comparison function."
Anna Zaks [Fri, 15 Feb 2013 04:15:55 +0000 (04:15 +0000)]
Revert "Simplify the attributes '<' comparison function."

This reverts commit 82c101153fe7b35bce48781fab038e1b8f31a7bd.

llvm-svn: 175250

11 years agoRevert "Fix testcase for attribute ordering."
Anna Zaks [Fri, 15 Feb 2013 04:15:53 +0000 (04:15 +0000)]
Revert "Fix testcase for attribute ordering."

This reverts commit 58f20a3cbfca7384fe5e25e095f18572736a4792.

llvm-svn: 175249

11 years agoRevert "Fix testcase for attribute ordering."
Anna Zaks [Fri, 15 Feb 2013 04:15:50 +0000 (04:15 +0000)]
Revert "Fix testcase for attribute ordering."

This reverts commit 997c6516ca161073a1d516ebca7c0ca7722f64e2.

llvm-svn: 175248

11 years agoOnly enable RTTI for cxa_demangle.cpp
Filipe Cabecinhas [Fri, 15 Feb 2013 02:36:40 +0000 (02:36 +0000)]
Only enable RTTI for cxa_demangle.cpp

If testing on Linux+clang proves it needs RTTI, wa can remove the
conditionals.

llvm-svn: 175242

11 years agoA little cleanup. {Disable/Enable}Breakpoint actually disables/enables BreakpointSit...
Jim Ingham [Fri, 15 Feb 2013 02:06:30 +0000 (02:06 +0000)]
A little cleanup.  {Disable/Enable}Breakpoint actually disables/enables BreakpointSites not breakpoints, it is confusing
to have it not named appropriately.  Also in StopInfoMachException, we aren't testing for software or not software, just
whether the thing is a breakpoint we set.  So don't use "software"...

llvm-svn: 175241

11 years ago[analyzer] Don't assert when mixing reinterpret_cast and derived-to-base casts.
Jordan Rose [Fri, 15 Feb 2013 01:23:24 +0000 (01:23 +0000)]
[analyzer] Don't assert when mixing reinterpret_cast and derived-to-base casts.

This just adds a very simple check that if a DerivedToBase CastExpr is
operating on a value with known C++ object type, and that type is not the
base type specified in the AST, then the cast is invalid and we should
return UnknownVal.

In the future, perhaps we can have a checker that specifies that this is
illegal, but we still shouldn't assert even if the user turns that checker
off.

PR14872

llvm-svn: 175239

11 years agoFix testcase for attribute ordering.
Bill Wendling [Fri, 15 Feb 2013 01:04:46 +0000 (01:04 +0000)]
Fix testcase for attribute ordering.

llvm-svn: 175238

11 years agoFix minor mips16 issues in directives for function prologue. Probably this does
Reed Kotler [Fri, 15 Feb 2013 01:04:38 +0000 (01:04 +0000)]
Fix minor mips16 issues in directives for function prologue. Probably this does
not matter but makes it more gcc compatible which avoids possible subtle
problems. Also, turned back on a disabled check in helloworld.ll.

llvm-svn: 175237

11 years agoFix testcase for attribute ordering.
Bill Wendling [Fri, 15 Feb 2013 00:58:25 +0000 (00:58 +0000)]
Fix testcase for attribute ordering.

llvm-svn: 175236

11 years agoSimplify the attributes '<' comparison function.
Bill Wendling [Fri, 15 Feb 2013 00:55:08 +0000 (00:55 +0000)]
Simplify the attributes '<' comparison function.

llvm-svn: 175235

11 years agoRe-apply "[analyzer] Model trivial copy/move ctors with an aggregate bind."
Jordan Rose [Fri, 15 Feb 2013 00:32:15 +0000 (00:32 +0000)]
Re-apply "[analyzer] Model trivial copy/move ctors with an aggregate bind."

...after a host of optimizations related to the use of LazyCompoundVals
(our implementation of aggregate binds).

Originally applied in r173951.
Reverted in r174069 because it was causing hangs.
Re-applied in r174212.
Reverted in r174265 because it was /still/ causing hangs.

If this needs to be reverted again it will be punted to far in the future.

llvm-svn: 175234

11 years ago[analyzer] Cache the bindings accessible through a LazyCompoundVal.
Jordan Rose [Fri, 15 Feb 2013 00:32:12 +0000 (00:32 +0000)]
[analyzer] Cache the bindings accessible through a LazyCompoundVal.

This means we don't have to recompute them all later for every
removeDeadSymbols check.

llvm-svn: 175233

11 years ago[analyzer] Scan the correct store when finding symbols in a LazyCompoundVal.
Jordan Rose [Fri, 15 Feb 2013 00:32:10 +0000 (00:32 +0000)]
[analyzer] Scan the correct store when finding symbols in a LazyCompoundVal.

Previously, we were scanning the current store. Now, we properly scan the
store that the LazyCompoundVal came from, which may have very different
live symbols.

llvm-svn: 175232

11 years ago[analyzer] Tweak LazyCompoundVal reuse check to ignore qualifiers.
Jordan Rose [Fri, 15 Feb 2013 00:32:08 +0000 (00:32 +0000)]
[analyzer] Tweak LazyCompoundVal reuse check to ignore qualifiers.

This is optimization only; no behavioral change.

llvm-svn: 175231

11 years ago[analyzer] Use collectSubRegionKeys to make removeDeadBindings faster.
Jordan Rose [Fri, 15 Feb 2013 00:32:06 +0000 (00:32 +0000)]
[analyzer] Use collectSubRegionKeys to make removeDeadBindings faster.

Previously, whenever we had a LazyCompoundVal, we crawled through the
entire store snapshot looking for bindings within the LCV's region. Now, we
just ask for the subregion bindings of the lazy region and only visit those.

This is an optimization (so no test case), but it may allow us to clean up
more dead bindings than we were previously.

llvm-svn: 175230

11 years agoDaniel Malea caught an issue where calling dotest.py with an invalid directory would...
Enrico Granata [Fri, 15 Feb 2013 00:32:05 +0000 (00:32 +0000)]
Daniel Malea caught an issue where calling dotest.py with an invalid directory would cause the progressbar init code to raise an exception
This commit fixes it

llvm-svn: 175229

11 years ago[analyzer] Refactor RegionStore's sub-region bindings traversal.
Jordan Rose [Fri, 15 Feb 2013 00:32:03 +0000 (00:32 +0000)]
[analyzer] Refactor RegionStore's sub-region bindings traversal.

This is going to be used in the next commit.
While I'm here, tighten up assumptions about symbolic offset
BindingKeys, and make offset calculation explicitly handle all
MemRegion kinds.

No functionality change.

llvm-svn: 175228

11 years ago<rdar://problem/13204647>
Enrico Granata [Fri, 15 Feb 2013 00:06:04 +0000 (00:06 +0000)]
<rdar://problem/13204647>

The SEL data formatter was working hard to ensure that pointers-to-selectors could be formatted by the same block of code. In that effort, we were taking the address-of a SEL.
This operation fails when the SEL lives in a register, and was causing problems.
The formatter has been fixed to work correctly without assuming &selector will be a valid object.

llvm-svn: 175227

11 years ago[mips] Disallow moving load/store instructions past volatile instructions.
Akira Hatanaka [Thu, 14 Feb 2013 23:54:40 +0000 (23:54 +0000)]
[mips] Disallow moving load/store instructions past volatile instructions.

Unfortunately, I wasn't able to create a test case that demonstrates the
problem I was trying to fix with this patch.

llvm-svn: 175226

11 years ago[mips] Replace usage of SmallSet with BitVector, which is used to keep track of
Akira Hatanaka [Thu, 14 Feb 2013 23:40:57 +0000 (23:40 +0000)]
[mips] Replace usage of SmallSet with BitVector, which is used to keep track of
defined and used registers. Also add a few helper functions to simplify the
code.

llvm-svn: 175224