Commit Graph

125340 Commits

Author SHA1 Message Date
Timur Iskhodzhanov 0881092306 [ASan/Win] Fix build by using inline assembly instead of an unavailable intrinsic function
llvm-svn: 154106
2012-04-05 17:16:32 +00:00
Daniel Dunbar 3c9bc4dbdb [Lex] Add support for 'user specified system frameworks' (see test case).
- Developers of system frameworks need a way for their framework to be treated as a "system framework" during development. Otherwise, they are unable to properly test how their framework behaves when installed because of the semantic changes (in warning behavior) applied to system frameworks.

llvm-svn: 154105
2012-04-05 17:10:06 +00:00
Daniel Dunbar 17138613b1 [Lex] HeaderSearch: Introduce a FrameworkCacheEntry structure to hold the FrameworkMap items.
- No functionality change.

llvm-svn: 154104
2012-04-05 17:09:40 +00:00
Daniel Dunbar 328001a14a Simplify.
llvm-svn: 154103
2012-04-05 17:09:11 +00:00
David Blaikie 3a7efa2240 Improve & simplify diagnostic for missing 'class' in template template parameter.
Change suggested by Sebastian Redl on review feedback from r153887.

llvm-svn: 154102
2012-04-05 16:56:02 +00:00
Silviu Baranga af3c79f0ac Added support for unpredictable ADC/SBC instructions on ARM, and also fixed some corner cases involving the PC register as an operand for these instructions.
llvm-svn: 154101
2012-04-05 16:19:29 +00:00
Silviu Baranga d365397daa Added support for handling unpredictable arithmetic instructions on ARM.
llvm-svn: 154100
2012-04-05 16:13:15 +00:00
Greg Clayton 7fdf9ef15d Added a new Host class: ReadWriteLock
This abstracts read/write locks on the current host system. It is currently backed by pthread_rwlock_t objects so it should work on all unix systems.

We also need a way to control multi-threaded access to the process through the public API when it is running. For example it isn't a good idea to try and get stack frames while the process is running. To implement this, the lldb_private::Process class now contains a ReadWriteLock member variable named m_run_lock which is used to control the public process state. The public process state represents the state of the process as the client knows it. The private is used to control the actual current process state. So the public state of the process can be stopped, yet the private state can be running when evaluating an expression for example. 

Adding the read/write lock where readers are clients that want the process to stay stopped, and writers are clients that run the process, allows us to accurately control multi-threaded access to the process.

Switched the SBThread and SBFrame over to us shared pointers to the ExecutionContextRef class instead of making their own class to track this. This fixed an issue with assigning on SBFrame to another and will also centralize the code that tracks weak references to execution context objects into one location.

llvm-svn: 154099
2012-04-05 16:12:35 +00:00
Hongbin Zheng 31d33b8318 BBVectorize: Add the const modifier to the VectorizeConfig because we won't
modify it.

llvm-svn: 154098
2012-04-05 16:07:49 +00:00
Kostya Serebryany 7a8f5e4d1e [asan] make __asan::Deallocate immune to racy double-free (issue #57)
llvm-svn: 154097
2012-04-05 15:55:09 +00:00
Hongbin Zheng d6825173d3 Introduce the VectorizeConfig class, with which we can control the behavior
of the BBVectorizePass without using command line option. As pointed out
  by Hal, we can ask the TargetLoweringInfo for the architecture specific
  VectorizeConfig to perform vectorizing with architecture specific
  information.

llvm-svn: 154096
2012-04-05 15:46:55 +00:00
David Chisnall 4fa71de024 Fix the remaining atomic tests, all of which were wrong for the case where a
compare-and-exchange failed (it should update the expected value to the current
value, and the tests were checking that it didn't...).

Results of the atomics part of the test suite on FreeBSD with clang trunk and
the atomic.c from compiler-rt (currently kludged into the test, not installed
properly):

****************************************************
Results for /root/libc++/test/atomics:
using clang version 3.1 (trunk 153415)
Target: x86_64-unknown-freebsd10.0
Thread model: posix
with -std=c++0x -stdlib=libc++ -pthread /tmp/atomic.o  
----------------------------------------------------
sections without tests   : 0
sections with failures   : 0
sections without failures: 14
                       +   ----
total number of sections : 14
----------------------------------------------------
number of tests failed   : 0
number of tests passed   : 52
                       +   ----
total number of tests    : 52
****************************************************

Yay!

llvm-svn: 154095
2012-04-05 13:48:16 +00:00
David Chisnall ca917f5342 Fix test cases that were trying to make atomic things that are not trivially copyable.
Now all of the test cases compile.  Some of them even run!

llvm-svn: 154094
2012-04-05 13:23:08 +00:00
David Chisnall c5d5a98815 Fix use of __atomic_is_lock_free() intrinsic.
llvm-svn: 154093
2012-04-05 13:13:24 +00:00
Alexander Potapenko 08342aa1a1 Introduce the use_sigaltstack flag (off by default), which enables using alternate
per-thread stacks for signal handling. This allows to print more verbose error reports
for stack overflows.

llvm-svn: 154092
2012-04-05 10:54:52 +00:00
Alexander Potapenko 44016da83f Allow calling GetCurrentTidOrMinusOne() before AsanThreadRegistry was initialized.
llvm-svn: 154091
2012-04-05 10:10:57 +00:00
James Molloy 1ea6473688 An oversight when applying the patches for r150956 and r150957 to a vanilla tree meant I forgot to svn add these testcases.
Noticed while investigating PR12274!

llvm-svn: 154090
2012-04-05 10:01:12 +00:00
Hongbin Zheng 6edbc39bd7 Add the function "vectorizeBasicBlock" which allow users vectorize a
BasicBlock in other passes, e.g. we can call vectorizeBasicBlock in the
 loop unroll pass right after the loop is unrolled.

llvm-svn: 154089
2012-04-05 08:05:16 +00:00
Jim Grosbach 15c6884a4b ARM assembly aliases for two-operand V[R]SHR instructions.
rdar://11189467

llvm-svn: 154087
2012-04-05 07:23:53 +00:00
Bill Wendling e914660c0d The DynamicLoaderPOSIXDYLD calls aren't available on Apple systems.
llvm-svn: 154086
2012-04-05 06:21:02 +00:00
Bill Wendling de59fb02b9 Add Security framework to the list of frameworks needed for linking.
llvm-svn: 154085
2012-04-05 06:20:13 +00:00
Ted Kremenek 34ac1cf3cd Handle symbolicating a reference in an initializer expression that we don't understand.
llvm-svn: 154084
2012-04-05 05:56:31 +00:00
Ted Kremenek 00fa5968cb Teach ObjCContainersChecker that the array passed to CFArrayGetValueAtIndex might not be a symbolic value.
llvm-svn: 154083
2012-04-05 05:18:05 +00:00
Argyrios Kyrtzidis ef909265e8 In MemoryBuffer::getOpenFile() make sure that the buffer is null-terminated if
the caller requested a null-terminated one.

When mapping the file there could be a racing issue that resulted in the file being larger
than the FileSize passed by the caller. We already have an assertion
for this in MemoryBuffer::init() but have a runtime guarantee that
the buffer will be null-terminated, so do a copy that adds a null-terminator.

Protects against crash of rdar://11161822.

llvm-svn: 154082
2012-04-05 04:23:56 +00:00
Ted Kremenek 504957f413 Do not crash in the callgraph construction when encountering deleted function definitions. Fixes <rdar://problem/11178609>.
llvm-svn: 154081
2012-04-05 04:03:23 +00:00
Jim Grosbach 3d00eecc53 ARM assembly parsing for 'msr' plain 'cpsr' operand.
Plain 'cpsr' is an alias for 'cpsr_fc'.

rdar://11153753

llvm-svn: 154080
2012-04-05 03:17:53 +00:00
Jakob Stoklund Olesen f2390e8303 Pass the right sign to TLI->isLegalICmpImmediate.
LSR can fold three addressing modes into its ICmpZero node:

  ICmpZero BaseReg + Offset      => ICmp BaseReg, -Offset
  ICmpZero -1*ScaleReg + Offset  => ICmp ScaleReg, Offset
  ICmpZero BaseReg + -1*ScaleReg => ICmp BaseReg, ScaleReg

The first two cases are only used if TLI->isLegalICmpImmediate() likes
the offset.

Make sure the right Offset sign is passed to this method in the second
case. The ARM version is not symmetric.

<rdar://problem/11184260>

llvm-svn: 154079
2012-04-05 03:10:56 +00:00
Anna Zaks 8382e4547f [analyzer] Move stats calculation out of AnalysisConsumer destructor.
The ASTConsumer does not get deleted with clang --analyze (for
performance reasons), we still want the diagnostics to work.

llvm-svn: 154078
2012-04-05 02:10:21 +00:00
Anna Zaks 67c83d247e [analyzer] Change warding in a path diagnostic:
"No method actually called because receiver is nil" ->
"No method is called because receiver is nil"

llvm-svn: 154077
2012-04-05 02:10:19 +00:00
Anna Zaks 5720600798 [analyzer] Add a coverage calculation to FunctionSummaries.
llvm-svn: 154076
2012-04-05 02:10:17 +00:00
Anna Zaks e70eea0234 [analyzer] Remove redundant if statement (pointed out by Ted).
llvm-svn: 154075
2012-04-05 02:10:14 +00:00
Sean Callanan a03156fc66 Tolerate decimal points in the LLDB version number.
They are truncated when generating the version
numbers seen in the headers, so for example
lldb-100.1 would have #define LLDB_VERSION=100

llvm-svn: 154074
2012-04-05 01:30:56 +00:00
Richard Smith fa0a1f531f Improve diagnostics for invalid use of non-static members / this:
* s/nonstatic/non-static/ in the diagnostics, since the latter form outvoted
  the former by 28-2 in our diagnostics.
* Fix the "use of member in static member function" diagnostic to correctly
  detect this situation inside a block or lambda.
* Produce a more specific "invalid use of non-static member" diagnostic for
  the case where a nested class member refers to a member of a
  lexically-surrounding class.

llvm-svn: 154073
2012-04-05 01:13:04 +00:00
Richard Smith 3cbdeba61a Add triples to these tests to keep them working on Windows,
where wchar_t is only 16 bits wide.

llvm-svn: 154072
2012-04-05 00:54:51 +00:00
David Blaikie 174ca49180 RelNote improvements made to -Wliteral-conversion by r141955.
llvm-svn: 154071
2012-04-05 00:47:38 +00:00
Bob Wilson 1864146ab7 Do not include multiple -arch options in CPPFLAGS.
llvm-svn: 154070
2012-04-05 00:35:55 +00:00
Richard Smith 7ba85c3e78 Fix assertions and wrong output from StmtPrinter's string literal printing.
String literals (including unicode ones) can contain non-Unicode codepoints
if they were written using \x or similar. Write those out using \x, but be
careful that the following character can't be misinterpreted as part of the
\x escape sequence. Convert UTF-16 surrogate pairs back to codepoints before
rendering them.

llvm-svn: 154069
2012-04-05 00:17:44 +00:00
David Blaikie 09ffc9b473 Enable warn_impcast_literal_float_to_integer by default.
This diagnostic seems to be production ready, it's just an oversight that it
wasn't turned on by default.

The test changes are a bit of a mixed bag. Some tests that seemed like they
clearly didn't need to use this behavior have been modified not to use it.
Others that I couldn't be sure about, I added the necessary expected-warnings
to.

It's possible the diagnostic message could be improved to make it clearer that
this warning can be suppressed by using a value that won't lose precision when
converted to the target type (but can still be a floating point literal, such
as "bool b = 1.0;").

llvm-svn: 154068
2012-04-05 00:16:44 +00:00
Sean Callanan a658226ac0 Fixed a problem where we did not read properties
correctly if the setter/getter were not present
in the debug information.  The fixes are as follows:

- We not only look for the method by its full name,
  but also look for automatically-generated methods
  when searching for a selector in an Objective-C
  interface.  This is necessary to find accessors.

- Extract the getter and setter name from the
  DW_TAG_APPLE_Property declaration in the DWARF
  if they are present; generate them if not.

llvm-svn: 154067
2012-04-05 00:12:52 +00:00
NAKAMURA Takumi 2b9219eea1 clang/test/Tooling/clang-check.cpp: Mark it as XFAIL also on cygwin.
It seems clang-check doesn't like gcc driver on cygming. Investigating.

llvm-svn: 154066
2012-04-04 23:23:19 +00:00
Douglas Gregor 0f5c1c0127 Allow a conversion from the empty initializer list {} to an
std::initializer_list<T> so long as <T> is known. This conversion has
identity rank.

llvm-svn: 154065
2012-04-04 23:09:20 +00:00
Nico Weber bea0d04f8c Honor -fno-pic, -fno-PIC, -fno-pie, -fno-PIE.
Review at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120402/055759.html

llvm-svn: 154064
2012-04-04 23:00:14 +00:00
Michael J. Spencer b2d30b8699 Fix -Wnon-virtual-dtor warnings.
llvm-svn: 154063
2012-04-04 22:34:55 +00:00
Akira Hatanaka 121342fcc2 Reapply 154038 without the failing test.
llvm-svn: 154062
2012-04-04 22:16:36 +00:00
Chad Rosier 45619cbc03 [driver] When using the -mfpmath= option, add an error message when trying to
enable neonfp on a CPU that doesn't support NEON.
rdar://11108618

llvm-svn: 154061
2012-04-04 22:13:40 +00:00
Chandler Carruth 1f5d5c0e13 Initial, very rough cut at a new CMake build system for compiler-rt.
Some high-level notes:

1) An explicit goal is to support building compiler-rt as a subproject
   build, checked out into the projects/compiler-rt directory. There are
   many other possible ways of building the code here, but this is
   optimized for development on LLVM/Clang/compiler-rt, and incremental
   trial and testing of the toolchain.
2) The current support is targeted at Linux. I would love to see this
   generalized to other platforms, but for the sake of simplicity in
   testing, I'm focusing here first.

Much of this patch was paired with Manuel, and I credit him with the
majority of the work here.

Some important caveats that I'll be working on in subsequent patches:

1) This uses the host compiler rather than using the just-built-clang.
2) Currently only x86 is supported.
3) Currently, none of the tests are built or run.
4) Uses CMake's builtin globbing which doesn't update correctly.
5) This is still turned off from LLVM's CMake build until these issues
   are addressed

llvm-svn: 154060
2012-04-04 22:12:04 +00:00
Chandler Carruth 6acfaaf3aa Remove the old, and non-functional CMake build system from CompilerRT.
I cannot build any part of this successfully on either Linux or Darwin,
and the replacement is worlds simpler by requiring that this be built as
a subproject of LLVM. If this breaks you for any reason, please let me
know, and let me know what your use case is.

llvm-svn: 154059
2012-04-04 22:12:01 +00:00
Richard Smith 60f4f86a79 Hardcode a triple to prevent the test failing on targets which don't support __thread.
llvm-svn: 154058
2012-04-04 21:54:03 +00:00
Simon Atanasyan fa4dbbf12a Test commit to check commit access.
llvm-svn: 154056
2012-04-04 21:22:57 +00:00
Bill Wendling c359aafc55 Order the initializations so that they reflect how they're declared in the class.
llvm-svn: 154055
2012-04-04 21:19:57 +00:00