]> granicus.if.org Git - clang/log
clang
15 years agoConvert types over to placement new() that takes an ASTContext.
Steve Naroff [Tue, 27 Jan 2009 22:08:43 +0000 (22:08 +0000)]
Convert types over to placement new() that takes an ASTContext.
Also changed FunctionTypeProto to be allocated with 8-byte alignment (noticed by Doug). I couldn't think of any reason to allocate on 16-byte boundaries. If anyone remembers why we were doing this, let me know!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63137 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove many references to ASTContext::getAllocator(), replacing them with calls to...
Steve Naroff [Tue, 27 Jan 2009 21:25:57 +0000 (21:25 +0000)]
Remove many references to ASTContext::getAllocator(), replacing them with calls to the recently added placement new (which uses ASTContext's allocator for memory). Also added ASTContext::Deallocate().

This will simplify runtime replacement of ASTContext's allocator. Keeping the allocator private (and removing getAllocator() entirely) is also goodness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63135 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc/Darwin/clang: Fix a mistranslation for the llvm-backend; llvm-gcc
Daniel Dunbar [Tue, 27 Jan 2009 20:42:58 +0000 (20:42 +0000)]
ccc/Darwin/clang: Fix a mistranslation for the llvm-backend; llvm-gcc
doesn't set the relocation model when -mdynamic-no-pic is present.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63129 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIf an input constraint refers to an output constraint, it should have the same constr...
Anders Carlsson [Tue, 27 Jan 2009 20:38:24 +0000 (20:38 +0000)]
If an input constraint refers to an output constraint, it should have the same constraint info as the output constraint. Fixes PR3417

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63127 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoivar meta-data generation for nonfragile-abi.
Fariborz Jahanian [Tue, 27 Jan 2009 19:38:51 +0000 (19:38 +0000)]
ivar meta-data generation for nonfragile-abi.
Still more work to do in this area.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63126 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: Normalize machine name to i386 for platforms which report the
Daniel Dunbar [Tue, 27 Jan 2009 19:29:51 +0000 (19:29 +0000)]
ccc: Normalize machine name to i386 for platforms which report the
machine as x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63122 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoeliminate some random .ll file outputs
Chris Lattner [Tue, 27 Jan 2009 18:56:08 +0000 (18:56 +0000)]
eliminate some random .ll file outputs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63117 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed a typo in getPreferredTypeAlign method.
Fariborz Jahanian [Tue, 27 Jan 2009 18:55:00 +0000 (18:55 +0000)]
Fixed a typo in getPreferredTypeAlign method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63116 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd new headers
Chris Lattner [Tue, 27 Jan 2009 18:34:53 +0000 (18:34 +0000)]
add new headers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63113 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd the new .def files
Chris Lattner [Tue, 27 Jan 2009 18:34:32 +0000 (18:34 +0000)]
Add the new .def files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63112 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSplit the single monolithic DiagnosticKinds.def file into one
Chris Lattner [Tue, 27 Jan 2009 18:30:58 +0000 (18:30 +0000)]
Split the single monolithic DiagnosticKinds.def file into one
.def file for each library.  This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.

Patch by Anders Johnsen!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63111 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix bug in BasicStore::getLValueElement where if the base of an array subscript expre...
Ted Kremenek [Tue, 27 Jan 2009 18:29:03 +0000 (18:29 +0000)]
Fix bug in BasicStore::getLValueElement where if the base of an array subscript expression was an ElementRegion we stacked another ElementRegion on top of that.

This fixes PR 3422.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63110 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a new "getPreferredTypeAlign" method to return the preferred alignment
Chris Lattner [Tue, 27 Jan 2009 18:08:34 +0000 (18:08 +0000)]
add a new "getPreferredTypeAlign" method to return the preferred alignment
of a type.  The implementation is currently something of a hack, but is
sufficient for now and allows clients to be built on it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63108 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSupport CodeGen for __extension__ operator on aggregates.
Eli Friedman [Tue, 27 Jan 2009 09:03:41 +0000 (09:03 +0000)]
Support CodeGen for __extension__ operator on aggregates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63101 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix for PR3418: make sure to handle the RHS of expressions starting with
Eli Friedman [Tue, 27 Jan 2009 08:43:38 +0000 (08:43 +0000)]
Fix for PR3418: make sure to handle the RHS of expressions starting with
__extension__.  This sort of construct shows up in the gcc source code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63100 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIntroduce a new PresumedLoc class to represent the concept of a location
Chris Lattner [Tue, 27 Jan 2009 07:57:44 +0000 (07:57 +0000)]
Introduce a new PresumedLoc class to represent the concept of a location
as reported to the user and as manipulated by #line.  This is what __FILE__,
__INCLUDE_LEVEL__, diagnostics and other things should follow (but not
dependency generation!).

This patch also includes several cleanups along the way:

- SourceLocation now has a dump method, and several other places
  that did similar things now use it.
- I cleaned up some code in AnalysisConsumer, but it should probably be
  simplified further now that NamedDecl is better.
- TextDiagnosticPrinter is now simplified and cleaned up a bit.

This patch is a prerequisite for #line, but does not actually provide
any #line functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63098 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename getFullFilePos -> getFileOffset.
Chris Lattner [Tue, 27 Jan 2009 06:27:13 +0000 (06:27 +0000)]
rename getFullFilePos -> getFileOffset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63097 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse string comparison rather than '=='.
Ted Kremenek [Tue, 27 Jan 2009 05:34:28 +0000 (05:34 +0000)]
Use string comparison rather than '=='.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63095 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a bug that I noticed by inspection.
Chris Lattner [Tue, 27 Jan 2009 05:34:03 +0000 (05:34 +0000)]
Fix a bug that I noticed by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63094 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake -print-stats print stats about the amount of the SLoc
Chris Lattner [Tue, 27 Jan 2009 05:22:43 +0000 (05:22 +0000)]
make -print-stats print stats about the amount of the SLoc
address space we used up.  Some interesting data:

For c99-intconst-1.c:
6912762 SLocEntry's allocated, 25592386B of Sloc address space used.

For cocoa.h:
26469 SLocEntry's allocated, 10278752B of Sloc address space used.

For carbon.h:
27364 SLocEntry's allocated, 12398141B of Sloc address space used.

Clearly 2G of sloc address space should be enough for anyone?!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63093 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimprovements for GNU objc runtime support, patch by David Chisnall!
Chris Lattner [Tue, 27 Jan 2009 05:06:01 +0000 (05:06 +0000)]
improvements for GNU objc runtime support, patch by David Chisnall!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63092 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agox86_64: Classify __m64 and __m128 "correctly".
Daniel Dunbar [Tue, 27 Jan 2009 02:01:34 +0000 (02:01 +0000)]
x86_64: Classify __m64 and __m128 "correctly".
 - gcc appears to be classifying <1 x double> as INTEGER which is
   odd. Will investigate later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63086 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd SparcV8 asm register info support. Patch by Ben Lickly!
Chris Lattner [Tue, 27 Jan 2009 01:58:38 +0000 (01:58 +0000)]
add SparcV8 asm register info support.  Patch by Ben Lickly!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63085 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPathDiagnostics:
Ted Kremenek [Tue, 27 Jan 2009 01:53:39 +0000 (01:53 +0000)]
PathDiagnostics:
- Add the distinction between the 'bug type' and the 'bug description'

HTMLDiagnostics:
- Output the bug type field as HTML comments

scan-build:
- Use the bug type field instead of the bug description for the HTML table.
- Radar filing now automatically picks up the bug description in the title (addresses <rdar://problem/6265970>)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63084 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement support for coercion to wider types during ABI handling.
Daniel Dunbar [Tue, 27 Jan 2009 01:36:03 +0000 (01:36 +0000)]
Implement support for coercion to wider types during ABI handling.
 - Code quality is poor, but simple.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63083 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHave 'Analyzer Failures' files be named to reflect the category of problem.
Ted Kremenek [Tue, 27 Jan 2009 01:19:08 +0000 (01:19 +0000)]
Have 'Analyzer Failures' files be named to reflect the category of problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63080 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPTH: Use Token::setLiteralData() to directly store a pointer to cached spelling data...
Ted Kremenek [Tue, 27 Jan 2009 00:01:05 +0000 (00:01 +0000)]
PTH: Use Token::setLiteralData() to directly store a pointer to cached spelling data in the PTH file.  This removes a ton of code for looking up spellings using sourcelocations in the PTH file.  This simplifies both PTH-generation and reading.

Performance impact for -fsyntax-only on Cocoa.h (with Cocoa.h in the PTH file):
- PTH generation time improves by 5%
- PTH reading improves by 0.3%.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63072 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded a FIXME.
Fariborz Jahanian [Mon, 26 Jan 2009 23:49:05 +0000 (23:49 +0000)]
Added a FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63071 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix definition of __builtin_ia32_vec_set_v2di and de-XFAIL
Daniel Dunbar [Mon, 26 Jan 2009 23:43:02 +0000 (23:43 +0000)]
Fix definition of __builtin_ia32_vec_set_v2di and de-XFAIL
builtins-x86.c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63069 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPull EmitReturnBlock out of FinishFunction and catch unified return
Daniel Dunbar [Mon, 26 Jan 2009 23:27:52 +0000 (23:27 +0000)]
Pull EmitReturnBlock out of FinishFunction and catch unified return
case correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63068 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoBuild method-description-list for category meta-data
Fariborz Jahanian [Mon, 26 Jan 2009 22:58:07 +0000 (22:58 +0000)]
Build method-description-list for category meta-data
as well (for nonfragile-abi).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63062 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSome micro-optimizations for DISABLE_SMART_POINTERS:
Douglas Gregor [Mon, 26 Jan 2009 22:44:13 +0000 (22:44 +0000)]
Some micro-optimizations for DISABLE_SMART_POINTERS:
  - When it's safe, ActionResult uses the low bit of the pointer for
  the "invalid" flag rather than a separate "bool" value. This keeps
  GCC from generating some truly awful code, for a > 3x speedup in the
  result-passing microbenchmark.
  - When DISABLE_SMART_POINTERS is defined, store an ActionResult
  within ASTOwningResult rather than an ASTOwningPtr. Brings the
  performance benefits of the above to smart pointers with
  DISABLE_SMART_POINTERS defined.

Sadly, these micro-benchmark performance improvements don't seem to
make much of a difference on Cocoa.h right now. However, they're
harmless and might help with future optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63061 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename getSpelledCharacterAt to getSpellingOfSingleCharacterNumericConstant,
Chris Lattner [Mon, 26 Jan 2009 22:36:52 +0000 (22:36 +0000)]
rename getSpelledCharacterAt to getSpellingOfSingleCharacterNumericConstant,
optimize it to use the LiteralData when possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63060 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a bug I introduced in my changes, which caused MeasureTokenLength
Chris Lattner [Mon, 26 Jan 2009 22:24:27 +0000 (22:24 +0000)]
Fix a bug I introduced in my changes, which caused MeasureTokenLength
to crash when given an instantiation location.  Thanks to Fariborz for
the testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63057 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd support for member pointers to const_cast.
Sebastian Redl [Mon, 26 Jan 2009 22:19:12 +0000 (22:19 +0000)]
Add support for member pointers to const_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63055 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSilence warning.
Ted Kremenek [Mon, 26 Jan 2009 22:16:12 +0000 (22:16 +0000)]
Silence warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63054 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd version number to PTH files.
Ted Kremenek [Mon, 26 Jan 2009 22:15:00 +0000 (22:15 +0000)]
Add version number to PTH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63052 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd version number checking to PTH files.
Ted Kremenek [Mon, 26 Jan 2009 21:50:21 +0000 (21:50 +0000)]
Add version number checking to PTH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63047 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEmbed the offset of the PTH table inside the prologue of the PTH file. This will...
Ted Kremenek [Mon, 26 Jan 2009 21:43:14 +0000 (21:43 +0000)]
Embed the offset of the PTH table inside the prologue of the PTH file.  This will help improve gradual versioning of PTH files instead of relying that the PTH table is at a fixed offset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63045 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMethod decription meta-data and its setting in class_ro_t
Fariborz Jahanian [Mon, 26 Jan 2009 21:38:32 +0000 (21:38 +0000)]
Method decription meta-data and its setting in class_ro_t
meta-data.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63043 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd Ignore ABIArgInfo kind, for handling void & empty structures.
Daniel Dunbar [Mon, 26 Jan 2009 21:26:08 +0000 (21:26 +0000)]
Add Ignore ABIArgInfo kind, for handling void & empty structures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63039 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSkip emission of final return block if possible (e.g., functions with
Daniel Dunbar [Mon, 26 Jan 2009 21:25:20 +0000 (21:25 +0000)]
Skip emission of final return block if possible (e.g., functions with
a unified return).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63038 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove my hacks that aggressively threw away multiple
Chris Lattner [Mon, 26 Jan 2009 20:24:53 +0000 (20:24 +0000)]
remove my hacks that aggressively threw away multiple
instantiation history in an effort to speed up c99-intconst-1.c.
Now that multiple nested instantiations are allowed, we just
make them and don't pay the cost of lookups.  With the other
changes that went in before this, reverting this is actually
a speedup for c99-intconst-1.c, speeding it up from 1.96s to 1.80s,
and preserves much better loc info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63036 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoallow _Pragmas formed from #defines to keep their full instantiation
Chris Lattner [Mon, 26 Jan 2009 20:15:46 +0000 (20:15 +0000)]
allow _Pragmas formed from #defines to keep their full instantiation
history

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63035 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agonow that everything properly handles multiply instantiated
Chris Lattner [Mon, 26 Jan 2009 20:08:26 +0000 (20:08 +0000)]
now that everything properly handles multiply instantiated
source locations, allow creation of them.  We can now say that
a token was instantiated here, then here, then here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63034 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake getInstantiationLoc and getSpellingLoc handle multiply instantiated
Chris Lattner [Mon, 26 Jan 2009 20:04:19 +0000 (20:04 +0000)]
make getInstantiationLoc and getSpellingLoc handle multiply instantiated
locations, and move the slow case out of line.  No perf change on cocoa.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63033 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove an implemented FIXME and extend test cases. Follow-up on Doug's review.
Sebastian Redl [Mon, 26 Jan 2009 19:54:48 +0000 (19:54 +0000)]
Remove an implemented FIXME and extend test cases. Follow-up on Doug's review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63032 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCorrect size assumption; fixes a crash on amd64.
Sebastian Redl [Mon, 26 Jan 2009 19:54:12 +0000 (19:54 +0000)]
Correct size assumption; fixes a crash on amd64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63031 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix a negated conditional in getDecomposedInstantiationLocSlowCase,
Chris Lattner [Mon, 26 Jan 2009 19:41:58 +0000 (19:41 +0000)]
fix a negated conditional in getDecomposedInstantiationLocSlowCase,
which I think is rdar://6527005, and make getDecomposedSpellingLocSlowCase
handle nested spelling locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63030 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agominor speedups/cleanups for -E mode.
Chris Lattner [Mon, 26 Jan 2009 19:33:54 +0000 (19:33 +0000)]
minor speedups/cleanups for -E mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63029 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThis change refactors some of the low-level lexer interfaces a bit.
Chris Lattner [Mon, 26 Jan 2009 19:29:26 +0000 (19:29 +0000)]
This change refactors some of the low-level lexer interfaces a bit.
Token now has a class of kinds for "literals", which include
numeric constants, strings, etc.  These tokens can optionally have
a pointer to the start of the token in the lexer buffer.  This
makes it faster to get spelling and do other gymnastics, because we
don't have to go through source locations.

This change is performance neutral, but will make other changes
more feasible down the road.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63028 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoABITestGen: Add generation of vector types.
Daniel Dunbar [Mon, 26 Jan 2009 19:05:20 +0000 (19:05 +0000)]
ABITestGen: Add generation of vector types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63024 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMeta-data for nonfragile-abi's categories
Fariborz Jahanian [Mon, 26 Jan 2009 18:32:24 +0000 (18:32 +0000)]
Meta-data for nonfragile-abi's categories

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63020 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake sure we have a definition of uintptr_t.
Chris Lattner [Mon, 26 Jan 2009 18:21:04 +0000 (18:21 +0000)]
make sure we have a definition of uintptr_t.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63019 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMany updates to Windows project files.
Steve Naroff [Mon, 26 Jan 2009 18:09:40 +0000 (18:09 +0000)]
Many updates to Windows project files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63018 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoComment fix.
Daniel Dunbar [Mon, 26 Jan 2009 18:02:34 +0000 (18:02 +0000)]
Comment fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63016 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: -o should not be automatically forwarded to generic gcc tools.
Daniel Dunbar [Mon, 26 Jan 2009 18:00:14 +0000 (18:00 +0000)]
ccc: -o should not be automatically forwarded to generic gcc tools.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63015 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: Recognize -emit-llvm [-S].
Daniel Dunbar [Mon, 26 Jan 2009 17:09:15 +0000 (17:09 +0000)]
ccc: Recognize -emit-llvm [-S].
 - Unlike llvm-gcc, this doesn't yet treat -emit-llvm output as a
   linker input.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63014 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agostart plumbing together the line table information. So far we just
Chris Lattner [Mon, 26 Jan 2009 07:57:50 +0000 (07:57 +0000)]
start plumbing together the line table information.  So far we just
unique the Filenames in #line directives, assigning them UIDs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63010 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLazily paging in file contents is a big win for PTH, strip out the old
Chris Lattner [Mon, 26 Jan 2009 07:37:49 +0000 (07:37 +0000)]
Lazily paging in file contents is a big win for PTH, strip out the old
testing code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63006 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoBitmangle file characteristic bits into the low bits of
Chris Lattner [Mon, 26 Jan 2009 06:49:09 +0000 (06:49 +0000)]
Bitmangle file characteristic bits into the low bits of
the content cache pointer.  This saves 105876 bytes on
cocoa.h because it shrinks the SLocEntry union, which
we have a big array of.  It would be nice to use
PointerIntPair here, but we can't because it is in a
union.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63004 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd parsing and constraint enforcement for GNU line marker directives.
Chris Lattner [Mon, 26 Jan 2009 06:19:46 +0000 (06:19 +0000)]
add parsing and constraint enforcement for GNU line marker directives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63003 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse tag classes instead of typedefs for GDM entries 'ConstNotEq' and 'ConstEq'. ...
Ted Kremenek [Mon, 26 Jan 2009 06:04:53 +0000 (06:04 +0000)]
Use tag classes instead of typedefs for GDM entries 'ConstNotEq' and 'ConstEq'.  This avoids collisions in the GDM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63002 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd another sanity test.
Chris Lattner [Mon, 26 Jan 2009 05:44:13 +0000 (05:44 +0000)]
add another sanity test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63001 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoa few minor cleanups
Chris Lattner [Mon, 26 Jan 2009 05:30:54 +0000 (05:30 +0000)]
a few minor cleanups

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63000 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoparse and enforce required constraints on #line directives. Right now
Chris Lattner [Mon, 26 Jan 2009 05:29:08 +0000 (05:29 +0000)]
parse and enforce required constraints on #line directives.  Right now
we just discard them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62999 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadded to wrong directory
Chris Lattner [Mon, 26 Jan 2009 04:36:31 +0000 (04:36 +0000)]
added to wrong directory

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62997 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoan insane macro testcase.
Chris Lattner [Mon, 26 Jan 2009 04:36:10 +0000 (04:36 +0000)]
an insane macro testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62996 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoeagerly resolve the spelling locations of macro argument preexpansions.
Chris Lattner [Mon, 26 Jan 2009 04:33:10 +0000 (04:33 +0000)]
eagerly resolve the spelling locations of macro argument preexpansions.
This reduces fsyntax-only time on c99-intconst-1.c from 2.43s down to
2.01s (20%), reducing the number of fileid lookups from 2529040 linear
and 64771121 binary to 5625902 linear and 4151182 binary.

This knocks getFileID down to only 4.6% of compile time on this testcase.
At this point, malloc/free is over 35% of compile time, primarily allocating
MacroArgs objects and their argument preexpansion vectors.

I don't feel like malloc avoiding right now, so I'm just going to call
this good.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62994 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEagerly resolve the spelling location of the tokens in a definition
Chris Lattner [Mon, 26 Jan 2009 04:06:48 +0000 (04:06 +0000)]
Eagerly resolve the spelling location of the tokens in a definition
of a macro.  Since these tokens may themselves be from macro
expansions, we need to resolve down to the spelling loc when the
macro ends up being instantiated.  Instead of resolving this for
each token expanded from the macro definition, just do it once when
the macro is defined.  This speeds up clang on c99-intconst-1.c from
2.66s to 2.43s (9.5%), reducing the FileID lookups from 407244 linear and
114175649 binary to 2529040 linear and 64771121 binary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62993 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOnly resolve a macro's instantiation loc once per macro, instead of once
Chris Lattner [Mon, 26 Jan 2009 03:46:22 +0000 (03:46 +0000)]
Only resolve a macro's instantiation loc once per macro, instead of once
per token lexed from it.  This speeds up clang on c99-intconst-1.c from
the GCC testsuite from 3.64s to 2.66s (36%).  This reduces the number of
binary search FileID lookups from 251570522 to 114175649 on this testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62992 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPR3269: create an empty InitListExpr as a child for the
Eli Friedman [Mon, 26 Jan 2009 01:33:06 +0000 (01:33 +0000)]
PR3269: create an empty InitListExpr as a child for the
CompoundLiteralExpr so that there aren't any null pointers in the AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62981 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCheck in the long promised SourceLocation rewrite. This lays the
Chris Lattner [Mon, 26 Jan 2009 00:43:02 +0000 (00:43 +0000)]
Check in the long promised SourceLocation rewrite.  This lays the
ground work for implementing #line, and fixes the "out of macro ID's"
problem.

There is nothing particularly tricky about the code, other than the
very performance sensitive SourceManager::getFileID() method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62978 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate C++ status table with new member pointer conversion capabilities.
Sebastian Redl [Mon, 26 Jan 2009 00:11:25 +0000 (00:11 +0000)]
Update C++ status table with new member pointer conversion capabilities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62977 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimprove ASTContext::getDeclAlign comment, as suggested by Eli.
Chris Lattner [Sun, 25 Jan 2009 23:06:38 +0000 (23:06 +0000)]
improve ASTContext::getDeclAlign comment, as suggested by Eli.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62975 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agouse simpler method
Chris Lattner [Sun, 25 Jan 2009 22:02:19 +0000 (22:02 +0000)]
use simpler method

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62974 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement implicit conversions for pointers-to-member.
Sebastian Redl [Sun, 25 Jan 2009 19:43:20 +0000 (19:43 +0000)]
Implement implicit conversions for pointers-to-member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62971 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIntroduce an explicit case for member pointers in CodeGenTypes. However, it simply...
Sebastian Redl [Sun, 25 Jan 2009 13:35:30 +0000 (13:35 +0000)]
Introduce an explicit case for member pointers in CodeGenTypes. However, it simply asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62960 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix compile error from r62953.
Sebastian Redl [Sun, 25 Jan 2009 13:34:47 +0000 (13:34 +0000)]
Fix compile error from r62953.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62959 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOne more case for Expr::isConstantInitializer; I think this covers
Eli Friedman [Sun, 25 Jan 2009 03:27:40 +0000 (03:27 +0000)]
One more case for Expr::isConstantInitializer; I think this covers
everything that we aren't intending to implement in Expr::Evaluate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62953 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnhancements to Expr::isConstantInitializer to deal with a few
Eli Friedman [Sun, 25 Jan 2009 03:12:18 +0000 (03:12 +0000)]
Enhancements to Expr::isConstantInitializer to deal with a few
cases it couldn't deal with before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62952 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename Expr::isConstantExpr to Expr::isConstantInitializer; this more
Eli Friedman [Sun, 25 Jan 2009 02:32:41 +0000 (02:32 +0000)]
Rename Expr::isConstantExpr to Expr::isConstantInitializer; this more
accurately states what the function is trying to do and how it is
different from Expr::isEvaluatable.  Also get rid of a parameter that is both
unused and inaccurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62951 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGet rid of some code that should be unnecessary.
Eli Friedman [Sun, 25 Jan 2009 02:10:46 +0000 (02:10 +0000)]
Get rid of some code that should be unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62950 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake the constant folder aware of
Eli Friedman [Sun, 25 Jan 2009 01:54:01 +0000 (01:54 +0000)]
Make the constant folder aware of
__builtin___CFStringMakeConstantString.  (We get into trouble in
GenerateStaticBlockVarDecl if the constant folder isn't accurate.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62949 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix the address of a label to be properly considered and emitted as a
Eli Friedman [Sun, 25 Jan 2009 01:21:06 +0000 (01:21 +0000)]
Fix the address of a label to be properly considered and emitted as a
constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62948 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix for PR2100: merge types for variables.
Eli Friedman [Sat, 24 Jan 2009 23:49:55 +0000 (23:49 +0000)]
Fix for PR2100: merge types for variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62947 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCorrect test; sorry for any inconvenience.
Eli Friedman [Sat, 24 Jan 2009 23:44:26 +0000 (23:44 +0000)]
Correct test; sorry for any inconvenience.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62946 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCompute instaceStart/instanceSize fields of the class_ro_t meta-data
Fariborz Jahanian [Sat, 24 Jan 2009 23:43:01 +0000 (23:43 +0000)]
Compute instaceStart/instanceSize fields of the class_ro_t meta-data
for objc2's non-fragile abi.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62945 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake tentative parsing of pointer-to-member decls work, and fix other stuff pointed...
Sebastian Redl [Sat, 24 Jan 2009 23:29:36 +0000 (23:29 +0000)]
Make tentative parsing of pointer-to-member decls work, and fix other stuff pointed out by Doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62944 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPR3062: statement expressions should be illegal at file scope. I don't
Eli Friedman [Sat, 24 Jan 2009 23:09:00 +0000 (23:09 +0000)]
PR3062: statement expressions should be illegal at file scope.  I don't
think this has any significant effects at the moment, but it could
matter if we start constant-folding statement expressions like gcc does.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62943 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix for PR2910: implement CodeGen for non-constant offsetof.
Eli Friedman [Sat, 24 Jan 2009 22:38:55 +0000 (22:38 +0000)]
Fix for PR2910: implement CodeGen for non-constant offsetof.

Note that there are still other issues in this area; see PR3396.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62942 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRefactor sizeof handling to use constant folding logic for constant
Eli Friedman [Sat, 24 Jan 2009 22:19:05 +0000 (22:19 +0000)]
Refactor sizeof handling to use constant folding logic for constant
sizeof expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62941 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd initial support for the gcc "alignof(decl) is the alignment of the decl
Chris Lattner [Sat, 24 Jan 2009 21:53:27 +0000 (21:53 +0000)]
add initial support for the gcc "alignof(decl) is the alignment of the decl
not the type" semantics.  This can definitely be improved, but is better than
what we had.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62939 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUndo accidental disabling of smart pointers.
Sebastian Redl [Sat, 24 Jan 2009 21:36:33 +0000 (21:36 +0000)]
Undo accidental disabling of smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62937 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement C99 6.5.3.4p1, rejecting sizeof(bitfield)
Chris Lattner [Sat, 24 Jan 2009 21:29:22 +0000 (21:29 +0000)]
Implement C99 6.5.3.4p1, rejecting sizeof(bitfield)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62936 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch to build class meta-data for each implementation
Fariborz Jahanian [Sat, 24 Jan 2009 21:21:53 +0000 (21:21 +0000)]
Patch to build class meta-data for each implementation
of class in objc2's nonfragile abi.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62935 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd support for declaring pointers to members.
Sebastian Redl [Sat, 24 Jan 2009 21:16:55 +0000 (21:16 +0000)]
Add support for declaring pointers to members.
Add serialization support for ReferenceType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62934 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove a bunch of alignment handling code out of CGExprScalar, since
Chris Lattner [Sat, 24 Jan 2009 21:09:45 +0000 (21:09 +0000)]
remove a bunch of alignment handling code out of CGExprScalar, since
alignment must always be a constant.  Just let the constant folder
do it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62933 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove handling of alignof. alignof(VLA) now works properly for example.
Chris Lattner [Sat, 24 Jan 2009 21:09:06 +0000 (21:09 +0000)]
Improve handling of alignof.  alignof(VLA) now works properly for example.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62932 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix some const-correctness issues.
Chris Lattner [Sat, 24 Jan 2009 21:08:33 +0000 (21:08 +0000)]
fix some const-correctness issues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62931 91177308-0d34-0410-b5e6-96231b3b80d8