Commit Graph

104813 Commits

Author SHA1 Message Date
Devang Patel 77dc541b00 Simplify handling of variables with complex address (i.e. blocks variables)
llvm-svn: 130339
2011-04-27 22:45:24 +00:00
Eli Friedman 406c471b69 Make the fast-isel code for literal 0.0 a bit shorter/faster, since 0.0 is common. rdar://problem/9303592 .
llvm-svn: 130338
2011-04-27 22:41:55 +00:00
Eli Friedman 121d27e9e4 Remove unused function.
llvm-svn: 130337
2011-04-27 22:21:02 +00:00
Ted Kremenek f8ac5288a3 Remove unused method CFGBlock::hasBinaryBranchTerminator().
llvm-svn: 130336
2011-04-27 22:16:58 +00:00
Eli Friedman 7ec652a7a2 Don't print fixits for format specifiers in cases where the fixit does not actually fix the warning. PR8781.
I'm not sure what the preferred way to write a test for whether a fixit is emitted.

llvm-svn: 130335
2011-04-27 22:06:20 +00:00
Greg Clayton 84c39663a9 Added a new OptionValue subclass for lldb::Format: OptionValueFormat. Added
new OptionGroup subclasses for:
- output file for use with options: 
        long opts: --outfile <path> --append--output
        short opts: -o <path> -A
        
- format for use with options:
        long opts: --format <format>

- variable object display controls for depth, pointer depth, wether to show
  types, show summary, show location, flat output, use objc "po" style summary.
  
Modified ValueObjectMemory to be able to be created either with a TypeSP or
a ClangASTType.

Switched "memory read" over to use OptionGroup subclasses: one for the outfile
options, one for the command specific options, and one for the format.

llvm-svn: 130334
2011-04-27 22:04:39 +00:00
NAKAMURA Takumi 8513d4236c docs/doxygen.css: Tweak style for readability.
A few styles are brought from http://llvm.org/test-doxygen/api/api.css

llvm-svn: 130333
2011-04-27 21:53:35 +00:00
Johnny Chen b2e1a5c998 Add a utility function smart_iter() which has knowledge of the getsize and the getelem
method names of all the lldb container objects and returns an iterator object when
passed an eligible lldb container object.

Example:

    from lldb_util import smart_iter
    for thread in smart_iter(process):
        ID = thread.GetThreadID()
        if thread.GetStopReason() == lldb.eStopReasonBreakpoint:
            stopped_due_to_breakpoint = True
        for frame in smart_iter(thread):
            self.assertTrue(frame.GetThread().GetThreadID() == ID)
        ...

Add a test case for lldb.smart_iter().

llvm-svn: 130332
2011-04-27 21:44:09 +00:00
Rafael Espindola 3989776770 Fix indentation.
llvm-svn: 130331
2011-04-27 21:29:52 +00:00
Kevin Enderby 886894cb70 Fix a bug in the case that there is no add or subtract symbol and the offset
value is zero so it does not add a NULL expr operand.

llvm-svn: 130330
2011-04-27 21:02:27 +00:00
Dan Gohman 5394c70d1e Teach BasicAA about arm.neon.vld1 and vst1.
llvm-svn: 130327
2011-04-27 20:44:28 +00:00
Devang Patel e3745fdcf3 Revert r130178. It turned out to be not the optimal path to emit complex location expressions.
llvm-svn: 130326
2011-04-27 20:29:27 +00:00
Johnny Chen f6c61a34bf Use new string formatting operations in assert messages to simplify things.
llvm-svn: 130325
2011-04-27 19:52:41 +00:00
Evan Cheng 9808d31b9e If converter was being too cute. It look for root BBs (which don't have
successors) and use inverse depth first search to traverse the BBs. However
that doesn't work when the CFG has infinite loops. Simply do a linear
traversal of all BBs work just fine.

rdar://9344645

llvm-svn: 130324
2011-04-27 19:32:43 +00:00
Johnny Chen 3c7a72c5ad Add another test case for lldb_iter(), this time using SBTarget to get at its SBBreakpoint containees.
llvm-svn: 130323
2011-04-27 19:29:39 +00:00
Ted Kremenek f26109664e Update scan-build to '-analyzer-checker debug.Stats' instead of the old '-analyzer-stats' -cc1 argument.
llvm-svn: 130320
2011-04-27 18:53:08 +00:00
Jim Ingham d5c06a68b5 Removing Greg's working directory & startup arguments from the shared lldb-tool scheme.
llvm-svn: 130319
2011-04-27 18:49:17 +00:00
Chandler Carruth ede9d33cde Heh, funny thing, 'void' isn't a POD type. Nice of us to suggest it to
silence this warning. ;]

Fixed that obvious bug and added a bit more testing as well.

llvm-svn: 130318
2011-04-27 18:48:59 +00:00
Dan Gohman 39b3a1ef7f When analyzing functions known to only access argument pointees,
only check arguments with pointer types. Update the documentation
of IntrReadArgMem reflect this.

While here, add support for TBAA tags on intrinsic calls.

llvm-svn: 130317
2011-04-27 18:39:03 +00:00
Andrew Trick 7d1eea86d9 Corrects an old, old typo in a case that doesn't seem to be reached in practice.
llvm-svn: 130316
2011-04-27 18:17:36 +00:00
Devang Patel 12bf0ab4b5 Simplify cfg inserts a call to trap when unreachable code is detected. Assign DebugLoc to this new trap instruction.
llvm-svn: 130315
2011-04-27 17:59:27 +00:00
Johnny Chen de90f1dd93 Change the rest of lldbutil.py's function names to all lower case formats to be consistent.
And modify the test cases accordingly.

llvm-svn: 130314
2011-04-27 17:43:07 +00:00
Jakob Stoklund Olesen 71d3b895ba Also add <imp-def> operands for defined and dead super-registers when rewriting.
We cannot rely on the <imp-def> operands added by LiveIntervals in all cases as
demonstrated by the test case.

llvm-svn: 130313
2011-04-27 17:42:31 +00:00
Stuart Hastings f2752a3938 Re-enable byval for ARM in clang. rdar://problem/7662569
llvm-svn: 130312
2011-04-27 17:24:02 +00:00
Fariborz Jahanian 595ec5d43c Some refactoring of my ms_struct patch.
// rdar://8823265 related.

llvm-svn: 130311
2011-04-27 17:14:21 +00:00
Douglas Gregor 5fc8c9eafb When printing a base-specifier, print the ellipsis ("...") if it is a
pack expansion. Fixes PR9452.

llvm-svn: 130310
2011-04-27 17:07:55 +00:00
Douglas Gregor 90ebf258c6 ASTImporter support for NestedNameSpecifier, from Olaf Krzikalla
llvm-svn: 130307
2011-04-27 16:48:40 +00:00
Manuel Klimek 6825eebcd6 This is the next step in building the standalone tools infrastructure:
This patch simplifies writing of standalone Clang tools. As an
example, we add clang-check, a tool that runs a syntax only frontend
action over a .cc file. When you integrate this into your favorite
editor, you get much faster feedback on your compilation errors, thus
reducing your feedback cycle especially when writing new code.

The tool depends on integration of an outstanding patch to CMake to
work which allows you to always have a current compile command
database in your cmake output directory when you set
CMAKE_EXPORT_COMPILE_COMMANDS.

llvm-svn: 130306
2011-04-27 16:39:14 +00:00
Rafael Espindola 27c0c9bb87 Factor a bit of code to MCStreamer::EmitLabel. Keep track of the last
non private symbol. This will be use for handling

foo:
  .cfi_startproc
  ...

On OS X where we have to create a foo.eh symbol.

llvm-svn: 130305
2011-04-27 15:21:19 +00:00
Lenny Maiorani 005b5c1aee More accurately model realloc() when the size argument is 0. realloc() with a size of 0 is equivalent to free(). The memory region should be marked as free and not used again.
Unit tests f2_realloc_0(), f6_realloc(), and f7_realloc() contributed by Marshall Clow <mclow.lists@gmail.com>. Thanks! 

llvm-svn: 130303
2011-04-27 14:49:29 +00:00
Duncan Sands 085ad3b81a Stop trying to have instcombine preserve LCSSA form: this was not
effective in avoiding recomputation of LCSSA form; the widespread
use of instsimplify (which looks through phi nodes) means it was
not preserving LCSSA form anyway; and instcombine is no longer
scheduled in the middle of the loop passes so this doesn't matter
anymore.

llvm-svn: 130301
2011-04-27 10:55:12 +00:00
Chandler Carruth 53caa4d4fa Add a warning (-Wnon-pod-memset) for calls to memset() with
a destination pointer that points to a non-POD type. This can flag such
horrible bugs as overwriting vptrs when a previously POD structure is
suddenly given a virtual method, or creating objects that crash on
practically any use by zero-ing out a member when its changed from
a const char* to a std::string, etc.

llvm-svn: 130299
2011-04-27 07:05:31 +00:00
John McCall 5476666d17 Diagnose attempts to implicitly instantiate a template before it is
fully defined.  Somehow this escaped notice for a very long time.

llvm-svn: 130298
2011-04-27 06:46:31 +00:00
Douglas Gregor da6c89de48 Introduce a new parser annotation token for primary expressions. When
ClassifyName() builds a primary expression, generate one of these
annotation tokens rather than jumping into the parser.

llvm-svn: 130297
2011-04-27 06:18:01 +00:00
Eric Christopher 956d96ce34 Remove this assert, I don't think it's being helpful and people have
been running into it.

llvm-svn: 130296
2011-04-27 05:48:06 +00:00
Douglas Gregor 9b2d706e05 Clean out some cruft I introduced when adding Sema::ClassifyName()
llvm-svn: 130295
2011-04-27 05:44:51 +00:00
Andrew Trick 01eff820ae Test case and comment for PR9633.
llvm-svn: 130294
2011-04-27 05:42:17 +00:00
Douglas Gregor 19b7acff10 Simplify the parser's handling of Sema::ClassifyName() for types, by
creating a type-annotation token rather than jumping into the
declaration parsing.

llvm-svn: 130293
2011-04-27 05:41:15 +00:00
Ted Kremenek 08b434f450 Allow 'Environment::getSVal()' to allow an optional way for checkers to do a direct lookup to values bound to expressions, without
resulting to lazy logic.  This is critical for the OSAtomicChecker that does a simulated load on any arbitrary expression.

llvm-svn: 130292
2011-04-27 05:34:09 +00:00
Chandler Carruth 938e4a89dd Add the test that I intended to submit with r130055, but forgot to add.
Apologies.

llvm-svn: 130291
2011-04-27 05:25:42 +00:00
Francois Pichet 33477fdfd5 Add support for Microsoft __interface keyword. An __interface class is basically a normal class containing just pure virtual functions. No urgency to enforce that restriction in clang for now, so make __interface an "class" alias.
llvm-svn: 130290
2011-04-27 05:07:51 +00:00
Argyrios Kyrtzidis f7620e4d49 If a null statement was preceded by an empty macro keep its instantiation source location
in NullStmt.

llvm-svn: 130289
2011-04-27 05:04:02 +00:00
Douglas Gregor 8b02cd0bea Extend Sema::ClassifyName() to support C++, ironing out a few issues
in the classification of template names and using declarations. We now
properly typo-correct the leading identifiers in statements to types,
templates, values, etc. As an added bonus, this reduces the number of
lookups required for disambiguation.

llvm-svn: 130288
2011-04-27 04:48:22 +00:00
Anders Carlsson c5d3ba1aad When compiling with -fno-threadsafe-statics, guard variables for globals with internal linkage don't have to be i64, i8 works just fine!
llvm-svn: 130286
2011-04-27 04:37:08 +00:00
Douglas Gregor ae79fdf170 Fix test
llvm-svn: 130285
2011-04-27 04:02:56 +00:00
Douglas Gregor 5e16c168fd Improve diagnostics for typo correction via Sema::ClassifyName(), by
looking at the context and the correction and using a custom
diagnostic. Also, enable some Fix-It tests that were somewhat lamely
disabled.

llvm-svn: 130283
2011-04-27 03:47:06 +00:00
Douglas Gregor 713dab5695 Add triple in the hope of unbreaking the bubuildbot
llvm-svn: 130280
2011-04-27 03:24:57 +00:00
Nick Lewycky 6fac9bcf67 Use static inline to do the right thing when built in C99 mode. Of course,
C89 doesn't have an inline keyword.

llvm-svn: 130279
2011-04-27 03:22:17 +00:00
Eli Friedman bcc6914146 Refactor out code to fast-isel a memcpy operation with a small constant
length.  (I'm planning to use this to implement byval.)

llvm-svn: 130274
2011-04-27 01:45:07 +00:00
Rafael Espindola ae124da625 Force some values to be absolute and align based on the FDE pointers size. A small
step towards using .cfi_* on OS X.

llvm-svn: 130273
2011-04-27 01:43:49 +00:00