Commit Graph

125364 Commits

Author SHA1 Message Date
Kaelyn Uhrain cb5b585cca Fix the build breakage introduced by r154131.
The empty 1-argument operator delete is for the benefit of the
destructor. A couple of spot checks of running yaml-bench under
valgrind against a few of the files under test/YAMLParser did
not reveal any leaks introduced by this change.

llvm-svn: 154137
2012-04-05 23:06:17 +00:00
Eli Friedman c1f0d5b873 Implement C90 pedantic warning for duplicate declaration specifiers which are duplicated via a typedef. Patch by Tim Northover.
llvm-svn: 154136
2012-04-05 22:47:34 +00:00
Eli Friedman 57a75390fc Properly implement the C rules for composite types for qualified pointers in conditionals. Patch by Tim Northover.
llvm-svn: 154134
2012-04-05 22:30:04 +00:00
Fariborz Jahanian c806b90717 objective-c: Don't warn when a category does not implement a method
declared in its adopted protocol when another category declares it  
because that category will implement it. // rdar://11186449

llvm-svn: 154132
2012-04-05 22:14:12 +00:00
Kaelyn Uhrain 64aa24e13f Really fix -Wnon-virtual-dtor warnings; gcc needs the dtors to be
explicitly marked as virtual.

llvm-svn: 154131
2012-04-05 22:11:12 +00:00
Eric Christopher c465ce9e79 Enhance testing a bit to make sure that we're omitting the
getter and setter when they're synthesized with the default
names.

rdar://11179756

llvm-svn: 154130
2012-04-05 22:03:35 +00:00
Eric Christopher f3dd713bce Only emit the getter and setter names if they're not the default
synthesized ones. Reasonable debug info size reduction for objc.

rdar://11179756

llvm-svn: 154129
2012-04-05 22:03:32 +00:00
Eli Friedman 1fa36050ab Make the variant of __builtin_shufflevector that takes the shuffle indexes as a vector actually usable. Patch by David Neto. PR12465.
llvm-svn: 154128
2012-04-05 21:48:40 +00:00
Bill Wendling 4f60125dd8 The internalize pass can be dangerous for LTO.
Consider the following program:

$ cat main.c
void foo(void) { }

int main(int argc, char *argv[]) {
    foo();
    return 0;
}
$ cat bundle.c 
extern void foo(void);

void bar(void) {
     foo();
}
$ clang -o main main.c
$ clang -o bundle.so bundle.c -bundle -bundle_loader ./main
$ nm -m bundle.so
0000000000000f40 (__TEXT,__text) external _bar
                 (undefined) external _foo (from executable)
                 (undefined) external dyld_stub_binder (from libSystem)
$ clang -o main main.c -O4
$ clang -o bundle.so bundle.c -bundle -bundle_loader ./main
Undefined symbols for architecture x86_64:
  "_foo", referenced from:
      _bar in bundle-elQN6d.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The linker was told that the 'foo' in 'main' was 'internal' and had no uses, so
it was dead stripped.

Another situation is something like:

define void @foo() {
  ret void
}

define void @bar() {
  call asm volatile "call _foo" ...
  ret void
}

The only use of 'foo' is inside of an inline ASM call. Since we don't look
inside those for uses of functions, we don't specify this as a "use."

Get around this by not invoking the 'internalize' pass by default. This is an
admitted hack for LTO correctness.
<rdar://problem/11185386>

llvm-svn: 154124
2012-04-05 21:26:44 +00:00
Jim Grosbach 930f2f66e7 ARM assembly aliases for add negative immediates using sub.
'add r2, #-1024' should just use 'sub r2, #1024' rather than erroring out.
Thumb1 aliases for adding a negative immediate to the stack pointer,
also.

rdar://11192734

llvm-svn: 154123
2012-04-05 20:57:13 +00:00
Akira Hatanaka 43fb2b2cea Reapply test case in 154038, this time with triple to prevent the backend
from emitting gp_rel relocation.

llvm-svn: 154122
2012-04-05 20:44:35 +00:00
Ted Kremenek b45d198b6f Require that all static analyzer issues have a category. As part of this change,
consolidate some commonly used category strings into global references (more of this can be done, I just did a few).

Fixes <rdar://problem/11191537>.

llvm-svn: 154121
2012-04-05 20:43:28 +00:00
Eric Christopher aec8a82694 Patch to set is_stmt a little better for prologue lines in a function.
This enables debuggers to see what are interesting lines for a
breakpoint rather than any line that starts a function.

rdar://9852092

llvm-svn: 154120
2012-04-05 20:39:05 +00:00
Jakob Stoklund Olesen 37492eac8c Don't break the IV update in TLI::SimplifySetCC().
LSR always tries to make the ICmp in the loop latch use the incremented
induction variable. This allows the induction variable to be kept in a
single register.

When the induction variable limit is equal to the stride,
SimplifySetCC() would break LSR's hard work by transforming:

   (icmp (add iv, stride), stride) --> (cmp iv, 0)

This forced us to use lea for the IC update, preventing the simpler
incl+cmp.

<rdar://problem/7643606>
<rdar://problem/11184260>

llvm-svn: 154119
2012-04-05 20:30:20 +00:00
Dan Gohman cc64bbca81 Fix accidentally inverted logic from r152803, and make the
testcase slightly less trivial. This fixes rdar://11171718.

llvm-svn: 154118
2012-04-05 20:27:21 +00:00
Sylvestre Ledru e8235fef31 Fix a problem in the target detection for Debian GNU/HURD
llvm-svn: 154117
2012-04-05 19:34:15 +00:00
Simon Atanasyan 26f19678b6 Move some MIPS target macro definitions from class Mips32TargetInfoBase
to the base class MipsTargetInfoBase. These macros are applicable for both
32/64-bits targets.

llvm-svn: 154116
2012-04-05 19:28:31 +00:00
Richard Smith d8b8effa6e Temporary workaround for bug#12457: turn the 'constexpr function never produces
a constant expression' error into a DefaultError ExtWarn, so that it can be
disabled and is suppressed in system headers. libstdc++4.7 contains some such
functions which we currently can't evaluate as constant expressions.

llvm-svn: 154115
2012-04-05 18:57:10 +00:00
Sylvestre Ledru 4cf7dae516 Fix a problem in the target detection for Debian GNU/kFreeBSD
llvm-svn: 154114
2012-04-05 18:53:09 +00:00
Owen Anderson a6eebf6013 Treat f16 the same as f80/f128 for the purposes of generating constants during instruction selection.
llvm-svn: 154113
2012-04-05 18:50:32 +00:00
Timur Iskhodzhanov 889a3009a4 [ASan/Win] Revert the local Makefile change slipped into the prev commit
llvm-svn: 154112
2012-04-05 18:33:17 +00:00
Timur Iskhodzhanov 7d2776960b [ASan/Win] Fix lint warning
llvm-svn: 154111
2012-04-05 18:31:50 +00:00
Greg Clayton d84cec07c9 Enable building the POSIX-DYLD dynamic loader plug-in in the Makefile build since it can be used for remote debugging.
llvm-svn: 154109
2012-04-05 17:43:02 +00:00
Bill Wendling e50ab408e5 Revert r154086. It may be needed for Darwin. But the symbols are still missing in the dylib.
llvm-svn: 154108
2012-04-05 17:38:07 +00:00
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