Commit Graph

141065 Commits

Author SHA1 Message Date
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
Dmitri Gribenko ec3a16fc8c libclang: constness for CXString
llvm-svn: 172270
2013-01-11 23:08:18 +00:00
Nadav Rotem dbe5c72d03 PPC: Implement efficient lowering of sign_extend_inreg.
llvm-svn: 172269
2013-01-11 22:57:48 +00:00
Eli Bendersky 9652272db9 Proof of concept moving of generic directive parsing from AsmParser to the
GenericAsmParser extension, where a lot of directives are already being parsed.
The end goal is having just a single place (and a single lookup table) for
all directive parsing.

llvm-svn: 172268
2013-01-11 22:55:28 +00:00
Michael J. Spencer 3756852d62 [ELF] Fix comment.
llvm-svn: 172266
2013-01-11 22:39:56 +00:00
Michael J. Spencer 4ffbd608cd [ELF] Add AtomLayout instead of using pair<Atom, pair<uint64_t, uint64_t>>.
llvm-svn: 172265
2013-01-11 22:39:44 +00:00
Michael J. Spencer 2a5763cd86 [ELF] Use the correct cast.
llvm-svn: 172264
2013-01-11 22:39:31 +00:00
Ted Kremenek 039fac0347 Correctly propagate uninitialized values within logical expressions.
Fixes assertion failure reported in PR 14635 and
<rdar://problem/12902945> respectively.

llvm-svn: 172263
2013-01-11 22:35:39 +00:00
Argyrios Kyrtzidis c57e503c48 [PCH] Make the const_cast explicit to silence a compiler warning.
Patch by David Greene.

llvm-svn: 172262
2013-01-11 22:29:49 +00:00
Argyrios Kyrtzidis 49d9d02947 [libclang] Add some constness in CXSourceLocation and CXSourceRange.
llvm-svn: 172261
2013-01-11 22:29:47 +00:00
Argyrios Kyrtzidis 928e1fdecc [libclang] In ASTUnit::getMainFileName() Invocation may be null because the ASTUnit
came from loading a PCH/module.

llvm-svn: 172259
2013-01-11 22:11:14 +00:00
Preston Gurd 99c6990457 Update patch for the pad short functions pass for Intel Atom (only).
Adds a check for -Oz, changes the code to not re-visit BBs,
and skips over DBG_VALUE instrs.

Patch by Andy Zhang.

llvm-svn: 172258
2013-01-11 22:06:56 +00:00
Ted Kremenek 632af24eb8 Set process return code of 1 in set-xcode-analyzer when Xcode needs to be quit. Fixes <rdar://problem/12983031>.
llvm-svn: 172256
2013-01-11 21:49:36 +00:00
Michael J. Spencer bbe4b9812b [ELF] Simplify assert.
llvm-svn: 172255
2013-01-11 21:38:36 +00:00
Nico Weber a21aaae7b3 Formatter: Format ObjC static and instance methods consistently, add a test for that.
llvm-svn: 172254
2013-01-11 21:14:08 +00:00
Dmitri Gribenko 7a7284d881 libclang: remove unneeded casts
llvm-svn: 172253
2013-01-11 21:06:06 +00:00
Dmitri Gribenko ba2f746fea libclang: change CXCursor to store 'const void *' pointers for
const-correctness, and update all users

llvm-svn: 172252
2013-01-11 21:01:49 +00:00
Greg Clayton 1e0c88401e <rdar://problem/12990038>
Fixed an issue where the platform auto select code was changing the architecture and causing the wrong architecture to be assigned to the target.

llvm-svn: 172251
2013-01-11 20:49:54 +00:00
Howard Hinnant 8d9aec8802 Fix exception safety bug in vector::push_back
llvm-svn: 172250
2013-01-11 20:36:59 +00:00
Dmitri Gribenko bdc80de74c Constify parameter of clang::getCursorKindForDecl
llvm-svn: 172249
2013-01-11 20:32:41 +00:00
Benjamin Kramer fb3c009b52 Remove some accidentaly duplicated code. This needs urgent cleanup :(
llvm-svn: 172248
2013-01-11 20:11:33 +00:00
Michael Gottesman d1a46f23b4 Added debug messages to GlobalOpt.
Specifically:
1. Added a missing new line when we emit a debug message saying that we are marking a global variable as constant.
2. Added debug messages that describe what is occuring when GlobalOpt is evaluating a block/function.
3. Added a debug message that says what specific constructor is being evaluated.

llvm-svn: 172247
2013-01-11 20:07:53 +00:00
Benjamin Kramer 56b31bd9d7 Split TargetLowering into a CodeGen and a SelectionDAG part.
This fixes some of the cycles between libCodeGen and libSelectionDAG. It's still
a complete mess but as long as the edges consist of virtual call it doesn't
cause breakage. BasicTTI did static calls and thus broke some build
configurations.

llvm-svn: 172246
2013-01-11 20:05:37 +00:00
Nadav Rotem e55aa3c848 ARM Cost Model: Modify the target independent cost model to ask
the target if it supports the different CAST types. We didn't do this
on X86 because of the different register sizes and types, but on ARM
this makes sense.

llvm-svn: 172245
2013-01-11 19:54:13 +00:00
Rafael Espindola 46afb35181 Reject incompatible redeclarations of extern C symbols.
Before we were only checking if the new declaration itself was marked extern
C. Fixes prpr14766.

llvm-svn: 172243
2013-01-11 19:34:23 +00:00
Fariborz Jahanian 70ae634f87 Improve diagnostic per Richard's suggestion
(which may yet change if we move the diagnostic
 outside case value).

llvm-svn: 172242
2013-01-11 19:33:54 +00:00
Dmitri Gribenko 2c173b4806 libclang: use getCursorTU and getCursorASTUnit instead of explicit casts
llvm-svn: 172241
2013-01-11 19:28:44 +00:00
Bob Wilson d1897e4f86 Fix typo in function name and one more whitespace tweak.
llvm-svn: 172240
2013-01-11 19:24:51 +00:00
Manuel Klimek 9fa8d5578d Fix crashes in UnwrappedLineParser on missing parens.
llvm-svn: 172239
2013-01-11 19:23:05 +00:00
Manuel Klimek 2acb7b7bb1 Fix single-line optimization for ObjC.
Puts blocks always into multiple lines when they start with an ObjC
keyword or minus.

llvm-svn: 172238
2013-01-11 19:17:44 +00:00
Bob Wilson aec10c6d44 Fix whitespace.
This script used an inconsistent mix of spaces and tabs, and even
ignoring that, it still had inconsistent indentation, which is
pretty scary for a Python script. I also removed trailing whitespace
from some lines.

llvm-svn: 172237
2013-01-11 19:00:56 +00:00