Commit Graph

145637 Commits

Author SHA1 Message Date
Evgeniy Stepanov b4a218db34 [sanitizer] Don't adjust the size of the user-allocated stack.
Moved this code to sanitizer_common.

llvm-svn: 177383
2013-03-19 09:30:52 +00:00
Alexey Samsonov 4c17c1b157 Support CMake build of profile runtime library on Linux
llvm-svn: 177382
2013-03-19 09:17:35 +00:00
Dmitry Vyukov b59fa875ad tsan: do not allocate sync vars on relaxed atomic operations
helps to reduce memory consumption if an atomic is used only with relaxed ops (stats)

llvm-svn: 177381
2013-03-19 09:15:31 +00:00
Renato Golin 227eb6fc5f Improve long vector sext/zext lowering on ARM
The ARM backend currently has poor codegen for long sext/zext
operations, such as v8i8 -> v8i32. This patch addresses this
by performing a custom expansion in ARMISelLowering. It also
adds/changes the cost of such lowering in ARMTTI.

This partially addresses PR14867.

Patch by Pete Couperus

llvm-svn: 177380
2013-03-19 08:15:38 +00:00
Hal Finkel d9e10d51fa Don't reserve R31 on PPC64 unless the frame pointer is needed
llvm-svn: 177379
2013-03-19 08:09:38 +00:00
John McCall 5ec7e7def3 Add a clarifying note when a return statement is rejected because
we expect a related result type.

rdar://12493140

llvm-svn: 177378
2013-03-19 07:04:25 +00:00
Andrew Trick f3a2544dba Revert "Cleanup some SCEV logic a bit."
This reverts commit 82cd8f7382322bee7a71cdc31f7a923c44d37d32.

Just add a comment instead!

llvm-svn: 177377
2013-03-19 05:10:27 +00:00
Greg Clayton e0b924e3bf More cleanup on the lldb-perf code:
- TestCase.m_thread is now filled in with the first thread that has a valid
  stop reason. This eliminates the need for the SelectMyThread() functions.
- The first thread that stops for a reason is also set as the selected thread
  in the process in case any command line commands are run.
- Changed launch over to take a SBLaunchInfo parameter so that the launch
  function doesn't keep getting new arguments as they are needed.
- TestCase::Setup() and TestCase::Launch(SBLaunchInfo) now return bool to 
  indicate success of setup and launch.
- ActionWanted::Next(SBThread) was renamed to ActionWanted::StepOver(SBThread)
- ActionWanted::Finish(SBThread) was renamed to ActionWanted::StepOut(SBThread)

llvm-svn: 177376
2013-03-19 04:41:22 +00:00
Andrew Trick de78866594 Cleanup some SCEV logic a bit.
Make the code more obvious to scan-build and humans.

llvm-svn: 177375
2013-03-19 04:14:59 +00:00
Andrew Trick a1c01ba8c7 Tighten up an internal LSR API that should check for NULL.
No test case, but should fix a scan_build warning.

llvm-svn: 177374
2013-03-19 04:14:57 +00:00
Sean Callanan 9be9d172bf Fixed handling of function pointers in the IR
interpreter.  They now have correct values, even
when the process is not running.

llvm-svn: 177372
2013-03-19 01:45:02 +00:00
Nick Lewycky d67186337a Emit the linkage name instead of the function name, when available. This means
that we'll prefer to emit the mangled C++ name (pending a clang change).

llvm-svn: 177371
2013-03-19 01:37:55 +00:00
Douglas Gregor a31b0a21c6 Remove stray semicolon
llvm-svn: 177370
2013-03-19 00:41:04 +00:00
Douglas Gregor 2f1806e83f Minor optimization to r177367 to treat a module with missing dependencies as out-of-date rather than missing.
llvm-svn: 177369
2013-03-19 00:38:50 +00:00
Rafael Espindola d15a8918fb Finish refactoring the tool selection logic.
The general pattern now is that Foobar::constructTool only creates tools
defined in the tools::foobar namespace and then delegates to the parent.

The remaining duplicated code is now in the tools themselves.

llvm-svn: 177368
2013-03-19 00:36:57 +00:00
Douglas Gregor 7029ce1a0c <rdar://problem/13363214> Eliminate race condition between module rebuild and the global module index.
The global module index was querying the file manager for each of the
module files it knows about at load time, to prune out any out-of-date
information. The file manager would then cache the results of the
stat() falls used to find that module file.

Later, the same translation unit could end up trying to import one of the
module files that had previously been ignored by the module cache, but
after some other Clang instance rebuilt the module file to bring it
up-to-date. The stale stat() results in the file manager would
trigger a second rebuild of the already-up-to-date module, causing
failures down the line.

The global module index now lazily resolves its module file references
to actual AST reader module files only after the module file has been
loaded, eliminating the stat-caching race. Moreover, the AST reader
can communicate to its caller that a module file is missing (rather
than simply being out-of-date), allowing us to simplify the
module-loading logic and allowing the compiler to recover if a
dependent module file ends up getting deleted.

llvm-svn: 177367
2013-03-19 00:28:20 +00:00
Enrico Granata 6d37cc6501 This checkin removes the last Cocoa formatters that were implemented in Python and reimplements them in C++. The Python Cocoa formatters are not shipped as part of LLDB anymore, but still exist in the source repository for user reference. Python formatters still exist for STL classes and users can still define their own Python formatters
llvm-svn: 177366
2013-03-19 00:27:22 +00:00
Greg Clayton 9585fbfc67 <rdar://problem/13443931>
Fixed a crasher in the SourceManager where it wasn't checking the m_target member variable for NULL.

In doing this fix, I hardened this class to have weak pointers to the debugger and target in case they do go away. I also changed SBSourceManager to hold onto weak pointers to the debugger and target so they don't keep objects alive by holding a strong reference to them.

llvm-svn: 177365
2013-03-19 00:20:55 +00:00
Sean Callanan 8dfb68e039 Refactored the expression parser so that the IR
and the JITted code are managed by a standalone
class that handles memory management itself.

I have removed RecordingMemoryManager and
ProcessDataAllocator, which filled similar roles
and had confusing ownership, with a common class
called IRExecutionUnit.  The IRExecutionUnit
manages all allocations ever made for an expression
and frees them when it goes away.  It also contains
the code generator and can vend the Module for an
expression to other clases.

The end goal here is to make the output of the
expression parser re-usable; that is, to avoid
re-parsing when re-parsing isn't necessary.

I've also cleaned up some code and used weak pointers
in more places.  Please let me know if you see any
leaks; I checked myself as well but I might have
missed a case.

llvm-svn: 177364
2013-03-19 00:10:07 +00:00
Richard Smith 807e4dced5 Update ubsan test for clang change r177362.
llvm-svn: 177363
2013-03-19 00:04:20 +00:00
Richard Smith 4af40c4083 PR15383: When -fsanitize=float-cast-overflow checks a float-to-int conversion,
it wasn't taking into account that the float should be truncated *before* the
range check happens. Thus (unsigned)-0.99 and (unsigned char)255.9 have defined
behavior and should not be trapped.

llvm-svn: 177362
2013-03-19 00:01:12 +00:00
Hal Finkel fc9aad6436 Fix a sign-extension bug in PPCCTRLoops
Don't sign extend the immediate value from the OR instruction in
an LIS/OR pair.

llvm-svn: 177361
2013-03-18 23:58:28 +00:00
Rafael Espindola 0add40ed7d Centralize the logic for using the integrated assembler.
llvm-svn: 177360
2013-03-18 23:56:07 +00:00
Argyrios Kyrtzidis 014349cc8c [libclang] Modify clang_getCursorType to be able to handle a function template decl.
llvm-svn: 177359
2013-03-18 23:54:50 +00:00
Fariborz Jahanian abbcbaeb4c documentation comment parsing. Added couple of
top-level HeaderDoc tags @functiongroup and
@methodgroup to doc. tags recognized.
// rdar://12379114 

llvm-svn: 177358
2013-03-18 23:45:52 +00:00
Jakub Staszak b6970267ad Move #include of BitVector from .h to .cpp file.
Also remove unneeded #include and forward declaration.

llvm-svn: 177357
2013-03-18 23:45:45 +00:00
Jakub Staszak 26ac8a7b16 Add some constantness.
llvm-svn: 177356
2013-03-18 23:40:46 +00:00
Marshall Clow 1c00ce5070 Fix bug in test; found by AddressSanitizer
llvm-svn: 177355
2013-03-18 23:39:36 +00:00
Richard Smith 9cf21ae068 Diagnose uses of 'alignof' on functions in -pedantic mode.
llvm-svn: 177354
2013-03-18 23:37:25 +00:00
Jordan Rose 2d0edec994 [analyzer] Do part of the work to find shortest bug paths up front.
Splitting the graph trimming and the path-finding (r177216) already
recovered quite a bit of performance lost to increased suppression.
We can still do better by also performing the reverse BFS up front
(needed for shortest-path-finding) and only walking the shortest path
for each report. This does mean we have to walk back up the path and
invalidate all the BFS numbers if the report turns out to be invalid,
but it's probably still faster than redoing the full BFS every time.

More performance work for <rdar://problem/13433687>

llvm-svn: 177353
2013-03-18 23:34:37 +00:00
Jordan Rose ee47a5bd92 [analyzer] Replace uses of assume() with isNull() in BR visitors.
Also, replace a std::string with a SmallString.

No functionality change.

llvm-svn: 177352
2013-03-18 23:34:32 +00:00
Jakub Staszak 41cd1f1fd9 Remove unneeded #includes.
llvm-svn: 177351
2013-03-18 23:33:44 +00:00
Jakub Staszak 2865a0d853 Make methods const.
llvm-svn: 177350
2013-03-18 23:33:14 +00:00
Chad Rosier 47abcf83a3 Test case for r177347.
llvm-svn: 177349
2013-03-18 23:32:33 +00:00
Jakub Staszak bc421efddf Make method private. Keep coding standard.
llvm-svn: 177348
2013-03-18 23:31:30 +00:00
Chad Rosier 2707d534c1 [ms-inline asm] Avoid emitting a redundant sizing directive, if we've already
parsed one.  Test case coming shortly.
rdar://13446980

llvm-svn: 177347
2013-03-18 23:31:24 +00:00
Greg Clayton a45a5d86f7 Fixed the README to match the current code.
llvm-svn: 177346
2013-03-18 23:25:00 +00:00
David Blaikie 1dc4a3dfd6 PR15539: Record "evaluating if/elif condition" flag in the right place
The previous implementation missed the case where the elif condition was
evaluated from the context of an #ifdef that was false causing PR15539.

llvm-svn: 177345
2013-03-18 23:22:28 +00:00
Bill Wendling 008322f2b0 Update testcase for r177340.
llvm-svn: 177344
2013-03-18 23:11:54 +00:00
Jim Ingham 3793322df7 Add a comment about how to add a target for a test case.
llvm-svn: 177343
2013-03-18 23:08:30 +00:00
Jakub Staszak a0f3694aa5 Change NULL to 0.
llvm-svn: 177342
2013-03-18 23:08:01 +00:00
Jim Ingham 65423de84d Move the performance test cases into their own project.
llvm-svn: 177341
2013-03-18 23:05:00 +00:00
Bill Wendling c3cab816bb Register the flush function for each compile unit.
For each compile unit, we want to register a function that will flush that
compile unit. Otherwise, __gcov_flush() would only flush the counters within the
current compile unit, and not any outside of it.

PR15191 & <rdar://problem/13167507>

llvm-svn: 177340
2013-03-18 23:04:39 +00:00
Jakub Staszak a0e4da0af6 Remove trailing spaces.
llvm-svn: 177339
2013-03-18 23:04:30 +00:00
Hal Finkel b09680b0f7 Fix PPC unaligned 64-bit loads and stores
PPC64 supports unaligned loads and stores of 64-bit values, but
in order to use the r+i forms, the offset must be a multiple of 4.
Unfortunately, this cannot always be determined by examining the
immediate itself because it might be available only via a TOC entry.

In order to get around this issue, we additionally predicate the
selection of the r+i form on the alignment of the load or store
(forcing it to be at least 4 in order to select the r+i form).

llvm-svn: 177338
2013-03-18 23:00:58 +00:00
Bill Wendling 2428f167f7 Add some GCOV functions that register all of the __llvm_gcov_flush() functions.
The __llvm_gcov_flush() functions only work for the local compile unit. However,
when __gcov_flush() is called, the user expects all of the counters to be
flushed, not just the ones in the current compile unit.

This adds some library functions that register the flush functions. It also
defined __gcov_flush() so that loops through that list and calls the functions.

PR15191 & <rdar://problem/13167507>

llvm-svn: 177337
2013-03-18 22:59:47 +00:00
Argyrios Kyrtzidis c00f43a33f [frontend] Initialize the diagnostic client before loading an ast file.
Issue reported by Tom Honermann!
http://llvm.org/bugs/show_bug.cgi?id=15377

llvm-svn: 177336
2013-03-18 22:55:24 +00:00
Richard Smith b1402ae94e Add missing diagnostic for a nested-name-specifier on a free-standing type definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations.
llvm-svn: 177335
2013-03-18 22:52:47 +00:00
Arnold Schwaighofer ae0052f114 ARM cost model: Make some vector integer to float casts cheaper
The default logic marks them as too expensive.

For example, before this patch we estimated:
  cost of 16 for instruction:   %r = uitofp <4 x i16> %v0 to <4 x float>

While this translates to:
  vmovl.u16 q8, d16
  vcvt.f32.u32  q8, q8

All other costs are left to the values assigned by the fallback logic. Theses
costs are mostly reasonable in the sense that they get progressively more
expensive as the instruction sequences emitted get longer.

radar://13445992

llvm-svn: 177334
2013-03-18 22:47:09 +00:00
Arnold Schwaighofer 6c9c3a8b99 ARM cost model: Correct cost for some cheap float to integer conversions
Fix cost of some "cheap" cast instructions. Before this patch we used to
estimate for example:
  cost of 16 for instruction:   %r = fptoui <4 x float> %v0 to <4 x i16>

While we would emit:
  vcvt.s32.f32  q8, q8
  vmovn.i32 d16, q8
  vuzp.8  d16, d17

All other costs are left to the values assigned by the fallback logic. Theses
costs are mostly reasonable in the sense that they get progressively more
expensive as the instruction sequences emitted get longer.

radar://13434072

llvm-svn: 177333
2013-03-18 22:47:06 +00:00