Commit Graph

140895 Commits

Author SHA1 Message Date
Benjamin Kramer 5ea0349ef5 When lowering an inreg sext first shift left, then right arithmetically.
Shifting right two times will only yield zero. Should fix
SingleSource/UnitTests/SignlessTypes/factor.

llvm-svn: 172322
2013-01-12 19:06:44 +00:00
Arnaud A. de Grandmaison 3128a11ee8 Fix spurious output in JSONCompilationDatabase
llvm-svn: 172321
2013-01-12 18:37:52 +00:00
Dmitri Gribenko 1737bd3a92 Add missing includes and forward declarations so that headers don't depend on
other headers included before them.

llvm-svn: 172320
2013-01-12 16:54:37 +00:00
NAKAMURA Takumi de45c3a485 MipsDisassembler.cpp: Prune DecodeHWRegs64RegisterClass() to suppress a warning. [-Wunused-function]
llvm-svn: 172319
2013-01-12 15:37:00 +00:00
Benjamin Kramer 64a857ac69 GlobalOpt: Avoid jump on uninitialized value.
Found by valgrind.

llvm-svn: 172318
2013-01-12 15:34:31 +00:00
Rafael Espindola 6239e05adc comment
llvm-svn: 172317
2013-01-12 15:27:44 +00:00
Rafael Espindola c48f7341cc bar
llvm-svn: 172316
2013-01-12 15:27:43 +00:00
NAKAMURA Takumi 956c123ab6 MipsAsmParser: Try to unbreak tests to add extra check.
llvm-svn: 172315
2013-01-12 15:19:10 +00:00
Rafael Espindola 8f1187a11b Remove unused private field.
llvm-svn: 172314
2013-01-12 14:22:42 +00:00
Benjamin Kramer 410780b82c Add a unit test to verifies that attribute uniquing works so it doesn't break again.
The folding set details can be subtle and broke twice in the last couple of weeks.

llvm-svn: 172313
2013-01-12 14:13:45 +00:00
Tim Northover 53acb32afc Fix broken links around Itanium C++ ABI in documentation.
llvm-svn: 172312
2013-01-12 12:38:54 +00:00
Jason Molenda d7dc554c87 Recognize LOG_WATCHPOINTS in the QSetLogging gdb-remote packet.
llvm-svn: 172311
2013-01-12 08:32:28 +00:00
Daniel Jasper 7b7877ad7d Fix incorrect comparison operator causing loooong formatting times.
llvm-svn: 172308
2013-01-12 07:36:22 +00:00
Nico Weber cb465dcb1d Formatter: Remove an always-false condition.
canBreakBefore() does not allow breaking after ':' for LT_ObjCMethodDecl lines,
so if Newline is true in addTokenToState() for ':' then LT_ObjCMethodDecl
cannot be set. No functionality change.

llvm-svn: 172307
2013-01-12 07:05:25 +00:00
Nico Weber c7a56342bd Formatter: Remove a redundant CurrentLineType check.
The containing if checks for this already. No functionality change.

llvm-svn: 172306
2013-01-12 07:00:16 +00:00
Rafael Espindola 19de5613ea Disable caching of visibility.
The testcase in pr14929 shows that this is extremely hard to do. If we choose
to apply the attribute, that causes the visibility of some decls to change and
that can happen really late (during codegen).

Current gcc warns and ignores the attribute in this testcase with a warning.
This suggest that the correct solution is to find a point in the compilation
where we can compute the visibility and
* assert it was never computed before
* reject any attempts to compute it again in the future (with warnings).

llvm-svn: 172305
2013-01-12 06:42:30 +00:00
Nico Weber a7252d836a Formatter: Initial support for formatting Objective-C method expressions.
This follows the approach suggested by djasper in PR14911: When a '[' is         
seen that's at the start of a line, follows a binary operator, or follows one    
of : [ ( return throw, that '[' and its closing ']' are marked as
TT_ObjCMethodExpr and every ':' in that range that isn't part of a ternary
?: is marked as TT_ObjCMethodExpr as well.

Update the layout routines to not output spaces around ':' tokens that are
marked TT_ObjCMethodExpr, and only allow breaking after such tokens, not
before.

Before:
    [self adjustButton : closeButton_ ofKind : NSWindowCloseButton];

Now:
    [self adjustButton:closeButton_ ofKind:NSWindowCloseButton];

llvm-svn: 172304
2013-01-12 06:18:40 +00:00
Nico Weber eee7b81a16 Formatter: * and & are binary operators before ( and [.
llvm-svn: 172303
2013-01-12 05:50:48 +00:00
Nico Weber 5dafd4a7ae Formatter: * and & are binary operators after ) and ].
llvm-svn: 172302
2013-01-12 05:47:16 +00:00
Nico Weber 63a54eb766 Formatter: + and - after { are unary operators.
llvm-svn: 172301
2013-01-12 05:41:23 +00:00
Jason Molenda 1a100cd78f Add ifdef LLDB_DISABLE_PYTHON around newly added use of
AddCXXSummary in FormatManager::LoadSystemFormatters(); 
that function pulls in code that assumes python; can't
be used without the ifdef.

llvm-svn: 172300
2013-01-12 04:24:50 +00:00
Michael Gottesman 9f1be68703 Fixed debug message in ObjCARC.
llvm-svn: 172299
2013-01-12 03:45:49 +00:00
Michael Gottesman b24bdef7a4 Fixed a few debug messages in ObjCARC and added one.
llvm-svn: 172298
2013-01-12 02:57:16 +00:00
Michael J. Spencer 57752dc56e Factor File::addAtom out to MutableFile::addAtom.
This removes a bunch of llvm_unreachables and makes a File's mutability part of the type system.

llvm-svn: 172297
2013-01-12 02:45:54 +00:00
Bob Wilson ace548a9a3 Fix quoting problems from my previous change. <rdar://problem/13001651>
I give up trying to get all of the settings into COMMON_MAKEFLAGS, so just
do the easy thing and repeat the ones with interesting quoting issues
in each make command.

llvm-svn: 172296
2013-01-12 02:31:42 +00:00
NAKAMURA Takumi e73d2a9fff clang/unittests: Fixup corresponding to r172290.
llvm-svn: 172295
2013-01-12 02:16:29 +00:00
Sean Callanan c51cd47549 Made crashlog.py handle cases where a parent
process's name contains spaces.  Thanks to
Justin Seyster for the patch.

<rdar://problem/13002540>

llvm-svn: 172294
2013-01-12 02:11:49 +00:00
Sean Callanan 0bf0bafbc9 Removed the hack that uses "frame variable" to
evaluate expressions.  The expression parser and
IR interpreter are now fully capable of evaluating
expressions with as much (or better) fidelity.

<rdar://problem/12879364>

llvm-svn: 172293
2013-01-12 02:04:23 +00:00
Rafael Espindola 7cf35ef8f6 Fix a regression from 171193: main cannot be overloaded.
Thanks Eli Friedman for noticing it.

llvm-svn: 172292
2013-01-12 01:47:40 +00:00
Greg Clayton 399bf618de Don't always strip the first extension from the module basename when looking for python scripts. Now we take a name like "a.b.c" and look for scripts that are "a_b_c.py", "a_b.py" and "a.py" inside the dSYM.
llvm-svn: 172291
2013-01-12 01:36:05 +00:00
Douglas Gregor c147b0bc31 Provide Decl::getOwningModule(), which determines the (sub)module in
which a particular declaration resides. Use this information to
customize the "definition of 'blah' must be imported from another
module" diagnostic with the module the user actually has to
import. Additionally, recover by importing that module, so we don't
complain about other names in that module.

Still TODO: coming up with decent Fix-Its for these cases, and expand
this recovery approach for other name lookup failures.

llvm-svn: 172290
2013-01-12 01:29:50 +00:00
Nico Weber 4a5030c72f Formatter: add a test for :? in []
llvm-svn: 172289
2013-01-12 01:28:06 +00:00
Michael Gottesman 556ff61122 Fixed bug in ObjCARC where we were changing a call from objc_autoreleaseRV => objc_autorelease but were not updating the InstructionClass to IC_Autorelease.
llvm-svn: 172288
2013-01-12 01:25:19 +00:00
Michael Gottesman c9656faf1e Fixed a bug where we were tail calling objc_autorelease causing an object to not be placed into an autorelease pool.
The reason that this occurs is that tail calling objc_autorelease eventually
tail calls -[NSObject autorelease] which supports fast autorelease. This can
cause us to violate the semantic gaurantees of __autoreleasing variables that
assignment to an __autoreleasing variables always yields an object that is
placed into the innermost autorelease pool.

The fix included in this patch works by:

1. In the peephole optimization function OptimizeIndividualFunctions, always
remove tail call from objc_autorelease.
2. Whenever we convert to/from an objc_autorelease, set/unset the tail call
keyword as appropriate.

*NOTE* I also handled the case where objc_autorelease is converted in
OptimizeReturns to an autoreleaseRV which still violates the ARC semantics. I
will be removing that in a later patch and I wanted to make sure that the tree
is in a consistent state vis-a-vis ARC always.

Additionally some test cases are provided and all tests that have tail call marked
objc_autorelease keywords have been modified so that tail call has been removed.

*NOTE* One test fails due to a separate bug that I am going to commit soon. Thus
I marked the check line TMP: instead of CHECK: so make check does not fail.

llvm-svn: 172287
2013-01-12 01:25:15 +00:00
Enrico Granata e274088db0 <rdar://problem/12239827>
Making a summary for std::wstring as provided by libstdc++ along with a relevant test case

llvm-svn: 172286
2013-01-12 01:22:57 +00:00
Richard Smith a7edaad3b6 Only produce one -Wc++98-compat warning when initializing a reference from an init list with multiple elements.
llvm-svn: 172285
2013-01-12 01:05:20 +00:00
Jack Carter 873c724b4a This patch tackles the problem of parsing Mips
register names in the standalone assembler llvm-mc.

Registers such as $A1 can represent either a 32 or
64 bit register based on the instruction using it.
In addition, based on the abi, $T0 can represent different
32 bit registers.


The problem is resolved by the Mips specific AsmParser 
td definitions changing to work together. Many cases of
RegisterClass parameters are now RegisterOperand.


Contributer: Vladimir Medic
llvm-svn: 172284
2013-01-12 01:03:14 +00:00
Rafael Espindola d60589ad39 Add a test from pr14898.
llvm-svn: 172283
2013-01-12 01:01:06 +00:00
Enrico Granata 3309d88198 <rdar://problem/12239827>
Providing a data formatter for libc++ std::wstring
In the process, refactoring the std::string data formatter to be written in C++ so that commonalities between the two can be exploited
Also, providing a new API on the ValueObject to navigate a hierarchy by index-path
Lastly, an appropriate test case is included

llvm-svn: 172282
2013-01-12 01:00:22 +00:00
Jakob Stoklund Olesen 3dd236cdd8 Limit the search space in RAGreedy::tryEvict().
When tryEvict() is looking for a cheaper register in the allocation
order, skip the tail of too expensive registers when possible.

llvm-svn: 172281
2013-01-12 00:57:44 +00:00
Jakob Stoklund Olesen 8f644449af Precompute some information about register costs.
Remember the minimum cost of the registers in an allocation order and
the number of registers at the end of the allocation order that have the
same cost per use.

This information can be used to limit the search space for
RAGreedy::tryEvict() when looking for a cheaper register.

llvm-svn: 172280
2013-01-12 00:54:59 +00:00
Matt Beaumont-Gay b1e71a7d0c Fix -Wunused-comparison for comparisons in arguments to function-like macros.
Previously, -Wunused-comparison ignored comparisons in both macro bodies and
macro arguments, but we would still emit a -Wunused-value warning for either.
Now we correctly emit -Wunused-comparison for expressions in macro arguments.

Also, add isMacroBodyExpansion to SourceManager, to go along with
isMacroArgExpansion.

llvm-svn: 172279
2013-01-12 00:54:16 +00:00
Fariborz Jahanian 37494a176c comment parsing: when property accessors don't have comment
of their own (or are syntheszed), use prperty's comment.
for them. // rdar://12791315

llvm-svn: 172278
2013-01-12 00:28:34 +00:00
Eli Bendersky 03872a3a2e Stop hiding the interface-exposed EatToEndOfStatement (see r172276).
llvm-svn: 172277
2013-01-12 00:23:24 +00:00
Eli Bendersky 0cf0cb9247 Make ParseIdentifier a public method instead of private.
The MCAsmParser interface defines ParseIdentifier is public. There's no reason
whatsoever for AsmParser (which implements the MCAsmParser interface) to hide
this method.

This is all part of a bigger scheme. Several asm parsing "extensions" use the
main parser properly through the MCAsmParser interface. However,
GenericAsmParser has much more exclusive access and uses implementation details
from the concrete implementation - AsmParser, in which it is also declared as
a friend. This makes for overly coupled code, and even makes it hard to split
GenericAsmParser into a separate file. There's no reason why GenericAsmParser
shouldn't be able to access AsmParser through an abstract interface, as long
as it's actually registered as an extension.

llvm-svn: 172276
2013-01-12 00:05:00 +00:00
Greg Clayton 91c0e749e3 <rdar://problem/12973809>
Fixed an issue with the auto loading of script resources in debug info files. Any platform can add support for this, and on MacOSX we allow dSYM files to contain python modules that get automatically loaded when a dSYM file is associated with an executable or shared library. 

The modifications will now:
- Let the module locate the symbol file naturally instead of using a function that only works in certain cases. This helps us to locate the script resources as long as the dSYM file can be found.
- Don't try and do any of this if the script interpreter has scripting disabled.
- Allow more than one scripting resource to be found in a symbol file by returning the list
- Load the scripting resources when a symbol file is added via the "target symbols add" command.
- Be smarter about matching the dSYM mach-o file to an existing executable in the target images by stripping extensions on the symfile basname if needed.

llvm-svn: 172275
2013-01-11 23:44:27 +00:00
Ted Kremenek 4e9a2dbde5 Refine analyzer's handling of unary '!' and floating types to not assert.
Fixes PR 14634 and <rdar://problem/12903080>.

llvm-svn: 172274
2013-01-11 23:36:25 +00:00
Sean Callanan 19dfc93912 Fixed a bug that caused the AST importer to erroneously
import incomplete definitions for RecordDecls and then
mark the resulting definition as complete.

llvm-svn: 172273
2013-01-11 23:17:47 +00:00
Dmitri Gribenko 037f9d18ae libclang: use C++ casts in CXString.cpp
llvm-svn: 172272
2013-01-11 23:13:36 +00:00
Michael Gottesman 2a6542727d Fixed whitespace.
llvm-svn: 172271
2013-01-11 23:08:52 +00:00