Commit Graph

121968 Commits

Author SHA1 Message Date
Anna Zaks a1b227b6a7 [analyzer] MallocChecker: implement pessimistic version of the checker,
which allows values to escape through unknown calls.

Assumes all calls but the malloc family are unknown.

Also, catch a use-after-free when a pointer is passed to a
function after a call to free (previously, you had to explicitly
dereference the pointer value).

llvm-svn: 150112
2012-02-08 23:16:56 +00:00
Anna Zaks cd37bf4ec8 [analyzer] Split the MallocChecker into two versions - pessimistic and
optimistic.

TODO: actually implement the pessimistic version of the checker. Ex: it
needs to assume that any function that takes a pointer might free it.

The optimistic version relies on annotations to tell us which functions
can free the pointer.

llvm-svn: 150111
2012-02-08 23:16:52 +00:00
Ted Kremenek 7df15cd21f Remove explicit delete of PathDiagnosticMacroPiece, as it is now reference counted.
llvm-svn: 150110
2012-02-08 22:48:17 +00:00
Johnny Chen 2ffa754a6f After discussions with Jim and Greg, modify the 'watchpoint set' command to become a mutiword command
with subcommand 'expression' and 'variable'.  The first subcommand is for supplying an expression to
be evaluated into an address to watch for, while the second is for watching a variable.

'watchpoint set expression' is a raw command, which means that you need to use the "--" option terminator
to end the '-w' or '-x' option processing and to start typing your expression.

Also update several test cases to comply and add a couple of test cases into TestCompletion.py,
in particular, test that 'watchpoint set ex' completes to 'watchpoint set expression ' and that
'watchpoint set var' completes to 'watchpoint set variable '.

llvm-svn: 150109
2012-02-08 22:37:48 +00:00
Jakob Stoklund Olesen 8610a59de1 Handle register masks in MachineCopyPropagation.
For simplicity, treat calls with register masks as basic block
boundaries.  This means we can't copy propagate callee-saved registers
across calls, but I don't think that is a big deal.

llvm-svn: 150108
2012-02-08 22:37:35 +00:00
Evan Cheng 55e7d6aeff Commit Andy Zhang's test for the lea patch.
llvm-svn: 150107
2012-02-08 22:33:17 +00:00
Fariborz Jahanian a8395a6edb last piece of metadata to complete modern metadata for
protocol definitions.

llvm-svn: 150106
2012-02-08 22:23:26 +00:00
Chris Lattner 8776bc13f5 fix broken link
llvm-svn: 150105
2012-02-08 22:20:00 +00:00
Sean Callanan 80ef1245cc Added support to the expression parser for reading
variables that are only available in symbols.

llvm-svn: 150103
2012-02-08 21:55:14 +00:00
Kostya Serebryany 154a54d972 [asan] unpoison the stack before every noreturn call. Fixes asan issue 37. llvm part
llvm-svn: 150102
2012-02-08 21:36:17 +00:00
Kostya Serebryany 0394da7bea [asan] unpoison the stack before every noreturn call. Fixes asan issue 37. rt part
llvm-svn: 150101
2012-02-08 21:33:27 +00:00
Andrew Trick 1fa5bcbe2a Codegen pass definition cleanup. No functionality.
Moving toward a uniform style of pass definition to allow easier target configuration.
Globally declare Pass ID.
Globally declare pass initializer.
Use INITIALIZE_PASS consistently.
Add a call to the initializer from CodeGen.cpp.
Remove redundant "createPass" functions and "getPassName" methods.

While cleaning up declarations, cleaned up comments (sorry for large diff).

llvm-svn: 150100
2012-02-08 21:23:13 +00:00
Andrew Trick c40815de62 Move pass configuration out of pass constructors: MachineLICM.
llvm-svn: 150099
2012-02-08 21:23:03 +00:00
Andrew Trick 5209c739cd whitespace
llvm-svn: 150098
2012-02-08 21:23:00 +00:00
Andrew Trick 3ed444a16a Move pass configuration out of pass constructors: StackSlotColoring.
llvm-svn: 150097
2012-02-08 21:22:57 +00:00
Andrew Trick df7e3769b5 Move pass configuration out of pass constructors: PostRAScheduler.
llvm-svn: 150096
2012-02-08 21:22:53 +00:00
Andrew Trick 58648e4e98 Move pass configuration out of pass constructors: BranchFolderPass
llvm-svn: 150095
2012-02-08 21:22:48 +00:00
Andrew Trick 9e761997d8 whitespace
llvm-svn: 150094
2012-02-08 21:22:43 +00:00
Andrew Trick dd37d52f95 Added TargetPassConfig::setOpt
llvm-svn: 150093
2012-02-08 21:22:39 +00:00
Andrew Trick 3a61b7862b Added Pass::createPass(ID) to handle pass configuration by ID
llvm-svn: 150092
2012-02-08 21:22:34 +00:00
Andrew Trick c044917a8a Move pass configuration out of pass constructors: TailDuplicate::PreRegAlloc
llvm-svn: 150091
2012-02-08 21:22:30 +00:00
Douglas Gregor 8390afde4e Minor comment fix
llvm-svn: 150090
2012-02-08 21:19:04 +00:00
Douglas Gregor 03dd13cfb6 Factor C++11 lambda expressions implementation into a separate
file. No functionality change.

llvm-svn: 150089
2012-02-08 21:18:48 +00:00
Douglas Gregor c70fe353ea When computing the type of a local variable reference within a lambda,
only add 'const' for variables captured by copy in potentially
evaluated expressions of non-mutable lambdas. (The "by copy" part was
missing).

llvm-svn: 150088
2012-02-08 20:56:50 +00:00
Douglas Gregor 21f4692c62 When completing a lambda expression, make sure to check and attach the
body of the lambda to the function call operator.

llvm-svn: 150087
2012-02-08 20:17:14 +00:00
Anna Zaks c68bf4c036 [analyzer] MallocChecker: convert from using evalCall to
post visit of CallExpr.

In general, we should avoid using evalCall as it leads to interference
with other checkers.

llvm-svn: 150086
2012-02-08 20:13:28 +00:00
Enrico Granata 5a1bff08dd fixing comment to reflect that currentversion of OSX works with our STL formatters
llvm-svn: 150085
2012-02-08 19:57:18 +00:00
Fariborz Jahanian e18961baaf More rewriting of objective-c moderin abi metadata.
All protocol related metadata is close to completion.

llvm-svn: 150084
2012-02-08 19:53:58 +00:00
Alexey Samsonov 8489f2a564 AddressSanitizer: start factoring out interception machinery
llvm-svn: 150083
2012-02-08 19:52:01 +00:00
Howard Hinnant 27c8f620ee Fix up narrowing conversions in switch statement.
llvm-svn: 150082
2012-02-08 19:15:06 +00:00
Jakob Stoklund Olesen 0c1eea2922 Add Register mask support to RABasic.
When a virtual register is live across a call, limit the search space to
call-preserved registers.

llvm-svn: 150081
2012-02-08 18:54:35 +00:00
Benjamin Kramer 0e4319ec99 Don't map registers to the invalid dwarf register (-1). It's the default value.
X86GenRegisterInfo.inc | 1032 -------------------------------------------------
  1 file changed, 1032 deletions(-)

llvm-svn: 150080
2012-02-08 18:46:26 +00:00
Sean Callanan aa719af082 In the absence of a valid process, the expression
parser now at least tries to generate IR for the
target.

llvm-svn: 150079
2012-02-08 18:43:35 +00:00
Brendon Cahoon 6f35837048 Use TSFlag bit to describe instruction properties.
Creating the isPredicated TSFlag enables the code
to use the property defined in the instruction format
instead of using a large switch statement.

llvm-svn: 150078
2012-02-08 18:25:47 +00:00
Jakob Stoklund Olesen 3ff74d8e62 Keep track of register masks in LiveIntervalAnalysis.
Build an ordered vector of register mask operands (i.e., calls) when
computing live intervals. Provide a checkRegMaskInterference() function
that computes a bit mask of usable registers for a live range.

This is a quick way of determining of a live range crosses any calls,
and restricting it to the callee saved registers if it does.
Previously, we had to discover call clobbers for each candidate register
independently.

llvm-svn: 150077
2012-02-08 17:33:45 +00:00
Benjamin Kramer fbe5d3a78f Value initialize MCRegisterClasses. Not sure how could miss this during the MCTargetDesc refactor.
llvm-svn: 150076
2012-02-08 14:43:53 +00:00
Alexander Potapenko 1da11ec357 Move the _ReturnAddress definition out of the __asan:: namespace
Patch by Timur Iskhodzhanov (timurrrr@google.com)

llvm-svn: 150075
2012-02-08 14:14:18 +00:00
Duncan Sands 0920308a7e Use Use::set rather than finding the operand number of the use
and setting that.

llvm-svn: 150074
2012-02-08 14:10:53 +00:00
Alexey Samsonov e725478e2f AddressSanitizer: replace all "real_X" calls with "REAL(X)"
llvm-svn: 150073
2012-02-08 13:45:31 +00:00
Aaron Ballman e1224a5067 Fixing hex floating literal support so that it handles 0x.2p2 properly.
llvm-svn: 150072
2012-02-08 13:36:33 +00:00
Benjamin Kramer 5e4f0a4a31 PathV2: Remove static StringRef ctors.
llvm-svn: 150071
2012-02-08 13:13:47 +00:00
Benjamin Kramer 793bd55f5a CodeGen: Move EHPersonality from CGException.h into the cpp file, it has no other users.
While at it make it value-initializable to get rid of static ctors.

llvm-svn: 150070
2012-02-08 12:41:24 +00:00
Alexander Potapenko 42cdb7e640 Typo fix: s/SNPrint/SNPrintf
llvm-svn: 150069
2012-02-08 11:45:09 +00:00
Elena Demikhovsky 1adc1d53dd Fixed a bug in printing "cmp" pseudo ops.
> This IR code
> %res = call <8 x float> @llvm.x86.avx.cmp.ps.256(<8 x float> %a0, <8 x float> %a1, i8 14)
> fails with assertion:
>
> llc: X86ATTInstPrinter.cpp:62: void llvm::X86ATTInstPrinter::printSSECC(const llvm::MCInst*, unsigned int, llvm::raw_ostream&): Assertion `0 && "Invalid ssecc argument!"' failed.
> 0  llc             0x0000000001355803
> 1  llc             0x0000000001355dc9
> 2  libpthread.so.0 0x00007f79a30575d0
> 3  libc.so.6       0x00007f79a23a1945 gsignal + 53
> 4  libc.so.6       0x00007f79a23a2f21 abort + 385
> 5  libc.so.6       0x00007f79a239a810 __assert_fail + 240
> 6  llc             0x00000000011858d5 llvm::X86ATTInstPrinter::printSSECC(llvm::MCInst const*, unsigned int, llvm::raw_ostream&) + 119

I added the full testing for all possible pseudo-ops of cmp.
I extended X86AsmPrinter.cpp and X86IntelInstPrinter.cpp.

You'l also see lines alignments (unrelated to this fix) in X86IselLowering.cpp from my previous check-in.

llvm-svn: 150068
2012-02-08 08:37:26 +00:00
Craig Topper 172b9243cd Remove a couple unneeded intrinsic patterns
llvm-svn: 150067
2012-02-08 08:29:30 +00:00
Richard Smith 90cacbbf3e Implement DR1458: Taking the address of an object of incomplete class type is
not a constant expression, because we can't tell whether the complete class type
will have an overloaded operator&.

llvm-svn: 150066
2012-02-08 08:11:33 +00:00
Chris Lattner 13f118f47b No actual functional change here, just some clarifications:
Clarify that contributors are agreeing to license their code under the 
license corresponding to the subproject that they are contributing to,
as requested by a potential contributor.

Also, as a drive-by, update the llvm-gcc/GPL section to mention dragonegg
and say that GPL code is all in its own repo's.

llvm-svn: 150065
2012-02-08 07:58:38 +00:00
Craig Topper e5ea3b0239 Remove vperm2f* and vperm2i builtins. Same effect can be achieved with builtin_shufflevector.
llvm-svn: 150064
2012-02-08 07:33:36 +00:00
Jason Molenda c56a4ea178 Version bump to 113.
llvm-svn: 150063
2012-02-08 07:31:16 +00:00
Richard Smith 3c7ad4e01b Add more testing for r149776.
llvm-svn: 150061
2012-02-08 06:41:34 +00:00