platform/upstream/llvm.git
11 years agoAn Optional<T> is pod-like if the inner type is.
Benjamin Kramer [Fri, 22 Feb 2013 18:58:26 +0000 (18:58 +0000)]
An Optional<T> is pod-like if the inner type is.

llvm-svn: 175908

11 years ago[preprocessing record] Have the MacroDefinitions map point to the MacroDefinition...
Argyrios Kyrtzidis [Fri, 22 Feb 2013 18:35:59 +0000 (18:35 +0000)]
[preprocessing record] Have the MacroDefinitions map point to the MacroDefinition object instead
its index in the preprocessed entities vector.

This is because the order of the entities in the vector can change in some (uncommon) cases.

llvm-svn: 175907

11 years agoReplace some typically large vectors with SmallVector.
Benjamin Kramer [Fri, 22 Feb 2013 18:29:39 +0000 (18:29 +0000)]
Replace some typically large vectors with SmallVector.

This may seem counter-intuitive but the POD-like optimization helps when the
vectors grow into multimegabyte buffers. SmallVector calls realloc which knows
how to twiddle virtual memory bits and avoids large copies.

llvm-svn: 175906

11 years agoRemove unused CHECK lines copied from another test
Pete Cooper [Fri, 22 Feb 2013 18:16:21 +0000 (18:16 +0000)]
Remove unused CHECK lines copied from another test

llvm-svn: 175905

11 years agosort quickdata for the hexagon target
Shankar Easwaran [Fri, 22 Feb 2013 18:01:08 +0000 (18:01 +0000)]
sort quickdata for the hexagon target

llvm-svn: 175904

11 years agoMake sure pragmas don't attach visibility attributes to auto variables with
Rafael Espindola [Fri, 22 Feb 2013 17:59:16 +0000 (17:59 +0000)]
Make sure pragmas don't attach visibility attributes to auto variables with
internal linkage.

llvm-svn: 175903

11 years agoSuppress -Wswitch to unbreak the build.
David Blaikie [Fri, 22 Feb 2013 17:44:58 +0000 (17:44 +0000)]
Suppress -Wswitch to unbreak the build.

This may need to be fixed more intelligently - I don't have enough context to
be sure what the appropriate fix is right now.

llvm-svn: 175902

11 years agoadd changes for typeDataFast
Shankar Easwaran [Fri, 22 Feb 2013 17:18:53 +0000 (17:18 +0000)]
add changes for typeDataFast

llvm-svn: 175901

11 years ago[Sema] Semantic analysis for empty-declaration and attribute-declaration.
Michael Han [Fri, 22 Feb 2013 17:15:32 +0000 (17:15 +0000)]
[Sema] Semantic analysis for empty-declaration and attribute-declaration.

Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain
to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these
attributes can be sema checked just as attributes attached to "normal" declarations.

llvm-svn: 175900

11 years agoMore tests to global struct vectorizer
Renato Golin [Fri, 22 Feb 2013 16:18:31 +0000 (16:18 +0000)]
More tests to global struct vectorizer

llvm-svn: 175898

11 years agoUse raw_ostream::indent, update comment.
Benjamin Kramer [Fri, 22 Feb 2013 16:13:34 +0000 (16:13 +0000)]
Use raw_ostream::indent, update comment.

llvm-svn: 175897

11 years agoPush the raw_ostream through the template diffing code.
Benjamin Kramer [Fri, 22 Feb 2013 16:08:12 +0000 (16:08 +0000)]
Push the raw_ostream through the template diffing code.

llvm-svn: 175896

11 years agoStreamify FormatASTNodeDiagnosticArgument.
Benjamin Kramer [Fri, 22 Feb 2013 15:46:08 +0000 (15:46 +0000)]
Streamify FormatASTNodeDiagnosticArgument.

llvm-svn: 175895

11 years agoStreamify getNameForDiagnostic and remove the string versions of PrintTemplateArgumen...
Benjamin Kramer [Fri, 22 Feb 2013 15:46:01 +0000 (15:46 +0000)]
Streamify getNameForDiagnostic and remove the string versions of PrintTemplateArgumentList.

llvm-svn: 175894

11 years ago[Sanitizer] Add a test for the fast unwinder
Reid Kleckner [Fri, 22 Feb 2013 15:10:16 +0000 (15:10 +0000)]
[Sanitizer] Add a test for the fast unwinder

Summary:
The test sets up fake x86-style fp+retaddr frames, since that's all the
unwinder works with.

Reviewers: kcc

CC: eugenis
Differential Revision: http://llvm-reviews.chandlerc.com/D445

llvm-svn: 175893

11 years agoComment parsing: add CommentOptions to allow specifying custom comment block commands
Dmitri Gribenko [Fri, 22 Feb 2013 14:21:27 +0000 (14:21 +0000)]
Comment parsing: add CommentOptions to allow specifying custom comment block commands

Add an ability to specify custom documentation block comment commands via a new
class CommentOptions.  The intention is that this class will hold future
customizations for comment parsing, including defining documentation comments
with specific numbers of parameters, etc.

CommentOptions instance is a member of LangOptions.

CommentOptions is controlled by a new command-line parameter
-fcomment-block-commands=Foo,Bar,Baz.

llvm-svn: 175892

11 years agoStmtPrinter: Directly print types to the stream instead of taking a detour through...
Benjamin Kramer [Fri, 22 Feb 2013 14:19:01 +0000 (14:19 +0000)]
StmtPrinter: Directly print types to the stream instead of taking a detour through getAsString.

llvm-svn: 175891

11 years agoFix MergeFunctionDecl implicit CC for static methods.
Timur Iskhodzhanov [Fri, 22 Feb 2013 12:42:50 +0000 (12:42 +0000)]
Fix MergeFunctionDecl implicit CC for static methods.

Patch by Alexander Zinenko!

llvm-svn: 175890

11 years agoscan-build: Remove debug print.
Benjamin Kramer [Fri, 22 Feb 2013 12:07:39 +0000 (12:07 +0000)]
scan-build: Remove debug print.

PR15329.

llvm-svn: 175889

11 years agoMade it more explicit that the self-referential llvm.loop identifier metadata
Pekka Jaaskelainen [Fri, 22 Feb 2013 12:03:07 +0000 (12:03 +0000)]
Made it more explicit that the self-referential llvm.loop identifier metadata
should be unique for each loop.

llvm-svn: 175888

11 years agoR600/SI: Add pattern for sign extension of i1 to i32.
Michel Danzer [Fri, 22 Feb 2013 11:22:58 +0000 (11:22 +0000)]
R600/SI: Add pattern for sign extension of i1 to i32.

16 more little piglits with radeonsi.

NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 175887

11 years agoR600/SI: Add pattern for logical or of i1 values.
Michel Danzer [Fri, 22 Feb 2013 11:22:54 +0000 (11:22 +0000)]
R600/SI: Add pattern for logical or of i1 values.

24 more little piglits with radeonsi.

NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 175886

11 years agoR600/SI: Add pattern for fceil.
Michel Danzer [Fri, 22 Feb 2013 11:22:49 +0000 (11:22 +0000)]
R600/SI: Add pattern for fceil.

9 more little piglits with radeonsi.

NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 175885

11 years agoMake ARMAsmPrinter generate the correct alignment specifier syntax in instructions.
Kristof Beyls [Fri, 22 Feb 2013 10:01:33 +0000 (10:01 +0000)]
Make ARMAsmPrinter generate the correct alignment specifier syntax in instructions.

The Printer will now print instructions with the correct alignment specifier syntax, like
    vld1.8  {d16}, [r0:64]

llvm-svn: 175884

11 years ago[msan] MSanDR: initial commit.
Evgeniy Stepanov [Fri, 22 Feb 2013 09:34:19 +0000 (09:34 +0000)]
[msan] MSanDR: initial commit.

MSanDR is a DynamoRio-based tool that handles uninstrumented libraries and
dynamically generated code for MSan.

llvm-svn: 175883

11 years agoC++11 status page:
Richard Smith [Fri, 22 Feb 2013 09:31:00 +0000 (09:31 +0000)]
C++11 status page:
 * Mark attributes as done in SVN.
 * Downgrade alignment support from 'Clang 3.0' to 'SVN', now that we actually implement the rules.
 * Upgrade 'Dynamic initialization with concurrency' from 'No' to 'Clang 2.9' -- all that is required here is the ABI-mandated locking for the initialization of static locals.

llvm-svn: 175882

11 years agoUse attributes references on call/invoke instructions.
Bill Wendling [Fri, 22 Feb 2013 09:29:15 +0000 (09:29 +0000)]
Use attributes references on call/invoke instructions.

llvm-svn: 175881

11 years agoDon't crash if we try to apply 'alignas' to a variable declared with an
Richard Smith [Fri, 22 Feb 2013 09:21:42 +0000 (09:21 +0000)]
Don't crash if we try to apply 'alignas' to a variable declared with an
incomplete type.

llvm-svn: 175880

11 years agoDon't accidentally and silently accept C++11 attributes in decl-specifier-seqs
Richard Smith [Fri, 22 Feb 2013 09:15:49 +0000 (09:15 +0000)]
Don't accidentally and silently accept C++11 attributes in decl-specifier-seqs
in C++98.

llvm-svn: 175879

11 years agoUpdate to use references to attribute groups instead of listing the attributes on...
Bill Wendling [Fri, 22 Feb 2013 09:10:20 +0000 (09:10 +0000)]
Update to use references to attribute groups instead of listing the attributes on the call/invoke instructions.

llvm-svn: 175878

11 years agoUse references to attribute groups on the call/invoke instructions.
Bill Wendling [Fri, 22 Feb 2013 09:09:42 +0000 (09:09 +0000)]
Use references to attribute groups on the call/invoke instructions.

Listing all of the attributes for the callee of a call/invoke instruction is way
too much and makes the IR unreadable. Use references to attributes instead.

llvm-svn: 175877

11 years agoPer the grammar in [dcl.dcl]p1, a simple-declaration can only have attributes
Richard Smith [Fri, 22 Feb 2013 09:06:26 +0000 (09:06 +0000)]
Per the grammar in [dcl.dcl]p1, a simple-declaration can only have attributes
if it has declarators. We were missing the check for this in a couple of places.

llvm-svn: 175876

11 years agoHandle alignas(foo...) pack expansions.
Richard Smith [Fri, 22 Feb 2013 08:32:16 +0000 (08:32 +0000)]
Handle alignas(foo...) pack expansions.

llvm-svn: 175875

11 years agoSupport: clang-format
Tobias Grosser [Fri, 22 Feb 2013 08:21:52 +0000 (08:21 +0000)]
Support: clang-format

llvm-svn: 175874

11 years agoRemove unintended comment.
Jason Molenda [Fri, 22 Feb 2013 08:16:09 +0000 (08:16 +0000)]
Remove unintended comment.

llvm-svn: 175873

11 years agoCodeGen: clang-format
Tobias Grosser [Fri, 22 Feb 2013 08:07:06 +0000 (08:07 +0000)]
CodeGen: clang-format

llvm-svn: 175872

11 years ago[asan] move the .preinit_array hack into a separate file (added used attribute)
Kostya Serebryany [Fri, 22 Feb 2013 07:51:26 +0000 (07:51 +0000)]
[asan] move the .preinit_array hack into a separate file (added used attribute)

llvm-svn: 175871

11 years agoChange debugserver from using the mach port number (in debugserver's
Jason Molenda [Fri, 22 Feb 2013 07:27:08 +0000 (07:27 +0000)]
Change debugserver from using the mach port number (in debugserver's
own port namepsace) as the thread identifier to using the system-wide
globally unique thread id as the thread identifier number.

MachThread.cpp keeps both the unique id and the mach port number
for each thread.  All layers outside MachThread class use the unique
id with three exceptions: (1) Mach exceptions come in with the port
number (thread_port) which needs to be translated, (2) any calls to
low-level thread_get_state/thread_set_state/thread_suspend etc need
to use the mach port number, (3) MachThreadList::UpdateThreadList
which creates the MachThread objects gets the unique id and passes
it to the MachThread ctor as an argument.

In general, any time nub_thread_t is used, it is now referring to a
unique thread id.  Any time a thread_t is used, it is now referring
to a mach port number.  There was some interchangability of these
types previously.  nub_thread_t has also been changed to a 64-bit
type which necessitated some printf specification string changes.

I haven't been able to test these changes extensively yet but want
to checkpoint the work.  The scenarios I've been testing are all
working correctly so while there may be some corner cases I haven't
hit yet, I think it is substantially correct.

<rdar://problem/12931414>

llvm-svn: 175870

11 years agoIn LookupResult::resolveKind(), when handling multiple found declarations, ignore...
Argyrios Kyrtzidis [Fri, 22 Feb 2013 06:58:37 +0000 (06:58 +0000)]
In LookupResult::resolveKind(), when handling multiple found declarations, ignore invalid declarations.

This reduces the "ambiguous reference" errors (which are rather strange in C/ObjC) and fixes an assertion hit
with an invalid code test case.

llvm-svn: 175869

11 years agoWhen a parameter list in a C function has an error, recover by forming a K&R function,
Argyrios Kyrtzidis [Fri, 22 Feb 2013 06:58:32 +0000 (06:58 +0000)]
When a parameter list in a C function has an error, recover by forming a K&R function,
instead of a non-function type.

llvm-svn: 175868

11 years agoDon't crash when applying an alloc_size attribute on a K&R function.
Argyrios Kyrtzidis [Fri, 22 Feb 2013 06:58:28 +0000 (06:58 +0000)]
Don't crash when applying an alloc_size attribute on a K&R function.

llvm-svn: 175867

11 years agoDon't skip '_Alignas' when disambiguating 'final'. '_Alignas' can't appear here,
Richard Smith [Fri, 22 Feb 2013 06:46:23 +0000 (06:46 +0000)]
Don't skip '_Alignas' when disambiguating 'final'. '_Alignas' can't appear here,
and we used to assert if it did.

llvm-svn: 175866

11 years agoFix a nomenclature mistake. Slt->Slti in the functions. The "i" refers
Reed Kotler [Fri, 22 Feb 2013 05:59:39 +0000 (05:59 +0000)]
Fix a nomenclature mistake. Slt->Slti in the functions. The "i" refers
to the immediate operand of sli or cmp function.

llvm-svn: 175865

11 years agoTeach -ast-print how to print trailing-return-types.
Richard Smith [Fri, 22 Feb 2013 05:54:51 +0000 (05:54 +0000)]
Teach -ast-print how to print trailing-return-types.

llvm-svn: 175864

11 years ago[analyzer] Implement "Loop executed 0 times" diagnostic correctly.
Ted Kremenek [Fri, 22 Feb 2013 05:45:33 +0000 (05:45 +0000)]
[analyzer] Implement "Loop executed 0 times" diagnostic correctly.

Fixes <rdar://problem/13236549>

llvm-svn: 175863

11 years agoExpand mips16 SelT form pseudso/macros.
Reed Kotler [Fri, 22 Feb 2013 05:10:51 +0000 (05:10 +0000)]
Expand mips16 SelT form pseudso/macros.

llvm-svn: 175862

11 years agoImplement C++11 [dcl.align]p6-p8, and C11 6.7.5/7. This had to be split out of
Richard Smith [Fri, 22 Feb 2013 04:55:39 +0000 (04:55 +0000)]
Implement C++11 [dcl.align]p6-p8, and C11 6.7.5/7. This had to be split out of
the normal attribute-merging path, because we can't merge alignment attributes
without knowing the complete set of alignment attributes which apply to a
particular declaration.

llvm-svn: 175861

11 years ago[libclang] Fix a crash with invalid code, while skip function bodies is enabled.
Argyrios Kyrtzidis [Fri, 22 Feb 2013 04:11:06 +0000 (04:11 +0000)]
[libclang] Fix a crash with invalid code, while skip function bodies is enabled.

llvm-svn: 175860

11 years agoDecl.cpp/mergeTemplateLV(): Tweak a description. [-Wdocumentation]
NAKAMURA Takumi [Fri, 22 Feb 2013 04:06:28 +0000 (04:06 +0000)]
Decl.cpp/mergeTemplateLV(): Tweak a description. [-Wdocumentation]

llvm-svn: 175859

11 years agoOnly suppress instance context if a member is actually
John McCall [Fri, 22 Feb 2013 03:52:55 +0000 (03:52 +0000)]
Only suppress instance context if a member is actually
accessible in its declaring class;  otherwise we might
fail to apply [class.protected] when considering
accessibility in derived classes.

Noticed by inspection; <rdar://13270329>.

I had an existing test wrong.  Here's why it's wrong:

Follow the rules (and notation) of [class.access]p5.
The naming class (N) is B and the context (R) is D::getX.
- 'x' as a member of B is protected, but R does not occur
  in a member or friend of a class derived from B.
- There does exist a base class of B, A, which is accessible
  from R, and 'x' is accessible at R when named in A because
  'x' as a member of A is protected and R occurs in a member
  of a class, D, that is derived from A;  however, by
  [class.protected], the class of the object expression must
  be equal to or derived from that class, and A does not
  derive from D.

llvm-svn: 175858

11 years ago[analyzer] Place all inlining policy checks into one palce
Anna Zaks [Fri, 22 Feb 2013 02:59:24 +0000 (02:59 +0000)]
[analyzer] Place all inlining policy checks into one palce

Previously, we had the decisions about inlining spread out
over multiple functions.

In addition to the refactor, this commit ensures
that we will always inline BodyFarm functions as long as the Decl
is available. This fixes false positives due to those functions
not being inlined when no or minimal inlining is enabled such (as
shallow mode).

llvm-svn: 175857

11 years agoUsing __package__ and __name__ seems redundant - __name__ should always contain the...
Enrico Granata [Fri, 22 Feb 2013 02:21:10 +0000 (02:21 +0000)]
Using __package__ and __name__ seems redundant - __name__ should always contain the fully qualified module name

llvm-svn: 175856

11 years agoAdd -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,
Richard Smith [Fri, 22 Feb 2013 01:59:51 +0000 (01:59 +0000)]
Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,
to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting
levels for parentheses, brackets and braces.

Some code with heavy macro use exceeds the default limit of 256, but we don't
want to increase it generally to avoid stack overflow on stack-constrained
systems.

llvm-svn: 175855

11 years ago[analyzer] Make sure a materialized temporary matches its bindings.
Jordan Rose [Fri, 22 Feb 2013 01:51:15 +0000 (01:51 +0000)]
[analyzer] Make sure a materialized temporary matches its bindings.

This is a follow-up to r175830, which made sure a temporary object region
created for, say, a struct rvalue matched up with the initial bindings
being stored into it. This does the same for the case in which the AST
actually tells us that we need to create a temporary via a
MaterializeObjectExpr. I've unified the two code paths and moved a static
helper function onto ExprEngine.

This also caused a bit of test churn, causing us to go back to describing
temporary regions without a 'const' qualifier. This seems acceptable; it's
our behavior from a few months ago.

<rdar://problem/13265460> (part 2)

llvm-svn: 175854

11 years agoFix isa<> check which could never be true.
Pete Cooper [Fri, 22 Feb 2013 01:50:38 +0000 (01:50 +0000)]
Fix isa<> check which could never be true.

It was incorrectly checking a Function* being an IntrinsicInst* which
isn't possible.  It should always have been checking the CallInst* instead.

Added test case for x86 which ensures we only get one constant load.
It was 2 before this change.

rdar://problem/13267920

llvm-svn: 175853

11 years agoFix regression in modeling assignments of an address of a variable to itself. Fixes...
Ted Kremenek [Fri, 22 Feb 2013 01:39:26 +0000 (01:39 +0000)]
Fix regression in modeling assignments of an address of a variable to itself.  Fixes <rdar://problem/13226577>.

llvm-svn: 175852

11 years agoMake sure we only use the output file as a base for debug splitting
Eric Christopher [Fri, 22 Feb 2013 01:33:46 +0000 (01:33 +0000)]
Make sure we only use the output file as a base for debug splitting
if we're compiling.

llvm-svn: 175851

11 years agoobjective-C arc: Diagnostic can not say to use bridge
Fariborz Jahanian [Fri, 22 Feb 2013 01:22:48 +0000 (01:22 +0000)]
objective-C arc: Diagnostic can not say to use bridge
casts with c++ named casts. Change notes to say use
bridge with c-style cast instead. // rdar://12788838

llvm-svn: 175850

11 years agoRemove code copied from GenRegisterInfo.inc.
Andrew Trick [Fri, 22 Feb 2013 01:15:08 +0000 (01:15 +0000)]
Remove code copied from GenRegisterInfo.inc.

There's no apparent reason this code was copied from generated source
into a .cpp. It sets a bad example for those working on other targets
and trying to understand the register info API.

llvm-svn: 175849

11 years ago[analyzer] Fix buildbot by not reusing a variable name.
Jordan Rose [Fri, 22 Feb 2013 01:08:00 +0000 (01:08 +0000)]
[analyzer] Fix buildbot by not reusing a variable name.

llvm-svn: 175848

11 years agoCode cleanup: pass Offset by pointer to parseInstruction to more explicitly
Eli Bendersky [Fri, 22 Feb 2013 00:50:48 +0000 (00:50 +0000)]
Code cleanup: pass Offset by pointer to parseInstruction to more explicitly
convey that it's a INOUT argument.
Also, if parsing of entry instructions fails, don't push the entry.

llvm-svn: 175847

11 years agoRemove warning about default covering no cases.
Bill Wendling [Fri, 22 Feb 2013 00:50:09 +0000 (00:50 +0000)]
Remove warning about default covering no cases.

llvm-svn: 175846

11 years agoFixing the watchpoint test case to reflect changes in error reporting
Enrico Granata [Fri, 22 Feb 2013 00:44:16 +0000 (00:44 +0000)]
Fixing the watchpoint test case to reflect changes in error reporting

llvm-svn: 175845

11 years agoMake the lldbtest tear down routine a little less error prone
Daniel Malea [Fri, 22 Feb 2013 00:41:26 +0000 (00:41 +0000)]
Make the lldbtest tear down routine a little less error prone
- replace "catch-all" except clause with one that specifically catches what pexpect throws
- handle case where child is already terminated (or is terminating) by the time tear-down is run

llvm-svn: 175844

11 years agoAdd a bitmask for NoBuiltin. This should *not* be used.
Bill Wendling [Fri, 22 Feb 2013 00:40:12 +0000 (00:40 +0000)]
Add a bitmask for NoBuiltin. This should *not* be used.

llvm-svn: 175843

11 years agoIgnore the check for com.apple.main-thread - it is not critical for the test case...
Enrico Granata [Fri, 22 Feb 2013 00:39:53 +0000 (00:39 +0000)]
Ignore the check for com.apple.main-thread - it is not critical for the test case's logic

llvm-svn: 175842

11 years agoThe summary for const char* was not cascading.
Enrico Granata [Fri, 22 Feb 2013 00:37:31 +0000 (00:37 +0000)]
The summary for const char* was not cascading.
This was preventing us from providing a summary for the result of std::string.c_str() with libc++

llvm-svn: 175841

11 years agoPreproceessor: fix #if skipping under -traditional-cpp.
Jordan Rose [Fri, 22 Feb 2013 00:32:00 +0000 (00:32 +0000)]
Preproceessor: fix #if skipping under -traditional-cpp.

When parsing directives within skipped #if blocks, we don't want to retain
any whitespace. Previously we were just skipping comments, but it's not
possible to skip comments and retain other whitespace. This change matches
the usual behavior for parsing directives (i.e. the behavior outside of
skipped #if blocks).

<rdar://problem/13267695>

llvm-svn: 175840

11 years agoMake logic smaller.
Eric Christopher [Fri, 22 Feb 2013 00:24:40 +0000 (00:24 +0000)]
Make logic smaller.

llvm-svn: 175839

11 years agoAdded a footnote to the documentation for objc_storeStrong that makes it clear
Michael Gottesman [Fri, 22 Feb 2013 00:16:48 +0000 (00:16 +0000)]
Added a footnote to the documentation for objc_storeStrong that makes it clear
that a __strong object of block type is a valid argument to objc_storeStrong but
that an objc_retain and not an objc_retainBlock will be emitted.

llvm-svn: 175838

11 years agoRemoving has_getDecl (added in r175532). It cause a build break for MSVC, and was...
Aaron Ballman [Fri, 22 Feb 2013 00:15:31 +0000 (00:15 +0000)]
Removing has_getDecl (added in r175532). It cause a build break for MSVC, and was not yet being used in the codebase. If we start using std::enable_if, we can look into resurrecting the idea in a more portable fashion.

llvm-svn: 175837

11 years agoApply the 'nobuiltin' attribute to call sites when the user specifies `-fno-builtin...
Bill Wendling [Fri, 22 Feb 2013 00:13:35 +0000 (00:13 +0000)]
Apply the 'nobuiltin' attribute to call sites when the user specifies `-fno-builtin' on the command line.

llvm-svn: 175836

11 years agoImplement the NoBuiltin attribute.
Bill Wendling [Fri, 22 Feb 2013 00:12:35 +0000 (00:12 +0000)]
Implement the NoBuiltin attribute.

The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should
not treat the callee function as a built-in function. I.e., it shouldn't try to
replace that function with different code.

llvm-svn: 175835

11 years agoMake for x86 to stop it failing on ARM buildbots.
Bill Wendling [Fri, 22 Feb 2013 00:04:55 +0000 (00:04 +0000)]
Make for x86 to stop it failing on ARM buildbots.

llvm-svn: 175834

11 years agoGrammar.
Eric Christopher [Fri, 22 Feb 2013 00:03:08 +0000 (00:03 +0000)]
Grammar.

llvm-svn: 175833

11 years agoIf the inferior program is compiled with libc++, you won't see libstdc++
Enrico Granata [Thu, 21 Feb 2013 23:59:42 +0000 (23:59 +0000)]
If the inferior program is compiled with libc++, you won't see libstdc++

llvm-svn: 175832

11 years ago<rdar://problem/13265017>
Enrico Granata [Thu, 21 Feb 2013 23:57:25 +0000 (23:57 +0000)]
<rdar://problem/13265017>

The notion of Crossref command has long been forgotten, and there is nothing using CommandObjectCrossref in the current LLDB codebase
However, this was causing a conflict with process plugins and command aliases ending up in an infinite loop under situations such as:
(lldb) command alias monitor process plugin packet monitor
(lldb) process att -n Calendar
Process 28709 stopped
Executable module set to "/Applications/Calendar.app/Contents/MacOS/Calendar".
Architecture set to: x86_64-apple-macosx.
(lldb) command alias monitor process plugin packet monitor

This fixes the loop (and consequent crash) by disposing of Crossref commands and related code

llvm-svn: 175831

11 years ago[analyzer] Make sure a temporary object region matches its initial bindings.
Jordan Rose [Thu, 21 Feb 2013 23:57:17 +0000 (23:57 +0000)]
[analyzer] Make sure a temporary object region matches its initial bindings.

When creating a temporary region (say, when a struct rvalue is used as
the base of a member expr), make sure we account for any derived-to-base
casts. We don't actually record these in the LazyCompoundVal that
represents the rvalue, but we need to make sure that the temporary region
we're creating (a) matches the bindings, and (b) matches its expression.

Most of the time this will do exactly the same thing as before, but it
fixes spurious "garbage value" warnings introduced in r175234 by the use
of lazy bindings to model trivial copy constructors.

<rdar://problem/13265460>

llvm-svn: 175830

11 years agoFix clang warnings related to python macro redefinition and printf format specifiers.
Matt Kopec [Thu, 21 Feb 2013 23:55:31 +0000 (23:55 +0000)]
Fix clang warnings related to python macro redefinition and printf format specifiers.

llvm-svn: 175829

11 years agoChange to JITDefault code model for ELF targets
Andrew Kaylor [Thu, 21 Feb 2013 23:45:19 +0000 (23:45 +0000)]
Change to JITDefault code model for ELF targets

On x86-64 platforms, the small code model assumes that code will be loaded below the 2GB boundary.  With the static relocation model, the fact that the expression code is initially loaded (in the LLDB debugger address space) above that boundary causes problems.  Switching to the JITDefault code model causes the large code model to be used for 64-bit targets and small code model of 32-bit targets.

llvm-svn: 175828

11 years agoIgnore visibility from enclosing template arguments
John McCall [Thu, 21 Feb 2013 23:42:58 +0000 (23:42 +0000)]
Ignore visibility from enclosing template arguments
for explicit member specializations.

llvm-svn: 175827

11 years agoSimplify code to use castAs rather than getAs + assert.
David Blaikie [Thu, 21 Feb 2013 23:35:06 +0000 (23:35 +0000)]
Simplify code to use castAs rather than getAs + assert.

Post commit review feedback on r175812 from Jordan Rose.

llvm-svn: 175826

11 years agoFix copy/paste to refer to the relevant type (ProgramPoint instead of TypeLoc).
David Blaikie [Thu, 21 Feb 2013 23:35:03 +0000 (23:35 +0000)]
Fix copy/paste to refer to the relevant type (ProgramPoint instead of TypeLoc).

Post commit review feedback on r175812 from Jordan Rose.

llvm-svn: 175825

11 years agoclang/test/Driver/qa_override.c: Appease gcc-driver.
NAKAMURA Takumi [Thu, 21 Feb 2013 23:17:45 +0000 (23:17 +0000)]
clang/test/Driver/qa_override.c: Appease gcc-driver.

llvm-svn: 175824

11 years agoFix typo 'with with' in diagnostic.
Richard Smith [Thu, 21 Feb 2013 23:15:05 +0000 (23:15 +0000)]
Fix typo 'with with' in diagnostic.

llvm-svn: 175823

11 years agoFix TestPublicAPIHeaders test on machines that have [DY]LD_LIBRARY_PATH that must...
Daniel Malea [Thu, 21 Feb 2013 23:07:30 +0000 (23:07 +0000)]
Fix TestPublicAPIHeaders test on machines that have [DY]LD_LIBRARY_PATH that must be preserved.

llvm-svn: 175822

11 years agoStop relying on physical register kill flags in isKilled() in the two-address
Cameron Zwarich [Thu, 21 Feb 2013 22:58:42 +0000 (22:58 +0000)]
Stop relying on physical register kill flags in isKilled() in the two-address
pass. One of the callers of isKilled() can cope with overapproximation of kills
and the other can't, so I added a flag to indicate this.

In theory this could pessimize code slightly, but in practice most physical
register uses are kills, and most important kills of physical registers are the
only uses of that register prior to register allocation, so we can recognize
them as kills even without kill flags.

This is relevant because LiveIntervals gets rid of all kill flags.

llvm-svn: 175821

11 years agoPreviously, parsing capability of the .debug_frame section was added
Eli Bendersky [Thu, 21 Feb 2013 22:53:19 +0000 (22:53 +0000)]
Previously, parsing capability of the .debug_frame section was added
to lib/DebugInfo, with dumping in llvm-dwarfdump. This patch adds
initial ability to parse and dump CFA instructions contained in
entries.

To keep it manageable, the patch omits some more advanced capabilities
(accounted in TODOs):

* Parsing of instructions with BLOCK arguments (expression lists)
* Dumping of actual instruction arguments (currently only names are
dumped). This is quite tricky since the dumper has to effectively
"interpret" the instructions.

llvm-svn: 175820

11 years agoLimit cast machinery to preserve const and not accept temporaries
David Blaikie [Thu, 21 Feb 2013 22:48:34 +0000 (22:48 +0000)]
Limit cast machinery to preserve const and not accept temporaries

After cleaning up the following type hierarchies:
  * TypeLoc: r175462
  * SVal: r175594
  * CFGElement: r175462
  * ProgramPoint: r175812
that all invoked undefined behavior by causing a derived copy construction of a
base object through an invalid cast (thus supporting code that relied on
casting temporaries that were direct base objects) Clang/LLVM is now clean of
casts of temporaries. So here's some fun SFINAE machinery (courtesy of Eli
Friedman, with some porting back from C++11 to LLVM's traits by me) to cause
compile-time failures if llvm::cast & friends are ever passed an rvalue.

This should avoid a repeat of anything even remotely like PR14321/r168124.

Thanks to Jordan Rose for the help with the various Static Analyzer related
hierarchies that needed cleaning up, Eli for the SFINAE, Richard Smith, John
McCall, Ted Kremenek, and Anna Zaks for their input/reviews/patience along the
way.

llvm-svn: 175819

11 years agoAllow GlobalValues to vectorize with AliasAnalysis
Renato Golin [Thu, 21 Feb 2013 22:39:03 +0000 (22:39 +0000)]
Allow GlobalValues to vectorize with AliasAnalysis

Storing the load/store instructions with the values
and inspect them using Alias Analysis to make sure
they don't alias, since the GEP pointer operand doesn't
take the offset into account.

Trying hard to not add any extra cost to loads and stores
that don't overlap on global values, AA is *only* calculated
if all of the previous attempts failed.

Using biggest vector register size as the stride for the
vectorization access, as we're being conservative and
the cost model (which calculates the real vectorization
factor) is only run after the legalization phase.

We might re-think this relationship in the future, but
for now, I'd rather be safe than sorry.

llvm-svn: 175818

11 years agoAdd back implicitly dropped const.
David Blaikie [Thu, 21 Feb 2013 22:37:44 +0000 (22:37 +0000)]
Add back implicitly dropped const.

(found due to incoming improvements to llvm::cast machinery that will error on
this sort of mistake)

llvm-svn: 175817

11 years agoUpdate INSTALL.txt to mention LLDB builds on Linux with GCC or Clang.
Daniel Malea [Thu, 21 Feb 2013 22:37:18 +0000 (22:37 +0000)]
Update INSTALL.txt to mention LLDB builds on Linux with GCC or Clang.

llvm-svn: 175816

11 years agoFix formatting and tabs in file.
Eric Christopher [Thu, 21 Feb 2013 22:35:08 +0000 (22:35 +0000)]
Fix formatting and tabs in file.

llvm-svn: 175815

11 years agoDon't pass -split-dwarf= to the backend unless we're on linux for
Eric Christopher [Thu, 21 Feb 2013 22:35:05 +0000 (22:35 +0000)]
Don't pass -split-dwarf= to the backend unless we're on linux for
now.

llvm-svn: 175814

11 years agoRemove the SplitDebug action and replace with a set of commands
Eric Christopher [Thu, 21 Feb 2013 22:35:01 +0000 (22:35 +0000)]
Remove the SplitDebug action and replace with a set of commands
in the compilation setup. Note that this doesn't currently
work for -no-integrated-as.

llvm-svn: 175813

11 years agoReplace ProgramPoint llvm::cast support to be well-defined.
David Blaikie [Thu, 21 Feb 2013 22:23:56 +0000 (22:23 +0000)]
Replace ProgramPoint llvm::cast support to be well-defined.

See r175462 for another example/more details.

llvm-svn: 175812

11 years agoPrevious commit was bogus (testing)
Enrico Granata [Thu, 21 Feb 2013 22:17:45 +0000 (22:17 +0000)]
Previous commit was bogus (testing)

llvm-svn: 175811

11 years ago(no commit message)
Enrico Granata [Thu, 21 Feb 2013 22:17:14 +0000 (22:17 +0000)]
(no commit message)

llvm-svn: 175810

11 years agoRe-apply r175688, with the changes suggested by Jakob in PR15320.
Lang Hames [Thu, 21 Feb 2013 22:16:43 +0000 (22:16 +0000)]
Re-apply r175688, with the changes suggested by Jakob in PR15320.

llvm-svn: 175809

11 years agoMark test as expected-to-fail with GCC because some versions emit DWARF that claims
Daniel Malea [Thu, 21 Feb 2013 22:15:52 +0000 (22:15 +0000)]
Mark test as expected-to-fail with GCC because some versions emit DWARF that claims
functions start at the line with the "{" character, whereas clang uses the first line
with source code. As such, this test case will only work with clang.

llvm-svn: 175808