Aaron Ballman [Thu, 21 Mar 2013 20:12:19 +0000 (20:12 +0000)]
This ugly regex is required because on Windows, the paths come out as \\ delimited instead of / delimited. Fixes a test breakage since r176894.
llvm-svn: 177658
Benjamin Kramer [Thu, 21 Mar 2013 19:47:38 +0000 (19:47 +0000)]
Remove unused variable.
llvm-svn: 177657
Benjamin Kramer [Thu, 21 Mar 2013 19:45:46 +0000 (19:45 +0000)]
Avoid warnings from compilers that think you can drop off the end of a fully covered switch.
llvm-svn: 177656
Aaron Ballman [Thu, 21 Mar 2013 19:38:59 +0000 (19:38 +0000)]
Delayed template parsing is not supported by the AST serialization system yet, so turning it off. This fixes a test breakage caused by r177336.
llvm-svn: 177655
Hal Finkel [Thu, 21 Mar 2013 19:03:21 +0000 (19:03 +0000)]
Add support for spilling VRSAVE on PPC
Although there is only one Altivec VRSAVE register, it is a member of
a register class, and we need the ability to spill it. Because this
register is normally callee-preserved and handled by special code this
has never before been necessary. However, this capability will be required by
a forthcoming commit adding SjLj support.
llvm-svn: 177654
Hal Finkel [Thu, 21 Mar 2013 19:03:19 +0000 (19:03 +0000)]
Correct PPC FRAMEADDR lowering using a pseudo-register
The old code used to lower FRAMEADDR tried to replicate the logic in the real
frame-lowering code that determines whether or not the frame pointer (r31) will
be used. When it seemed as through the frame pointer would not be used, the
stack pointer (r1) was used instead. Unfortunately, because the stack size is
not yet known, this does not work. Instead, this change introduces new
always-reserved pseudo-registers (FP and FP8) that are replaced during prologue
insertion with the real frame-pointer register (either r1 or r31).
It is important that this intrinsic always return a valid frame address because
it is used by Clang to store the frame address as part of code generation for
__builtin_setjmp.
llvm-svn: 177653
Renato Golin [Thu, 21 Mar 2013 18:47:47 +0000 (18:47 +0000)]
Avoid NEON SP-FP unless unsafe-math or Darwin
NEON is not IEEE 754 compliant, so we should avoid lowering single-precision
floating point operations with NEON unless unsafe-math is turned on. The
equivalent VFP instructions are IEEE 754 compliant, but in some cores they're
much slower, so some archs/OSs might still request it to be on by default,
such as Swift and Darwin.
llvm-svn: 177651
Bill Wendling [Thu, 21 Mar 2013 18:30:10 +0000 (18:30 +0000)]
Update some EH tests that were violating the new EH model.
The landingpad instruction needs to be the first non-PHI instruction in the
unwind destination block.
llvm-svn: 177650
Jordan Rose [Thu, 21 Mar 2013 18:16:59 +0000 (18:16 +0000)]
[analyzer] Print return values from debug.DumpCalls checker.
Debug utility only, no functionality change.
llvm-svn: 177649
Dmitry Vyukov [Thu, 21 Mar 2013 16:55:17 +0000 (16:55 +0000)]
tsan: better reporting of thread leaks
1. do not report running threads as leaks
2. aggregate leaked threads by creation stack
llvm-svn: 177647
Jim Ingham [Thu, 21 Mar 2013 16:48:24 +0000 (16:48 +0000)]
The outline of the stepping perf test case, doesn't do anything yet.
llvm-svn: 177646
Tobias Grosser [Thu, 21 Mar 2013 16:14:55 +0000 (16:14 +0000)]
Add failing test case
llvm-svn: 177645
Tobias Grosser [Thu, 21 Mar 2013 16:14:53 +0000 (16:14 +0000)]
Do not canonicalize indvars with scev based codegen
Scev code generation can now handle scops with non canonical induction
variables. Hence there is no need to introduce canonical ones any more.
llvm-svn: 177644
Tobias Grosser [Thu, 21 Mar 2013 16:14:50 +0000 (16:14 +0000)]
Remove last uses of canoncial induction variable when scev code generating
We now detect scops without a canonical induction variable and can generate a
polyhedral representation for them. There was no modification necessary to
code generate these scops.
llvm-svn: 177643
Tobias Grosser [Thu, 21 Mar 2013 16:14:45 +0000 (16:14 +0000)]
TempScop: Make assert more descriptive
llvm-svn: 177642
Dmitry Vyukov [Thu, 21 Mar 2013 15:37:39 +0000 (15:37 +0000)]
tsan: better reporting for races on vptr
explicitly say "ctor/dtor vs virtual call"
llvm-svn: 177640
Dmitry Vyukov [Thu, 21 Mar 2013 13:01:50 +0000 (13:01 +0000)]
tsan: add flag to control symbolizer flush frequency
llvm-svn: 177638
Dmitry Vyukov [Thu, 21 Mar 2013 12:50:43 +0000 (12:50 +0000)]
tsan: intercept abort() to fflush() libc streams
llvm-svn: 177637
Dmitry Vyukov [Thu, 21 Mar 2013 12:44:44 +0000 (12:44 +0000)]
tsan: remove bogus CHECK
Asynchronous signal (e.g. SIGABRT) can be received with any value of in_rtl.
llvm-svn: 177636
Alexander Kornienko [Thu, 21 Mar 2013 12:28:10 +0000 (12:28 +0000)]
Better block comment formatting.
Summary:
1. When splitting one-line block comment, use indentation and *s.
2. Remove trailing whitespace from all lines of a comment, not only the ones being splitted.
3. Add backslashes for all lines if a comment is used insed a preprocessor directive.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D557
llvm-svn: 177635
Alexey Samsonov [Thu, 21 Mar 2013 11:23:41 +0000 (11:23 +0000)]
[ASan] Switch ASan to generic ThreadRegistry from sanitizer_common. Delete ASan-specific AsanThreadRegistry.
llvm-svn: 177634
Alexander Potapenko [Thu, 21 Mar 2013 10:49:06 +0000 (10:49 +0000)]
[ASan] Let the users to invoke `clang -fsanitize=address` to link binaries targeting the iOS simulator.
llvm-svn: 177633
Chandler Carruth [Thu, 21 Mar 2013 09:52:22 +0000 (09:52 +0000)]
Hoist the definition of getTypeSizeInBits to be inlinable and in the
header.
This method is called in the hot path for *many* passes, SROA is what
caught my interest. A common pattern is that which branch of the switch
should be taken is known in the callsite and so it is a very good
candidate for inlining and simplification. Moving it into the header
allows the optimizer to fold a lot of boring, repeatitive code in
callers of this routine.
I'm seeing pretty significant speedups in parts of SROA and I suspect
other passes will see similar speedups if they end up working with type
sizes frequently. I've not seen any significant growth of the binaries
as a consequence, but let me know if you see anything suspicious here.
llvm-svn: 177632
Chandler Carruth [Thu, 21 Mar 2013 09:52:18 +0000 (09:52 +0000)]
[SROA] Prefix names using a custom IRBuilder inserter.
The key part of this is ensuring that name prefixes remain in a Twine
form until we get to a point where we can nuke them under NDEBUG. This
is tricky using the old APIs as they played fast and loose with Twine,
which is prone to serious error. The inserter is much cleaner as it is
actually in the call stack leading to the setName call, and so has
a good opportunity to prepend the prefix.
This matters more than you might imagine because most runs over an
alloca find a single partition, and rewrite 3 or 4 instructions
referring to it. As a consequence doing this lazily and exclusively with
Twine allows the optimizer to delete more of it and shaves another 2% to
3% off of the release build's SROA run time for PR15412. I also think
the APIs are cleaner, and the use of Twine is more reliable, so
I consider it a win-win despite the churn required to reach this state.
llvm-svn: 177631
Evgeniy Stepanov [Thu, 21 Mar 2013 09:38:26 +0000 (09:38 +0000)]
[msan] Add an option to disable poisoning of shadow for undef values.
llvm-svn: 177630
Dmitry Vyukov [Thu, 21 Mar 2013 07:02:36 +0000 (07:02 +0000)]
tsan: flush symbolizer cache if not symbolized for more than 5 seconds
llvm-svn: 177629
Dmitry Vyukov [Thu, 21 Mar 2013 06:28:04 +0000 (06:28 +0000)]
tsan: add a comment about magic numbers
llvm-svn: 177628
Dmitry Vyukov [Thu, 21 Mar 2013 06:24:31 +0000 (06:24 +0000)]
tsan: use a single background thread for memory profiler and memory flush (and later for symbolizer flush)
llvm-svn: 177627
Bob Wilson [Thu, 21 Mar 2013 06:09:09 +0000 (06:09 +0000)]
Fix a typo.
llvm-svn: 177626
Greg Clayton [Thu, 21 Mar 2013 03:39:51 +0000 (03:39 +0000)]
Add correct file headers to all source files.
llvm-svn: 177625
Jason Molenda [Thu, 21 Mar 2013 03:36:01 +0000 (03:36 +0000)]
Add a new method GetFunctionAddressAndSizeVector to DWARFCallFrameInfo.
This returns a vector of <file address, size> entries for all of
the functions in the module that have an eh_frame FDE.
Update ObjectFileMachO to use the eh_frame FDE function addresses if
the LC_FUNCTION_STARTS section is missing, to fill in the start
addresses of any symbols that have been stripped from the binary.
Generally speaking, lldb works best if it knows the actual start
address of every function in a module - it's especially important
for unwinding, where lldb inspects the instructions in the prologue
of the function. In a stripped binary, it is deprived of this
information and it reduces the quality of our unwinds and saved
register retrieval.
Other ObjectFile users may want to use the function addresses from
DWARFCallFrameInfo to fill in any stripped symbols like ObjectFileMachO
does already.
<rdar://problem/
13365659>
llvm-svn: 177624
Greg Clayton [Thu, 21 Mar 2013 03:32:24 +0000 (03:32 +0000)]
Modify code to adhere to LLDB coding conventions.
llvm-svn: 177623
Meador Inge [Thu, 21 Mar 2013 02:44:07 +0000 (02:44 +0000)]
simplify-libcalls: Removed unused variable
The 'Modified' variable should have been removed from SimplifyLibCalls
in r177619, but was missed. This commit removes it.
llvm-svn: 177622
Douglas Gregor [Thu, 21 Mar 2013 01:08:50 +0000 (01:08 +0000)]
<rdar://problem/
13037793> Allow the names of modules to differ from the name of their subdirectory in the include path.
llvm-svn: 177621
Matt Arsenault [Thu, 21 Mar 2013 00:57:21 +0000 (00:57 +0000)]
Fix missing std::. Not sure how this compiles for anyone else.
llvm-svn: 177620
Meador Inge [Thu, 21 Mar 2013 00:55:59 +0000 (00:55 +0000)]
Move library call prototype attribute inference to functionattrs
The simplify-libcalls pass implemented a doInitialization hook to infer
function prototype attributes for well-known functions. Given that the
simplify-libcalls pass is going away *and* that the functionattrs pass
is already in place to deduce function attributes, I am moving this logic
to the functionattrs pass. This approach was discussed during patch
review:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20121126/157465.html.
llvm-svn: 177619
Richard Smith [Thu, 21 Mar 2013 00:42:03 +0000 (00:42 +0000)]
Per discussion on cxx-abi-dev, switch from comparing type_info objects to
comparing type_info names, since the latter have better uniqueness guarantees
in practice.
llvm-svn: 177618
Greg Clayton [Thu, 21 Mar 2013 00:30:04 +0000 (00:30 +0000)]
Added a lldb-perf test case that will be used to time various aspects of debugging clang with LLDB.
This test case will measure memory usage and expression timings in frame zero and at higher frames.
llvm-svn: 177617
Greg Clayton [Thu, 21 Mar 2013 00:29:45 +0000 (00:29 +0000)]
Fixed the ValidOffsetForDataOfSize() to use simpler logic. Fixed DataExtractor::BytesLeft() to return the correct value.
llvm-svn: 177616
Greg Clayton [Thu, 21 Mar 2013 00:24:59 +0000 (00:24 +0000)]
Simplify the logic for DNBDataRef::ValidOffsetForDataOfSize() and DNBDataRef::ValidOffset() functions.
llvm-svn: 177615
David Blaikie [Thu, 21 Mar 2013 00:10:31 +0000 (00:10 +0000)]
Removing unused DISubprogram::getFile
llvm-svn: 177614
John McCall [Thu, 21 Mar 2013 00:10:07 +0000 (00:10 +0000)]
Further weaken block conversion rules to permit blocks with
enum return type to be converted to blocks with any integer type
of the same size.
rdar://
13463504
llvm-svn: 177613
Manman Ren [Thu, 21 Mar 2013 00:09:50 +0000 (00:09 +0000)]
Add more testing cases for tbaa.struct
Testing cases for structs of structs and unions of structs.
llvm-svn: 177612
Jakob Stoklund Olesen [Thu, 21 Mar 2013 00:07:17 +0000 (00:07 +0000)]
Add a WriteMicrocoded for ancient microcoded instructions.
llvm-svn: 177611
David Blaikie [Wed, 20 Mar 2013 23:58:12 +0000 (23:58 +0000)]
Debug info: refactor the first field of DICompileUnit to be a raw file/directory pair
This removes the DICompileUnit special case from DIScope.
llvm-svn: 177610
David Blaikie [Wed, 20 Mar 2013 23:57:15 +0000 (23:57 +0000)]
Debug info - generalize namespace test to not depend on a DW_TAG_file_type entry
This isn't necessary & with the next change to LLVM the DW_TAG_file_type entry
won't be emitted at all - only the raw filename/directory pair, so match on
that directly instead.
llvm-svn: 177609
Jakub Staszak [Wed, 20 Mar 2013 23:56:19 +0000 (23:56 +0000)]
Use pre-inc, pre-dec when possible.
They are generally faster (at least not slower) than post-inc, post-dec.
llvm-svn: 177608
Jakub Staszak [Wed, 20 Mar 2013 23:53:45 +0000 (23:53 +0000)]
Remove 'else' after 'return'.
llvm-svn: 177607
Richard Smith [Wed, 20 Mar 2013 23:49:17 +0000 (23:49 +0000)]
Split ubsan runtime into three pieces (compiler-rt part):
* libclang_rt-san-* is sanitizer_common, and is linked in only if no other
sanitizer runtime is present.
* libclang_rt-ubsan-* is the piece of the runtime which doesn't depend on
a C++ ABI library, and is always linked in.
* libclang_rt-ubsan_cxx-* is the piece of the runtime which depends on a
C++ ABI library, and is only linked in when linking a C++ binary.
The Darwin ubsan runtime is unchanged.
For more details, see Clang change r177605.
llvm-svn: 177606
Richard Smith [Wed, 20 Mar 2013 23:49:07 +0000 (23:49 +0000)]
Split ubsan runtime into three pieces (clang part):
* libclang_rt-san-* is sanitizer_common, and is linked in only if no other
sanitizer runtime is present.
* libclang_rt-ubsan-* is the piece of the runtime which doesn't depend on
a C++ ABI library, and is always linked in.
* libclang_rt-ubsan_cxx-* is the piece of the runtime which depends on a
C++ ABI library, and is only linked in when linking a C++ binary.
This change also switches us to using -whole-archive for the ubsan runtime
(which is made possible by the above split), and switches us to only linking
the sanitizer runtime into the main binary and not into DSOs (which is made
possible by using -whole-archive).
The motivation for this is to only link a single copy of sanitizer_common
into any binary. This is becoming important now because we want to share
more state between multiple sanitizers in the same process (for instance,
we want a single shared output mutex).
The Darwin ubsan runtime is unchanged; because we use a DSO there, we don't
need this complexity.
llvm-svn: 177605
Shankar Easwaran [Wed, 20 Mar 2013 23:39:43 +0000 (23:39 +0000)]
[ELF][Hexagon][test] check .got.plt order
llvm-svn: 177604
Shankar Easwaran [Wed, 20 Mar 2013 23:34:36 +0000 (23:34 +0000)]
[X86_64][test] check that interp section is not emitted when building dynamic libraries
llvm-svn: 177603
Reid Kleckner [Wed, 20 Mar 2013 23:32:14 +0000 (23:32 +0000)]
[lit] Avoid CRLFs in bash scripts on Windows
Native Windows Python will do line ending translation by default, which
we don't want in bash scripts. If we're not native Windows Python, then
'b' is ignored.
llvm-svn: 177602
Bill Wendling [Wed, 20 Mar 2013 23:21:08 +0000 (23:21 +0000)]
Add declaration for linux.
llvm-svn: 177601
Justin Holewinski [Wed, 20 Mar 2013 23:10:59 +0000 (23:10 +0000)]
Make variable name more explicit and eliminate redundant lookup in SDNodeOrdering
llvm-svn: 177600
Jakob Stoklund Olesen [Wed, 20 Mar 2013 23:09:53 +0000 (23:09 +0000)]
Model prefetches and barriers as loads.
It's not yet clear if these instructions need a more careful model.
llvm-svn: 177599
Jakob Stoklund Olesen [Wed, 20 Mar 2013 23:09:50 +0000 (23:09 +0000)]
Add a catch-all WriteSystem SchedWrite type.
This is used for all the expensive system instructions.
llvm-svn: 177598
Enrico Granata [Wed, 20 Mar 2013 23:01:28 +0000 (23:01 +0000)]
Making a manual mode of operation for measurements, where you can manually call start() and stop() instead of using the function-call syntax
This is especially useful to take measurements that span multiple test steps, or where you need to have different operations fall under the same measurement
An example of use is in the formatters perf test case
llvm-svn: 177597
Nadav Rotem [Wed, 20 Mar 2013 22:53:44 +0000 (22:53 +0000)]
When computing the demanded bits of Load SDNodes, make sure that we are looking at the loaded-value operand and not the ptr result (in case of pre-inc loads).
rdar://
13348420
llvm-svn: 177596
David Blaikie [Wed, 20 Mar 2013 22:52:54 +0000 (22:52 +0000)]
Debug Info: Swap the 2nd and 3rd parameters to DICompileUnit to match the common DIScope prefix
llvm-svn: 177595
Enrico Granata [Wed, 20 Mar 2013 22:42:34 +0000 (22:42 +0000)]
Making the test step count a member variable so that it can be accessed easily
llvm-svn: 177594
Tobias Grosser [Wed, 20 Mar 2013 22:41:53 +0000 (22:41 +0000)]
CodePrepare: Do not require canonical induction variables for scev based mode
llvm-svn: 177593
Jakob Stoklund Olesen [Wed, 20 Mar 2013 22:37:16 +0000 (22:37 +0000)]
Annotate the remaining SSE MOV instructions.
llvm-svn: 177592
Jakob Stoklund Olesen [Wed, 20 Mar 2013 22:37:13 +0000 (22:37 +0000)]
Annotate SSE horizontal and integer instructions.
llvm-svn: 177591
David Blaikie [Wed, 20 Mar 2013 22:34:33 +0000 (22:34 +0000)]
Remove unused field in DICompileUnit
llvm-svn: 177590
Reid Kleckner [Wed, 20 Mar 2013 22:29:42 +0000 (22:29 +0000)]
[ms-cxxabi] Mangle function pointer template arguments correctly
Reviewers: rjmccall
CC: timurrrr, llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D554
llvm-svn: 177589
Michael J. Spencer [Wed, 20 Mar 2013 22:18:22 +0000 (22:18 +0000)]
[SymbolTable][Perf] Use hash_combine instead of a custom hash, also use memcmp.
ArrayRef<uint8_t>::equals(); lowers to a byte compare loop :(.
TODO: Figure out if we are getting hash collisions, or just have a lot of equal
content. Also test if crypto hashing the content instead of full compare is
better.
llvm-svn: 177588
Enrico Granata [Wed, 20 Mar 2013 22:12:01 +0000 (22:12 +0000)]
Renaming perf. main files from main.cpp to something meaningful
llvm-svn: 177587
Michael Liao [Wed, 20 Mar 2013 22:01:10 +0000 (22:01 +0000)]
Correct cost model for vector shift on AVX2
- After moving logic recognizing vector shift with scalar amount from
DAG combining into DAG lowering, we declare to customize all vector
shifts even vector shift on AVX is legal. As a result, the cost model
needs special tuning to identify these legal cases.
llvm-svn: 177586
Jason Molenda [Wed, 20 Mar 2013 21:57:42 +0000 (21:57 +0000)]
Change DWARFCallFrameInfo from using a vector of AddressRanges to
track the EH FDEs for the functions in a module to using a
RangeDataVector, a more light-weight data structure that only refers
to File addresses. Makes the initial FDE scan about 3x faster, uses
less memory.
<rdar://problem/
13465650>
llvm-svn: 177585
Jakub Staszak [Wed, 20 Mar 2013 21:47:51 +0000 (21:47 +0000)]
Remove trailing spaces.
llvm-svn: 177584
Jordan Rose [Wed, 20 Mar 2013 21:44:17 +0000 (21:44 +0000)]
[analyzer] Appease buildbots: include template arguments in base class ref.
llvm-svn: 177583
Tobias Grosser [Wed, 20 Mar 2013 21:40:11 +0000 (21:40 +0000)]
ScopDetect: Test case to verify that base pointers are scop invariant
llvm-svn: 177582
James Dennett [Wed, 20 Mar 2013 21:30:03 +0000 (21:30 +0000)]
Documentation cleanup for MacroInfo.
* Clarify what MacroInfo::isBuiltinMacro means, as it really means something
more like "isMagicalMacro" or "requiresProcessingBeforeExpansion" -- the
macros defined in "<built-in>" are not considered built-in by this function;
* Escape __LINE__ as \__LINE__ in Doxygen comments so that the underscores
don't get replaced by *bold* output;
* Turn comments in MacroInfo.cpp into non-Doxygen comments, so that they
don't result in duplicated/badly formatted Doxygen output;
* Clean up a bunch of \brief formatting, and add a \file comment for
MacroInfo.h.
llvm-svn: 177581
Enrico Granata [Wed, 20 Mar 2013 21:18:20 +0000 (21:18 +0000)]
Making MemoryGauge work by fixing a Mach API call mistake - saving (and dumping) more information out of the task_info call
llvm-svn: 177580
Bill Wendling [Wed, 20 Mar 2013 21:13:59 +0000 (21:13 +0000)]
Call the new llvm_gcov_init function to register the environment.
Use the new `llvm_gcov_init' function to register the writeout and flush
functions. The initialization function will also call `atexit' for some cleanups
and final writout calls. But it does this only once. This is better than
checking for the `main' function, because in a library that function may not
exist.
<rdar://problem/
12439551>
llvm-svn: 177579
Bill Wendling [Wed, 20 Mar 2013 21:11:47 +0000 (21:11 +0000)]
Create a coverage initialization function.
This function replaces the call of `atexit' from being generated in the compile
units. Basically, it registers the "writeout" and "flush" functions (if
present). It will generate calls to the `atexit' function for cleanups and final
writeout functions, but only once. This is better than checking for `main',
because a library may not have a `main' function in it.
<rdar://problem/
12439551>
llvm-svn: 177578
Douglas Gregor [Wed, 20 Mar 2013 21:10:35 +0000 (21:10 +0000)]
<rdar://problem/
12368093> Extend module maps with a 'conflict' declaration, and warn when a newly-imported module conflicts with an already-imported module.
llvm-svn: 177577
Chris Lattner [Wed, 20 Mar 2013 21:04:53 +0000 (21:04 +0000)]
minor code style cleanup.
llvm-svn: 177576
Rafael Espindola [Wed, 20 Mar 2013 21:03:41 +0000 (21:03 +0000)]
xlC doesn't like Header being both a type and a member variable. Rename the
member variable.
Patch by Kai <kai@redstar.de>
llvm-svn: 177575
Rafael Espindola [Wed, 20 Mar 2013 21:00:22 +0000 (21:00 +0000)]
Add std prefixes to fix the build with xlc.
Patch by Kai <kai@redstar.de>.
llvm-svn: 177574
Jakob Stoklund Olesen [Wed, 20 Mar 2013 20:43:11 +0000 (20:43 +0000)]
Make sure TableGen exits with an error code after printing errors.
This makes it possible to report multiple errors in one invocation.
There are already calls to PrintError in CodeGenDAGPatterns.cpp which
previously would not cause TableGen to fail.
<rdar://problem/
13463339>
llvm-svn: 177573
Jordan Rose [Wed, 20 Mar 2013 20:36:01 +0000 (20:36 +0000)]
[analyzer] Don't invalidate globals when there's no call involved.
This fixes some mistaken condition logic in RegionStore that caused
global variables to be invalidated when /any/ region was invalidated,
rather than only as part of opaque function calls. This was only
being used by CStringChecker, and so users will now see that strcpy()
and friends do not invalidate global variables.
Also, add a test case we don't handle properly: explicitly-assigned
global variables aren't being invalidated by opaque calls. This is
being tracked by <rdar://problem/
13464044>.
llvm-svn: 177572
Jordan Rose [Wed, 20 Mar 2013 20:35:57 +0000 (20:35 +0000)]
[analyzer] Track malloc'd memory into struct fields.
Due to improper modelling of copy constructors (specifically, their
const reference arguments), we were producing spurious leak warnings
for allocated memory stored in structs. In order to silence this, we
decided to consider storing into a struct to be the same as escaping.
However, the previous commit has fixed this issue and we can now properly
distinguish leaked memory that happens to be in a struct from a buffer
that escapes within a struct wrapper.
Originally applied in r161511, reverted in r174468.
<rdar://problem/
12945937>
llvm-svn: 177571
Jordan Rose [Wed, 20 Mar 2013 20:35:53 +0000 (20:35 +0000)]
[analyzer] Invalidate regions indirectly accessible through const pointers.
In this case, the value of 'x' may be changed after the call to indirectAccess:
struct Wrapper {
int *ptr;
};
void indirectAccess(const Wrapper &w);
void test() {
int x = 42;
Wrapper w = { x };
clang_analyzer_eval(x == 42); // TRUE
indirectAccess(w);
clang_analyzer_eval(x == 42); // UNKNOWN
}
This is important for modelling return-by-value objects in C++, to show
that the contents of the struct are escaping in the return copy-constructor.
<rdar://problem/
13239826>
llvm-svn: 177570
Jordan Rose [Wed, 20 Mar 2013 20:35:48 +0000 (20:35 +0000)]
[analyzer] Remove strip of ElementRegion in CallEvent::invalidateRegions.
This is a bit of old code trying to deal with the fact that functions that
take pointers often use them to access an entire array via pointer
arithmetic. However, RegionStore already conservatively assumes you can use
pointer arithmetic to access any part of a region.
Some day we may want to go back to handling this specifically for calls,
but we can do that in the future.
No functionality change.
llvm-svn: 177569
Matt Kopec [Wed, 20 Mar 2013 20:34:35 +0000 (20:34 +0000)]
Add Linux support for reading/writing extended register sets.
Patch by Ashok Thirumurthi.
llvm-svn: 177568
Tobias Grosser [Wed, 20 Mar 2013 20:02:35 +0000 (20:02 +0000)]
ScopDetect: Add test cases for non-simple regions
llvm-svn: 177567
David Blaikie [Wed, 20 Mar 2013 19:39:15 +0000 (19:39 +0000)]
Refactor file/directory path in namespace debug info to refer directly to the pair rather than the DIFile
(paired to a Clang test - excuse the buildbot skew/fallout)
llvm-svn: 177566
David Blaikie [Wed, 20 Mar 2013 19:38:29 +0000 (19:38 +0000)]
refactoring file/directory for namespace debug info
(this is a paired commit with an LLVM change to DIBuilder - expect some
buildbot skew/fallout)
llvm-svn: 177565
Michael J. Spencer [Wed, 20 Mar 2013 19:26:10 +0000 (19:26 +0000)]
[ELF][Reader] Add debug message to print all inputs the linker actually read.
llvm-svn: 177564
Michael J. Spencer [Wed, 20 Mar 2013 19:25:58 +0000 (19:25 +0000)]
[ELF][Reader][Perf] Only do loookup once.
llvm-svn: 177563
Michael J. Spencer [Wed, 20 Mar 2013 19:25:47 +0000 (19:25 +0000)]
[ELF][Reader] Refactor how relocations are read. Improves performance.
This changes from reading each relocation individually for each section to just
storing the range of relocations. It also counts the relocations to preallocate
the _references array.
llvm-svn: 177562
Michael J. Spencer [Wed, 20 Mar 2013 19:25:34 +0000 (19:25 +0000)]
[ELF][Reader] Remove static ordinal.
llvm-svn: 177561
David Blaikie [Wed, 20 Mar 2013 19:14:16 +0000 (19:14 +0000)]
Enhance debug info namespace test to check for context/scope reference
The differing file (due to the #line directive in the original source) is for
future testing improvements coming soon.
llvm-svn: 177560
David Blaikie [Wed, 20 Mar 2013 19:10:57 +0000 (19:10 +0000)]
Enhance debug info namespace test to check for context/scope reference
The #line directive is mostly for backend testing (keeping these files matching
should simplify maintenance somewhat) though the corresponding backend test
improvement/update doesn't verify the file information directly just yet.
Coming in a later iteration.
llvm-svn: 177559
Enrico Granata [Wed, 20 Mar 2013 19:04:28 +0000 (19:04 +0000)]
Cleanup to the ObjC runtime to remove the now useless ClassDescriptor_Invalid
llvm-svn: 177558
Michael J. Spencer [Wed, 20 Mar 2013 18:58:07 +0000 (18:58 +0000)]
memcpy instead of copy_n. Faster than copy_n on MSVC :(.
llvm-svn: 177557
Michael J. Spencer [Wed, 20 Mar 2013 18:57:52 +0000 (18:57 +0000)]
Devirtualize Reference::kind.
Improves performance.
llvm-svn: 177556
Michael J. Spencer [Wed, 20 Mar 2013 18:57:27 +0000 (18:57 +0000)]
Devirtualize File::kind.
This is the standard way of implementing LLVM RTTI.
llvm-svn: 177555