Commit Graph

140858 Commits

Author SHA1 Message Date
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
Shankar Easwaran b1d09c07f1 better implementation for findOutputSection
llvm-svn: 172236
2013-01-11 18:56:11 +00:00
Justin Holewinski f73d7a53ed Remove PTX->NVPTX in CodeGenerator document and update its text.
llvm-svn: 172235
2013-01-11 18:47:10 +00:00
Justin Holewinski ceab0dea55 Update CodeGenerator document to add a "Not Applicable" category to the
Target Feature Matrix, and update the PTX column with this new category.

llvm-svn: 172234
2013-01-11 18:37:54 +00:00
Manuel Klimek adededff26 Fix crash on invalid.
if { foo; }
would previously crash clang-format.

llvm-svn: 172232
2013-01-11 18:28:36 +00:00
Manuel Klimek d5e5f8f2a4 Fix parsing of initializer lists with elaborated type specifier.
Now we correctly parse and format:
verifyFormat("struct foo a = { bar };
int n;

llvm-svn: 172229
2013-01-11 18:13:04 +00:00
Eric Christopher 0cb6fd930e For inline asm:
- recognize string "{memory}" in the MI generation
- mark as mayload/maystore when there's a memory clobber constraint.

PR14859.

Patch by Krzysztof Parzyszek

llvm-svn: 172228
2013-01-11 18:12:39 +00:00
Greg Clayton c0e8a85ea8 Modified Value.cpp to share the code that gets the values as bytes (Value::GetValueAsData()) so now Value::ResolveValue() doesn't do its own thing by reading memory directly.
Also modified the Value class so that you can evaluate expressions without a process, yet with some sections loaded in the target. This allows casting pointers that are in data sections to types and being able to evaluate expressions in the data. For example:

(lldb) target create a.out
(lldb) target modules load --file a.out --slide 0
... find address of something in data ...
(lldb) script
expr_opts = lldb.SBExpressionOptions()
v = lldb.target.EvaluateExpression('(foo *)0x1230000', expr_opts)
print v
vv = lldb.value(v)
print v.pt.x

Above we were able to cast a pointer to an address which was in a.out's data
section and print out entire structures and navigate to the child ivars of the expression.

llvm-svn: 172227
2013-01-11 18:01:02 +00:00