Commit Graph

143259 Commits

Author SHA1 Message Date
Bill Wendling d7e05d628a Update with attribute group IDs.
llvm-svn: 174847
2013-02-10 23:17:10 +00:00
Bill Wendling 44b08bfeeb Eat the alignment keyword if we're in an attribute group.
llvm-svn: 174846
2013-02-10 23:15:51 +00:00
Bill Wendling dc095559fa Add code for emitting the attribute groups.
This is some initial code for emitting the attribute groups into the bitcode.

NOTE: This format *may* change! Do not rely upon the attribute groups' bitcode
not changing.

llvm-svn: 174845
2013-02-10 23:09:32 +00:00
Bill Wendling 51f612eb69 Add support for attribute groups in the value enumerator.
Attribute groups are essentially all AttributeSets which are used by the
program. Enumerate them here.

llvm-svn: 174844
2013-02-10 23:06:02 +00:00
Nico Weber da2b868f1e Formatter: Remove now-unneeded code for formatting ':'s in ObjC method decls.
The more general code for formatting ObjC method exprs does this and more,
it's no longer necessary to special-case this. No behavior change.

llvm-svn: 174843
2013-02-10 21:08:31 +00:00
Nico Weber 0448b4dd87 Formatter: Add a test for multi-line ObjC dict literals.
As it turns out, this already works reasonably well.

This example from http://clang.llvm.org/docs/ObjectiveCLiterals.html
NSDictionary *dictionary = @{
    @"name" : NSUserName(),
    @"date" : [NSDate date],
    @"processInfo" : [NSProcessInfo processInfo]
};

is formatted like
NSDictionary *dictionary = @{ @"name" : NSUserName(), @"date" : [NSDate date],
                              @"processInfo" : [NSProcessInfo processInfo] };

There's already a FIXME in NestedStaticInitializers about supporting one
initializer per line, which is really all that's missing here too.

llvm-svn: 174842
2013-02-10 20:48:24 +00:00
Nico Weber 33c68e900b Formatter: Add another ObjC literal test.
(From http://clang.llvm.org/docs/ObjectiveCLiterals.html.)

llvm-svn: 174841
2013-02-10 20:39:05 +00:00
Nico Weber 372d8dcf15 Formatter: Initial support for ObjC dictionary literals.
Before:
  @{
  foo:
    bar
  }
  ;

Now:
  @{ foo : bar };

parseBracedList() already does the right thing from an UnwrappedLineParser
perspective, so check for "@{" in all loops that process constructs that can
contain expressions and call parseBracedList() if found.

llvm-svn: 174840
2013-02-10 20:35:35 +00:00
Vincent Lejeune 44bf8158c5 Test Commit - Remove some trailing whitespace in R600Instructions.td
llvm-svn: 174839
2013-02-10 17:57:33 +00:00
Bob Wilson 2616e2ec85 Use -mno-implicit-float by default for kernel/kext code. <rdar://13177960>
Apple's kernel engineers have been expecting this behavior even though
we've never implemented it before, as far as I can tell. In recent months,
clang has gotten better at using vector instructions to optimize memcpy-like
operations, and that has exposed problems when vector/floating-point
instructions are used in kexts that don't support that. This behavior also
matches what Apple's GCC did for PowerPC targets.

llvm-svn: 174838
2013-02-10 16:01:41 +00:00
Bob Wilson dc9e6085c4 Delete an extra blank line.
llvm-svn: 174837
2013-02-10 16:01:38 +00:00
Bob Wilson 2cc9690f5e Recognize -mno-implicit-float option for x86 as well as ARM. <rdar://13180731>
For x86 targets, we've been using the -msoft-float option to control passing
the no-implicit-float option to cc1. Since the -mno-implicit-float option is
now accepted by the driver, this just makes it work for x86 the same as it
does for ARM targets.

llvm-svn: 174836
2013-02-10 15:25:44 +00:00
Dmitri Gribenko 74f4d0287f Use static functions instead of an unnamed namespace
llvm-svn: 174835
2013-02-10 11:54:22 +00:00
Bill Wendling 0a4373058c Handle string attributes in the AttrBuilder.
llvm-svn: 174834
2013-02-10 10:13:23 +00:00
Bill Wendling b1ea9807ea Use a 'continue' here to stop from double lexing.
llvm-svn: 174833
2013-02-10 10:12:50 +00:00
Bill Wendling ff84294567 Add 'empty' query methods to the builder and use them in the verifier.
llvm-svn: 174832
2013-02-10 10:12:06 +00:00
Cameron Zwarich 16b64cba62 Add support for updating LiveIntervals to PHIElimination. If LiveIntervals are
present, it currently verifies them with the MachineVerifier, and this passed
all of the test cases in 'make check' (when accounting for existing verifier
errors). There were some assertion failures in the two-address pass, but they
also happened on code without phis and look like they are caused by different
kill flags from LiveIntervals.

The only part that doesn't work is the critical edge splitting heuristic,
because there isn't currently an efficient way to update LiveIntervals after
splitting an edge. I'll probably start by implementing the slow fallback and
test that it works before tackling the fast path for single-block ranges. The
existing code that updates LiveVariables is fairly slow as it is.

There isn't a command-line option for enabling this; instead, just edit
PHIElimination.cpp to require LiveIntervals.

llvm-svn: 174831
2013-02-10 06:42:36 +00:00
Cameron Zwarich 71f0acbeeb Fix a typo.
llvm-svn: 174830
2013-02-10 06:42:34 +00:00
Cameron Zwarich a158d39da0 Remove ancient references to 'atomic' phis in PHIElimination that don't really
make sense anymore.

llvm-svn: 174829
2013-02-10 06:42:32 +00:00
Cameron Zwarich e0966738db Make LiveVariables an instance variable of PHIElimination.
llvm-svn: 174828
2013-02-10 06:42:30 +00:00
Chris Lattner 6b24f7429a ok, ok, stop fighting type punning warnings by just using a union.
llvm-svn: 174827
2013-02-10 06:36:29 +00:00
Chris Lattner 4080fcc478 hopefully "really" fix a type punning warning by defining the buffer as
type char, which can't have TBAA tags.

llvm-svn: 174826
2013-02-10 06:07:16 +00:00
Chris Lattner e3d3e6ab8c attempt to defeat a gcc warning that is breaking a -Werror buildbot.
llvm-svn: 174825
2013-02-10 05:45:34 +00:00
Bill Wendling 5d020a3a31 Add accessor for the LLVMContext.
llvm-svn: 174824
2013-02-10 05:00:40 +00:00
Nico Weber 67ffb338ee Reformat formatter code. No functionality change.
llvm-svn: 174823
2013-02-10 04:38:23 +00:00
Nico Weber 2a726b6c34 Formatter: Detect ObjC array literals.
Use this to add a space after "@[" and before "]" for now.

Later, I want to use this to format multi-line array literals nicer, too.

llvm-svn: 174822
2013-02-10 02:08:05 +00:00
Fariborz Jahanian 234c00d6d0 objective-C: Fixes a bogus warning due to not setting
the "nonatomic" attribute in property redeclaration
in class extension. Also, improved on diagnostics in
this area while at it. // rdar://13156292

llvm-svn: 174821
2013-02-10 00:16:04 +00:00
Jakub Staszak 853136229b Remove unneeded "TargetMachine.h" #includes.
llvm-svn: 174817
2013-02-09 20:54:05 +00:00
Nico Weber 06fcec1cf9 Formatter: Add test for default arguments.
llvm-svn: 174816
2013-02-09 18:02:07 +00:00
Dmitri Gribenko 4b8a84fdca FileCheck'ize tests
llvm-svn: 174815
2013-02-09 16:41:47 +00:00
Dmitri Gribenko f37d0cd780 FileCheck'ize a test
llvm-svn: 174814
2013-02-09 16:25:38 +00:00
Bill Wendling a7c3877dc7 TEMPORARY SYNTAX CHANGE!
The original syntax for the attribute groups was ambiguous. For example:

    declare void @foo() #1
    #0 = attributes { noinline }

The '#0' would be parsed as an attribute reference for '@foo' and not as a
top-level entity. In order to continue forward while waiting for a decision on
what the correct syntax is, I'm changing it to this instead:

     declare void @foo() #1
     attributes #0 = { noinline }

Repeat: This is TEMPORARY until we decide what the correct syntax should be.
llvm-svn: 174813
2013-02-09 15:48:49 +00:00
Bill Wendling 33ab8a2187 Add a DenseMapInfo class for the AttributeSet.
We are going to place the AttributeSet into a DenseMap during assembly writing.

llvm-svn: 174812
2013-02-09 15:42:51 +00:00
Dmitri Gribenko f340008eab Remove unreachable statement
llvm-svn: 174811
2013-02-09 15:24:28 +00:00
Dmitri Gribenko bcef3411cd Comment parsing: use CharInfo.h
This also gives us 0.2% speedup on '-fsyntax-only -Wdocumentation' time for
a testcase that consists of all Clang headers.

llvm-svn: 174810
2013-02-09 15:16:58 +00:00
Dmitri Gribenko efbbd1e90c libclang: use CXCursor getters to simplify code
llvm-svn: 174809
2013-02-09 14:12:09 +00:00
Justin Holewinski 36a50991e7 [NVPTX] Make address space errors more explicit (llvm_unreachable -> report_fatal_error)
llvm-svn: 174808
2013-02-09 13:34:15 +00:00
Jakub Staszak bef117fed5 Simplify code.
llvm-svn: 174807
2013-02-09 13:29:31 +00:00
Jakub Staszak ba3189bc0a Remove unneeded #includes.
llvm-svn: 174806
2013-02-09 13:29:10 +00:00
Jordan Rose 4938f276a5 Remove some stray uses of <ctype.h> functions.
These are causing assertions on some MSVC builds.

llvm-svn: 174805
2013-02-09 10:09:43 +00:00
Chris Lattner 55d911d833 This is the correct version of r174802.
llvm-svn: 174804
2013-02-09 07:37:59 +00:00
Chris Lattner 1a43b350c4 Fix a nasty off-by one error that only manifests with 64-bit word size (which is
not enabled yet).

llvm-svn: 174803
2013-02-09 07:37:26 +00:00
Ted Kremenek 7ee25676a5 QoI: -Wreadonly-iboutlet-property should have the warning's location on the property.
There's no need to refer to the @implementation at all.

Fixes <rdar://problem/13186515>

llvm-svn: 174802
2013-02-09 07:13:16 +00:00
Chris Lattner 6c29cb3b7a Fix the underlying problem that was causing read(0) to be called: sometimes the
bitcode writer would generate abbrev records saying that the abbrev should be
filled with fixed zero-bit bitfields (this happens in the .bc writer when 
the number of types used in a module is exactly one, since log2(1) == 0).

In this case, just handle it as a literal zero.  We can't "just fix" the writer
without breaking compatibility with existing bc files, so have the abbrev reader
do the substitution.

Strengthen the assert in read to reject reads of zero bits so we catch such 
crimes in the future, and remove the special case designed to handle this.

llvm-svn: 174801
2013-02-09 07:07:29 +00:00
Chris Lattner 1420fda82f recommit r173072 (preparing bitstream reader to read a machine word at a time,
instead of always 32-bits at a time) with two changes:

1. Make Read(0) always return zero without affecting the state of our cursor.
2. Hack word_t to always be 32 bits, as staging.

These two caveats will change shortly.

llvm-svn: 174800
2013-02-09 06:52:14 +00:00
Jordan Rose d9759fdb03 Release notes: mention support for Unicode and UCNs in identifiers.
I'm using the name "Extended Identifiers" for the feature because that's
what GCC calls them. According to the standard, the new feature is
"universal character names are now allowed in identifiers", but the more
interesting "feature" is that identifiers can now contain Unicode characters,
however they are written.

llvm-svn: 174798
2013-02-09 02:12:23 +00:00
Enrico Granata e1fb1654c8 Quick fix for the libc++ std::map synthetic children provider
If you try to access any child > 0 without having touched child 0, LLDB won't be able to reconstruct type information from the debug info.
Previously, we would fail.
Now, we simply go fetch child 0 and then come back.

llvm-svn: 174795
2013-02-09 01:44:23 +00:00
Douglas Gregor 7dab26b87c Ensure that type definitions present in just-loaded modules are
visible.

The basic problem here is that a given translation unit can use
forward declarations to form pointers to a given type, say,

  class X;
  X *x;

and then import a module that includes a definition of X:

  import XDef;

We will then fail when attempting to access a member of X, e.g., 

  x->method()

because the AST reader did not know to look for a default of a class
named X within the new module.

This implementation is a bit of a C-centric hack, because the only
definitions that can have this property are enums, structs, unions,
Objective-C classes, and Objective-C protocols, and all of those are
either visible at the top-level or can't be defined later. Hence, we
can use the out-of-date-ness of the name and the identifier-update
mechanism to force the update.

In C++, we will not be so lucky, and will need a more advanced
solution, because the definitions could be in namespaces defined in
two different modules, e.g.,

  // module 1
  namespace N { struct X; }

  // module 2
  namespace N { struct X { /* ... */ }; }

One possible implementation here is for C++ to extend the information
associated with each identifier table to include the declaration IDs
of any definitions associated with that name, regardless of
context. We would have to eagerly load those definitions.

llvm-svn: 174794
2013-02-09 01:35:03 +00:00
Jim Ingham 0161b49cba Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction interoperate to fix problems where
hitting auto-continue signals while running a thread plan would cause us to lose control of the debug 
session.

<rdar://problem/12993641>

llvm-svn: 174793
2013-02-09 01:29:05 +00:00
NAKAMURA Takumi 1aa79e9f63 clang/lib/StaticAnalyzer/Core/BugReporter.cpp: Appease old msvc in std::pair(0, 0).
llvm-svn: 174792
2013-02-09 01:22:23 +00:00