Commit Graph

1003 Commits

Author SHA1 Message Date
Chandler Carruth a3e1f9a02c Implement basic __is_trivial type-trait support, enough to close PR9472.
This introduces a few APIs on the AST to bundle up the standard-based
logic so that programmatic clients have access to exactly the same
behavior.

There is only one serious FIXME here: checking for non-trivial move
constructors and move assignment operators. Those bits need to be added
to the declaration and accessors provided.

This implementation should be enough for the uses of __is_trivial in
libstdc++ 4.6's C++98 library implementation.

Ideas for more thorough test cases or any edge cases missing would be
appreciated. =D

llvm-svn: 130057
2011-04-23 10:47:28 +00:00
Chandler Carruth 7980348fcf Sort the type traits in a few places where they weren't previously
sorted in order to prepare for adding some new ones.

llvm-svn: 130056
2011-04-23 10:47:20 +00:00
Chris Lattner 9fa385d437 don't warn about empty macro arguments in c++'0x mode, since it sucked in
the c99 preprocessor.  Patch by Jonathan Sauer!

llvm-svn: 130031
2011-04-22 23:25:09 +00:00
Richard Smith 9bc6eedab4 Add __has_feature(cxx_range_for) check for C++11 range-based for loop.
llvm-svn: 129573
2011-04-15 15:14:40 +00:00
Chris Lattner 57540c5be0 fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129559
2011-04-15 05:22:18 +00:00
Peter Collingbourne 9114759641 C1X: implement generic selections
As an extension, generic selection support has been added for all
supported languages.  The syntax is the same as for C1X.

llvm-svn: 129554
2011-04-15 00:35:48 +00:00
Richard Smith f7b6202e6c Implement C++0x [lex.pptoken]p3's handling of <::.
llvm-svn: 129525
2011-04-14 18:36:27 +00:00
Eric Christopher 7f36a79ee9 Eat the UTF-8 BOM at the beginning of a file since it's ignored anyhow.
Nom Nom Nom.

Patch by Anton Korobeynikov!

llvm-svn: 129174
2011-04-09 00:01:04 +00:00
John McCall 75ca6d72c2 Fix getLocForEndOfToken to not double-count spurious internal characters
within a token, like trigraphs and escaped newlines.               
Patch by Marcin Kowalczyk!

llvm-svn: 128978
2011-04-06 01:50:22 +00:00
Douglas Gregor 7bf3fbe6e1 Add a __has_feature check for the 'availability' attribute
llvm-svn: 128337
2011-03-26 12:16:15 +00:00
Anders Carlsson 69f1f9391b we can now claim to fully support the override control feature in C++0x.
llvm-svn: 128281
2011-03-25 15:04:23 +00:00
Daniel Dunbar 1057f86d0e Lexer: Add extremely limited support for -traditional-cpp, ignoring BCPL
comments.

llvm-svn: 127910
2011-03-18 21:23:38 +00:00
Argyrios Kyrtzidis d6278e3252 Having FileManager::getFile always open the file, brought much consternation and leaking of file descriptors.
Add 'openFile' bool to FileManager::getFile to specify whether we want to have the file opened or not, have it
false by default, and enable it only in HeaderSearch.cpp where the open+fstat optimization matters.

Fixes rdar://9139899.

llvm-svn: 127748
2011-03-16 19:17:25 +00:00
Chandler Carruth 3cc331a160 Add a 'RawPath' parameter to the PPCallbacks interface. This allows
clients to observe the exact path through which an #included file was
located. This is very useful when trying to record and replay inclusion
operations without it beind influenced by the aggressive caching done
inside the FileManager to avoid redundant system calls and filesystem
operations.

The work to compute and return this is only done in the presence of
callbacks, so it should have no effect on normal compilation.

Patch by Manuel Klimek.

llvm-svn: 127742
2011-03-16 18:34:36 +00:00
Sebastian Redl c17003c66b Create __has_feature(cxx_noexcept) and mark it as working.
Find out that our C++0x status has only one field for noexcept expression and specification together, and that it was accidentally already marked as fully implemented.
This completes noexcept specification work.

llvm-svn: 127701
2011-03-15 21:17:12 +00:00
John McCall 462c055d85 Fix my earlier commit to work with escaped newlines and leave breadcrumbs
in case we want to make a world where we can check intermediate instantiations
for this kind of breadcrumb.

llvm-svn: 127221
2011-03-08 07:59:04 +00:00
John McCall cff9bcfbd3 Add an API call to retrieve the spelling data of a token from its SourceLocation.
llvm-svn: 127216
2011-03-08 04:06:57 +00:00
John McCall 86bc21ffcf Provide an attribute, objc_method_family, to allow the inferred family
of an Objective-C method to be overridden on a case-by-case basis.  This
is a higher-level tool than ns_returns_retained &c.;  it lets users specify
that not only does a method have different retain/release semantics, but
that it semantically acts differently than one might assume from its name.
This in turn is quite useful to static analysis.

llvm-svn: 126839
2011-03-02 11:33:24 +00:00
Peter Collingbourne 2f1e36bfd0 Rename tok::eom to tok::eod.
The previous name was inaccurate as this token in fact appears at
the end of every preprocessing directive, not just macro definitions.
No functionality change, except for a diagnostic tweak.

llvm-svn: 126631
2011-02-28 02:37:51 +00:00
Peter Collingbourne f29ce975ba Reimplement __pragma support using a TokenLexer
llvm-svn: 126221
2011-02-22 13:49:06 +00:00
Peter Collingbourne 2c9f966600 Make TokenLexer capable of storing preprocessor directive tokens
llvm-svn: 126220
2011-02-22 13:49:00 +00:00
Richard Smith 7ee0d5664e Turn on __has_feature(cxx_auto_type). The feature is now fully implemented.
llvm-svn: 126078
2011-02-20 12:13:05 +00:00
Argyrios Kyrtzidis c541ade850 Warn for missing terminating " or ' instead of error for gcc compatibility. Fixed rdar://8914293.
llvm-svn: 125616
2011-02-15 23:45:31 +00:00
Peter Collingbourne 564c0fa47a Move support for "#pragma STDC FP_CONTRACT" to Parser; add Sema actions
llvm-svn: 125474
2011-02-14 01:42:35 +00:00
Peter Collingbourne 3bffa52933 Make LexOnOffSwitch a Preprocessor member function
llvm-svn: 125473
2011-02-14 01:42:24 +00:00
Jeffrey Yasskin c498878e6d Add CMake dependencies so that LLVM_USED_LIBS order doesn't matter.
I also sorted the tools/driver dependencies since their order no
longer matters.

llvm-svn: 125417
2011-02-11 23:46:38 +00:00
Douglas Gregor 09b6989ef0 Implement two related optimizations that make de-serialization of
AST/PCH files more lazy:
  - Don't preload all of the file source-location entries when reading
  the AST file. Instead, load them lazily, when needed.
  - Only look up header-search information (whether a header was already
  #import'd, how many times it's been included, etc.) when it's needed
  by the preprocessor, rather than pre-populating it.

Previously, we would pre-load all of the file source-location entries,
which also populated the header-search information structure. This was
a relatively minor performance issue, since we would end up stat()'ing
all of the headers stored within a AST/PCH file when the AST/PCH file
was loaded. In the normal PCH use case, the stat()s were cached, so
the cost--of preloading ~860 source-location entries in the Cocoa.h
case---was relatively low.

However, the recent optimization that replaced stat+open with
open+fstat turned this into a major problem, since the preloading of
source-location entries would now end up opening those files. Worse,
those files wouldn't be closed until the file manager was destroyed,
so just opening a Cocoa.h PCH file would hold on to ~860 file
descriptors, and it was easy to blow through the process's limit on
the number of open file descriptors.

By eliminating the preloading of these files, we neither open nor stat
the headers stored in the PCH/AST file until they're actually needed
for something. Concretely, we went from

*** HeaderSearch Stats:
835 files tracked.
  364 #import/#pragma once files.
  823 included exactly once.
  6 max times a file is included.
  3 #include/#include_next/#import.
    0 #includes skipped due to the multi-include optimization.
1 framework lookups.
0 subframework lookups.

*** Source Manager Stats:
835 files mapped, 3 mem buffers mapped.
37460 SLocEntry's allocated, 11215575B of Sloc address space used.
62 bytes of files mapped, 0 files with line #'s computed.

with a trivial program that uses a chained PCH including a Cocoa PCH
to

*** HeaderSearch Stats:
4 files tracked.
  1 #import/#pragma once files.
  3 included exactly once.
  2 max times a file is included.
  3 #include/#include_next/#import.
    0 #includes skipped due to the multi-include optimization.
1 framework lookups.
0 subframework lookups.

*** Source Manager Stats:
3 files mapped, 3 mem buffers mapped.
37460 SLocEntry's allocated, 11215575B of Sloc address space used.
62 bytes of files mapped, 0 files with line #'s computed.

for the same program.

llvm-svn: 125286
2011-02-10 17:09:37 +00:00
NAKAMURA Takumi 98dd73d66c CMake: LLVM_NO_RTTI must be obsolete now!
llvm-svn: 125275
2011-02-10 09:15:32 +00:00
Peter Collingbourne c1270f51fa Lexer: add CUDA kernel call tokens
llvm-svn: 125218
2011-02-09 21:08:21 +00:00
Douglas Gregor 7115aee109 Add a __has_feature check for default template arguments in function
templates, a C++0x feature.

llvm-svn: 124973
2011-02-05 20:35:30 +00:00
Douglas Gregor 7c60768590 Add __has_feature() for each of the type traits
llvm-svn: 124820
2011-02-03 21:57:35 +00:00
Douglas Gregor 86af98444f Harden Lexer::GetBeginningOfToken() against bogus source locations and
the disappearance/alteration of files.

llvm-svn: 124616
2011-01-31 22:42:36 +00:00
Ted Kremenek afe348ea43 Wire up attributes 'ns_consumed' and 'cf_consumed' in the static analyzer's ObjC retain/release checker.
llvm-svn: 124386
2011-01-27 18:43:03 +00:00
Ted Kremenek 0e89838ced Hook up attribute ns_consumes_self in the ObjC retain/release checker in the static analyzer.
llvm-svn: 124360
2011-01-27 06:54:14 +00:00
Douglas Gregor 56d5f0abaa Add __has_feature(cxx_reference_qualified_functions); update tests and
documentation.

llvm-svn: 124322
2011-01-26 21:25:54 +00:00
Douglas Gregor c41d94eb1a Clean up the C++0x __has_feature tests. Specifically:
- Don't publicize a C++0x feature through __has_feature if we aren't
    in C++0x mode (even if the feature is available only with a
    warning). 
  - "auto" is not implemented well enough for its __has_feature to be
    turned on.
  - Fix the test of C++0x __has_feature to actually test what we're
  trying to test. Searching for the substring "foo" when our options
  are "foo" and "no_foo" doesn't work :)

llvm-svn: 124291
2011-01-26 15:36:03 +00:00
Douglas Gregor 0098499f7d Downgrade the error about rvalue references to an extension warning
and turn on __has_feature(cxx_rvalue_references). The core rvalue
references proposal seems to be fully implemented now, pending lots
more testing.

llvm-svn: 124169
2011-01-25 02:17:32 +00:00
Douglas Gregor 312ab72dbd Eradicate any mention of C++0x concepts.
llvm-svn: 123860
2011-01-19 23:15:20 +00:00
Douglas Gregor eecc6bc388 Variadic templates are fully implemented.
Turn on the __has_feature switch for variadic templates, document
their completion, and put the ExtWarn into the c++0x-extensions
warning group.

llvm-svn: 123854
2011-01-19 22:11:50 +00:00
Argyrios Kyrtzidis b495cc1a7b When redefining a macro don't warn twice if it's not used and don't warn for duplicate
definition by command line options. Fixes rdar://8875916.

llvm-svn: 123767
2011-01-18 19:50:15 +00:00
Chris Lattner 008c0a4a68 clean up some dead code around __has_include() processing code identified by the ted-o-matic.
rdar://8867482

llvm-svn: 123522
2011-01-15 06:57:04 +00:00
Francois Pichet 12df1dc8f2 Microsoft integer suffix changes:
i64 is like LL
i32 is like L

Also set isMicrosoftInteger to true only if the suffix is well formed.

llvm-svn: 123230
2011-01-11 11:57:53 +00:00
Michael J. Spencer f6efe58d45 Replace all uses of PathV1::exists with PathV2::fs::exists.
llvm-svn: 123150
2011-01-10 02:34:13 +00:00
Chris Lattner 56f64c14b7 fix rdar://8823139, a crash on a comment in a preprocessed .s file
that contains the ## operator.

llvm-svn: 122946
2011-01-06 05:01:51 +00:00
Chandler Carruth 540960f4a2 Fix PR8654, ensuring each branch of an #if, #elif, #else, ... chain
receives a PPCallback.

Patch by Richard Smith.

llvm-svn: 122755
2011-01-03 17:40:17 +00:00
Jeffrey Yasskin b3321531a8 Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.  Fix one bug found by the warning, in which one
clang::OverloadCandidate constructor failed to initialize its
FunctionTemplate member.

llvm-svn: 122459
2010-12-23 01:01:28 +00:00
Abramo Bagnara ea4f7c7761 Introduced raw_identifier token kind.
llvm-svn: 122394
2010-12-22 08:23:18 +00:00
Nick Lewycky 2e998b7a6e Add missing standard includes. Patch by Joerg Sonnenberger!
llvm-svn: 122194
2010-12-19 20:49:25 +00:00
Michael J. Spencer f28df4cdba Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.
llvm-svn: 122087
2010-12-17 21:22:22 +00:00
Michael J. Spencer d9da7a1f16 MemoryBuffer API update.
llvm-svn: 121956
2010-12-16 03:28:14 +00:00
Argyrios Kyrtzidis 1cb0de1d4c Fix diagnostic pragmas.
Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.

Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.

Fixes rdar://8365684.

llvm-svn: 121873
2010-12-15 18:44:22 +00:00
Douglas Gregor 9c7bd2f535 Don't crash when code-completing after "#include <". It would be far
better to actually produce a decent set of completions by checking the
system include paths, but not today. Fixes PR8744.

llvm-svn: 121431
2010-12-09 23:35:36 +00:00
Michael J. Spencer f25faaaffb Use error_code instead of std::string* for MemoryBuffer.
llvm-svn: 121378
2010-12-09 17:36:38 +00:00
Ted Kremenek 8c4c74f4fb Fix diagnostic for reporting bad escape sequence.
Patch by Paul Curtis!

llvm-svn: 120759
2010-12-03 00:09:56 +00:00
Michael J. Spencer 8aaf49959c Merge System into Support.
llvm-svn: 120297
2010-11-29 18:12:39 +00:00
Chris Lattner dd278430a3 change the 'is directory' indicator to be a null-or-not
pointer that is passed down through the APIs, and make
FileSystemStatCache::get be the one that filters out
directory lookups that hit files.  This also paves the
way to have stat queries be able to return opened files.

llvm-svn: 120060
2010-11-23 21:17:56 +00:00
Chris Lattner 8f0583daa2 simplify the cache miss handling code, eliminating CacheMissing.
llvm-svn: 120038
2010-11-23 20:05:15 +00:00
Chris Lattner 226efd356c rework the stat cache, pulling it out of FileManager.h into
its own header and giving it some more structure.  No 
functionality change.

llvm-svn: 120030
2010-11-23 19:19:34 +00:00
Chris Lattner 7219a5db6e don't allow remapping PTH file paths with -fworking-directory, the
client should just pass in absolute paths.

llvm-svn: 120012
2010-11-23 09:01:31 +00:00
Chris Lattner 5159f6162e now the FileManager has a FileSystemOpts ivar, stop threading
FileSystemOpts through a ton of apis, simplifying a lot of code.
This also fixes a latent bug in ASTUnit where it would invoke
methods on FileManager without creating one in some code paths
in cindextext.

llvm-svn: 120010
2010-11-23 08:35:12 +00:00
Chris Lattner 7c434b6937 tidy up
llvm-svn: 119996
2010-11-23 04:40:26 +00:00
Chris Lattner 8afa6deb1d remove old compatibility APIs, use StringRef versions instead.
llvm-svn: 119935
2010-11-21 09:55:08 +00:00
Argyrios Kyrtzidis de2bdf637e Revert r119838 "Don't warn for empty 'if' body if there is a macro that expands to nothing"
and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro.

Thanks to Abramo Bagnara for the hint!

llvm-svn: 119887
2010-11-20 02:04:01 +00:00
Craig Silverstein 1a9ca21881 Several PPCallbacks take an SourceLocation + IdentifierInfo, rather
than a Token that holds the same information all in one easy-to-use
package.  There's no technical reason to prefer the former -- the
information comes from a Token originally -- and it's clumsier to use,
so I've changed the code to use tokens everywhere.

Approved by clattner

llvm-svn: 119845
2010-11-19 21:33:15 +00:00
Argyrios Kyrtzidis 90ee2a4ecf Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:
if (condition)
    CALL(0); // empty macro but don't warn for empty body.

Fixes rdar://8436021.

llvm-svn: 119838
2010-11-19 20:54:25 +00:00
Chris Lattner 39720111e0 move getSpelling from Preprocessor to Lexer, which it is more conceptually related to.
llvm-svn: 119479
2010-11-17 07:26:20 +00:00
Chris Lattner 6bab435db6 propagate preprocessor out of StringLiteralParser. It is now
possible to create one without a preprocessor.

llvm-svn: 119476
2010-11-17 07:21:13 +00:00
Chris Lattner 2be8aa9611 push the preprocessor out of EncodeUCNEscape
llvm-svn: 119475
2010-11-17 07:12:42 +00:00
Chris Lattner 2a6ee91619 move AdvanceToTokenCharacter and getLocForEndOfToken from
Preprocessor to Lexer where they make more sense.

llvm-svn: 119474
2010-11-17 07:05:50 +00:00
Chris Lattner b1ab2c2d3d add a static version of PP::AdvanceToTokenCharacter.
llvm-svn: 119472
2010-11-17 06:55:10 +00:00
Chris Lattner bde1b81eb8 push use of Preprocessor out farther.
llvm-svn: 119471
2010-11-17 06:46:14 +00:00
Chris Lattner 3a324d3232 push use of Preprocessor out of getOffsetOfStringByte
llvm-svn: 119470
2010-11-17 06:35:43 +00:00
Chris Lattner 30d4c928ac add a static form of the efficient PP::getSpelling method.
llvm-svn: 119469
2010-11-17 06:31:48 +00:00
Chris Lattner 7a02bfdfce refactor the interface to StringLiteralParser::getOffsetOfStringByte,
pushing the dependency on the preprocessor out a bit.

llvm-svn: 119468
2010-11-17 06:26:08 +00:00
Douglas Gregor 453b012513 Make sure to always check the result of
SourceManager::getPresumedLoc(), so that we don't try to make use of
an invalid presumed location. Doing so can cause crashes.

llvm-svn: 118885
2010-11-12 07:15:47 +00:00
NAKAMURA Takumi c0d7d99cc1 lib/Lex/PPMacroExpansion.cpp: Fixup to appease MSVC.
Confirmed on MSVS10.

llvm-svn: 118496
2010-11-09 06:27:32 +00:00
Douglas Gregor ae674f3148 Appeasing MSVC, take 3
llvm-svn: 118493
2010-11-09 05:43:53 +00:00
Douglas Gregor 416463f7f3 Try to appease MSVC
llvm-svn: 118487
2010-11-09 04:38:09 +00:00
Douglas Gregor 9169dcb7a9 sprintf -> snprintf conversion, from Vladimir Kirillov
llvm-svn: 118478
2010-11-09 03:20:07 +00:00
John McCall f71b45367f Document Clang's support for attributes on individual enumerators and
tweak the documentation for deprecation-with-message.  Provide __has_feature
tests for both.  rdar://problem/8605692

llvm-svn: 118435
2010-11-08 19:48:17 +00:00
Craig Silverstein 8e3d95e7df Add PPCallbacks for #if/#ifdef/etc.
The callback info for #if/#elif is not great -- ideally it would give
us a list of tokens in the #if, or even better, a little parse tree.
But that's a lot more work.  Instead, clients can retokenize using
Lexer::LexFromRawLexer().

Reviewed by nlewycky.

llvm-svn: 118318
2010-11-06 01:19:03 +00:00
Argyrios Kyrtzidis 71731d6b05 Implement -working-directory.
When -working-directory is passed in command line, file paths are resolved relative to the specified directory.
This helps both when using libclang (where we can't require the user to actually change the working directory)
and to help reproduce test cases when the reproduction work comes along.

--FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains
 the working directory value if set).
--FileSystemOptions are passed around to various interfaces that perform file operations.
--Opening & reading the content of files should be done only through FileManager. This is useful in general since
 file operations will be abstracted in the future for the reproduction mechanism.

FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same
FileManager but with different FileSystemOptions.

Addresses rdar://8583824.

llvm-svn: 118203
2010-11-03 22:45:23 +00:00
Douglas Gregor f09b6c9c85 Plug a leak in the preprocessing record's handling of inclusion
directives. We had a std::string in an object that was allocated via a
BumpPtrAllocator.

llvm-svn: 117912
2010-11-01 15:03:47 +00:00
Chris Lattner 5c0b40528d Rename alignof -> alignOf to avoid irritating C++'0x compilers,
PR8423

llvm-svn: 117775
2010-10-30 05:14:06 +00:00
Douglas Gregor 5ef9e33137 Make the deserialization of macro definitions lazy, so that we can
load identifiers without loading their corresponding macro
definitions. This is likely to improve PCH performance slightly, and
reduces deserialization stack depth considerably when using
preprocessor metaprogramming.

llvm-svn: 117750
2010-10-30 00:23:06 +00:00
Chandler Carruth c3ce5840af Update remaining attribute macros to new style.
llvm-svn: 117204
2010-10-23 08:44:57 +00:00
Douglas Gregor 796d76a663 Extend the preprocessing record and libclang with support for
inclusion directives, keeping track of every #include, #import,
etc. in the translation unit. We keep track of the source location and
kind of the inclusion, how the file name was spelled, and the
underlying file to which the inclusion resolved.

llvm-svn: 116952
2010-10-20 22:00:55 +00:00
Anders Carlsson 274a70ed7f Add a __has_attribute macro that works much like __has_feature and __has_builtin.
llvm-svn: 116906
2010-10-20 02:31:43 +00:00
Ted Kremenek c8456f8c59 Really^2 fix <rdar://problem/8361834>, this time without crashing.
Now MICache is a linked list (per the FIXME), where we tradeoff between MacroInfo objects being in MICache
and MIChainHead.  MacroInfo objects in the MICache chain are already "Destroy()'ed", so they can be reused.  When
inserting into MICache, we need to remove them from the regular linked list so that they aren't destroyed more than
once.

llvm-svn: 116869
2010-10-19 22:15:20 +00:00
Ted Kremenek 60ba93cd62 Revert most of r116862. It isn't quite the right fix for a memory leak in Preprocessor.
llvm-svn: 116864
2010-10-19 21:40:34 +00:00
Ted Kremenek e75b876fb9 Really fix: <rdar://problem/8361834> MacroInfo::AddTokenToBody() leaks memory
The problem was not the management of MacroInfo objects, but that when we recycle them
via the MICache the memory of the underlying SmallVector (within MacroInfo) was not getting
released.  This is because objects stashed into MICache simply are reused with a placement
new, and never have their destructor called.

llvm-svn: 116862
2010-10-19 21:30:15 +00:00
Ted Kremenek b865f7e025 Simplify loop. No functionality change.
llvm-svn: 116861
2010-10-19 21:30:11 +00:00
Ted Kremenek 1f1e4bdbf7 Simplify lifetime management of MacroInfo objects in Preprocessor by having the Preprocessor maintain them in a linked
list of allocated MacroInfos.  This requires only 1 extra pointer per MacroInfo object, and allows us to blow them
away in one place.  This fixes an elusive memory leak with MacroInfos (whose exact location I couldn't still figure
out despite substantial digging).

Fixes <rdar://problem/8361834>.

llvm-svn: 116842
2010-10-19 18:16:54 +00:00
Ted Kremenek 2c8028bcf4 In ~Preprocessor(), also cleanup the MacroInfo objects left-over from stray "#pragma push_macro" uses. This
fixes a potential memory leak.

llvm-svn: 116826
2010-10-19 17:40:53 +00:00
Ted Kremenek 6339f1ce2f Fix typo in comment.
llvm-svn: 116825
2010-10-19 17:40:50 +00:00
Chris Lattner 26f6c227dc allow I128 suffixes in msextensions mode just like i128 suffixes, patch
by Martin Vejnar!

llvm-svn: 116460
2010-10-14 00:24:10 +00:00
Chris Lattner 2edb926880 move logic for computing signed integer overflow when constant folding
into APInt.

llvm-svn: 116453
2010-10-13 23:46:56 +00:00
Nico Weber a6bde81bc8 Add support for UCNs for character literals
llvm-svn: 116129
2010-10-09 00:27:47 +00:00
Douglas Gregor 0bf3140424 Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked a
bit by me). 

llvm-svn: 116122
2010-10-08 23:50:27 +00:00
Nico Weber 9762e0a234 Add support for 4-byte UCNs like \U12345678. Warn about UCNs in c90 mode.
llvm-svn: 115743
2010-10-06 04:57:26 +00:00
Douglas Gregor 7fb25418ed Implement the C++0x "trailing return type" feature, e.g.,
auto f(int) -> int

from Daniel Wallin!

(With a few minor bug fixes from me).

llvm-svn: 115322
2010-10-01 18:44:50 +00:00
Sebastian Redl 517523014d In MeasureTokenLength, the FileLoc supplied to the lexer must point to the start of the buffer, or we risk overflow.
llvm-svn: 115117
2010-09-30 01:03:03 +00:00
Michael J. Spencer 4362a1c987 Fix coding standard mistake from my last commit.
That, and keep aKor happy :P.

llvm-svn: 114816
2010-09-27 06:34:47 +00:00
Michael J. Spencer a0a820fadb Lexer: Implement GCC's version of pragma message.
llvm-svn: 114814
2010-09-27 06:19:02 +00:00
Anders Carlsson 991285e425 Allow the use of C++0x deleted functions as an extension in C++98.
llvm-svn: 114762
2010-09-24 21:25:25 +00:00
Michael J. Spencer 09476212de Revert "CMake: Update to use standard CMake dependency tracking facilities instead"
This reverts commit r113631

Conflicts:

	CMakeLists.txt
	lib/CodeGen/CMakeLists.txt

llvm-svn: 113817
2010-09-13 23:54:41 +00:00
Michael J. Spencer 0881f4a367 CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

llvm-svn: 113631
2010-09-10 21:13:16 +00:00
Douglas Gregor c7d6576d54 When we parse a pragma, keep track of how that pragma was originally
spelled (#pragma, _Pragma, __pragma). In -E mode, use that information
to add appropriate newlines when translating _Pragma and __pragma into
#pragma, like GCC does. Fixes <rdar://problem/8412013>.

llvm-svn: 113553
2010-09-09 22:45:38 +00:00
Douglas Gregor b2f0713ddc Clean up some of the CMake dependencies
llvm-svn: 113416
2010-09-08 21:40:53 +00:00
Chris Lattner f0b0497343 fix 7320: we can't delete a trailing space if it doesn't exist.
llvm-svn: 113125
2010-09-05 23:16:09 +00:00
Fariborz Jahanian 9e42a952d7 Use getSpelling to get original text of the
c++ operator token. (radar 8328250).

llvm-svn: 112977
2010-09-03 17:33:04 +00:00
Fariborz Jahanian 0389df4a45 Patch to allow alternative representation of c++
operators (and, or, etc.) to be used as selectors
to match g++'s behavior.

llvm-svn: 112935
2010-09-03 01:26:16 +00:00
Fariborz Jahanian 39de024e66 Prevent warning when built with assert off.
llvm-svn: 112680
2010-08-31 23:54:38 +00:00
Fariborz Jahanian abaae2b692 Some support for unicode string constants
in wide strings. radar 8360841.

llvm-svn: 112672
2010-08-31 23:34:27 +00:00
Sebastian Redl a93bb5b807 Implement __has_feature(cxx_inline_namespaces)
llvm-svn: 112671
2010-08-31 23:28:47 +00:00
Chris Lattner 0f0492e69c improve isHexaLiteral to work with escaped newlines and trigraphs,
patch by Francois Pichet!

llvm-svn: 112602
2010-08-31 16:42:00 +00:00
Chris Lattner dec7334218 silence a warning
llvm-svn: 112549
2010-08-30 23:11:03 +00:00
Alexis Hunt 3b7918625c Revert my user-defined literal commits - r1124{58,60,67} pending
some issues being sorted out.

llvm-svn: 112493
2010-08-30 17:47:05 +00:00
Chris Lattner 5f183aa592 add a fixme.
llvm-svn: 112491
2010-08-30 17:11:14 +00:00
Chris Lattner 7a9e9e7d76 use 'features' instead of 'PP->getLangOptions'.
llvm-svn: 112490
2010-08-30 17:09:08 +00:00
Douglas Gregor 3cc2648b47 Now that GCC will have #pragma push/pop (in GCC 4.6), allow the
#pragma without requiring it to be in the "clang" namespace, from
Louis Gerbarg!

llvm-svn: 112484
2010-08-30 15:15:34 +00:00
Douglas Gregor 759ef23bb8 In Microsoft compatibility mode, don't parse the exponent as part of
the pp-number in a hexadecimal floating point literal, from Francois
Pichet! Fixes PR7968.

llvm-svn: 112481
2010-08-30 14:50:47 +00:00
Alexis Hunt 79eb5469e0 Implement C++0x user-defined string literals.
The extra data stored on user-defined literal Tokens is stored in extra
allocated memory, which is managed by the PreprocessorLexer because there isn't
a better place to put it that makes sure it gets deallocated, but only after
it's used up. My testing has shown no significant slowdown as a result, but
independent testing would be appreciated.

llvm-svn: 112458
2010-08-29 21:26:48 +00:00
John McCall 49039d4afb Complain if a __pragma isn't terminated.
llvm-svn: 112392
2010-08-29 01:09:54 +00:00
John McCall 89e925d78e Add support for Microsoft's __pragma in the preprocessor.
Patch by Francois Pichet!

llvm-svn: 112391
2010-08-28 22:34:47 +00:00
Douglas Gregor 33551892fa Tweak wording in an assertion, from dawn@burble.org.
llvm-svn: 112182
2010-08-26 14:07:34 +00:00
Douglas Gregor 115837041e Introduce a preprocessor code-completion hook for contexts where we
expect "natural" language and should not provide any completions,
e.g., comments, string literals, #error.

llvm-svn: 112054
2010-08-25 17:04:25 +00:00
Douglas Gregor ec00a26855 Implement code completion for preprocessor expressions and in macro
arguments.

llvm-svn: 111976
2010-08-24 22:20:20 +00:00
Douglas Gregor 127851084d Implement preprocessor code completion where a macro name is expected,
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname>
expression in a preprocessor conditional.

llvm-svn: 111954
2010-08-24 20:21:13 +00:00
Douglas Gregor 3a7ad25eb6 Introduce basic code-completion support for preprocessor directives,
e.g., after a "#" we'll suggest #if, #ifdef, etc.

llvm-svn: 111943
2010-08-24 19:08:16 +00:00
Eli Friedman 04831926ec Detabify.
llvm-svn: 111768
2010-08-22 01:00:03 +00:00
Chris Lattner 20a2b46ca2 fix PR7943, a corner case with the GNU __VA_ARGS__ comma
swallowing extension.

llvm-svn: 111701
2010-08-21 00:27:00 +00:00
Sebastian Redl d44cd6adba More PCH -> AST renaming.
llvm-svn: 111472
2010-08-18 23:57:06 +00:00
Daniel Dunbar 211a787eaf CrashRecovery: Add #pragma clang __debug handle_crash, useful when debugging
CrashRecovery since it avoids sending a signal which may be intercepted by the
debugger.

llvm-svn: 111449
2010-08-18 23:09:23 +00:00
Chris Lattner 66b67d209e no need to pass bumppointer allocator into macroinfo::destroy
llvm-svn: 111364
2010-08-18 16:08:51 +00:00
Daniel Dunbar f2cf329ccd Lex: Add #pragma clang __debug {llvm_fatal_error, llvm_unreachable}, for testing
those crash paths.

llvm-svn: 111311
2010-08-17 22:32:48 +00:00
Chris Lattner c0a585d63c Implement #pragma push_macro, patch by Francois Pichet!
llvm-svn: 111234
2010-08-17 15:55:45 +00:00
Douglas Gregor 02690ba643 Don't emit end-of-file diagnostics like "unterminated conditional" or
"unterminated string" when we're performing code completion.

llvm-svn: 110933
2010-08-12 17:04:55 +00:00
Benjamin Kramer e8394df11b Random temporary string cleanup.
llvm-svn: 110807
2010-08-11 14:47:12 +00:00
Douglas Gregor 028d3e4d0f Use precompiled preambles for in-process code completion.
llvm-svn: 110596
2010-08-09 20:45:32 +00:00
Douglas Gregor 618e64a23b Revert r110440, the fix for PR4897. Chris claims to have a better way.
llvm-svn: 110544
2010-08-08 07:49:23 +00:00
Benjamin Kramer d05f31d059 Push location through the MacroUndefined PPCallback and use it to print #undefs in -dD mode. (PR7818)
llvm-svn: 110523
2010-08-07 22:27:00 +00:00
Douglas Gregor d26129a98a Fix the #include search path when reading from stdin, from Jon Simons!
Fixes PR4897.

llvm-svn: 110440
2010-08-06 12:06:13 +00:00
Ted Kremenek d21139a34f After a lengthy design discussion, add support for "ownership attributes" for malloc/free checking. Patch by Andrew McGregor!
llvm-svn: 109939
2010-07-31 01:52:11 +00:00
Daniel Dunbar 51738ba43e Transcribe clattner email to SVN.
llvm-svn: 109727
2010-07-29 02:46:02 +00:00
Daniel Dunbar e11281077d Change #pragma crash to segv, instead of abort.
llvm-svn: 109725
2010-07-29 02:25:07 +00:00
Daniel Dunbar b8068c33e2 Preprocessor: Add support for '#pragma clang __debug crash' and '#pragma clang
__debug overflow_stack'.
 - For testing crash reporting stuff... you'd think I could just use some C++
   code but Doug keeps fixing stuff!

llvm-svn: 109587
2010-07-28 15:40:33 +00:00
Sebastian Redl 9891212476 Record macros in dependent PCHs. Also add various info tables to dependent PCHs; tests for this to follow.
llvm-svn: 109554
2010-07-27 23:01:28 +00:00
Ted Kremenek 2bd41d1e30 Add PTHLexer::LexEndOfFile() to emit diagnostics at end-of-file similar to those by Lexer::LexEndOfFile().
llvm-svn: 109486
2010-07-27 02:59:02 +00:00
Douglas Gregor 3f4bea0646 Introduce basic support for loading a precompiled preamble while
reparsing an ASTUnit. When saving a preamble, create a buffer larger
than the actual file we're working with but fill everything from the
end of the preamble to the end of the file with spaces (so the lexer
will quickly skip them). When we load the file, create a buffer of the
same size, filling it with the file and then spaces. Then, instruct
the lexer to start lexing after the preamble, therefore continuing the
parse from the spot where the preamble left off.

It's now possible to perform a simple preamble build + parse (+
reparse) with ASTUnit. However, one has to disable a bunch of checking
in the PCH reader to do so. That part isn't committed; it will likely
be handled with some other kind of flag (e.g., -fno-validate-pch).

As part of this, fix some issues with null termination of the memory
buffers created for the preamble; we were trying to explicitly
NULL-terminate them, even though they were also getting implicitly
NULL terminated, leading to excess warnings about NULL characters in
source files.

llvm-svn: 109445
2010-07-26 21:36:20 +00:00
Dan Gohman 28ade550f4 Fix namespace polution.
llvm-svn: 109440
2010-07-26 21:25:24 +00:00
Douglas Gregor cd8bdd025f Improve performance during cursor traversal when a region of interest
is present. 

Rather than using clang_getCursorExtent(), which requires
us to lex the token at the ending position to determine its
length. Then, we'd be comparing [a, b) source ranges that cover the
characters in the range rather than the normal behavior for Clang's
source ranges, which covers the tokens in the range. However, relexing
causes us to read the source file (which may come from a precompiled
header), which is rather unfortunate and affects performance.

In the new scheme, we only use Clang-style source ranges that cover
the tokens in the range. At the entry points where this matters
(clang_annotateTokens, clang_getCursor), we make sure to move source
locations to the start of the token.

Addresses most of <rdar://problem/8049381>.

llvm-svn: 109134
2010-07-22 20:22:31 +00:00
Douglas Gregor af82e3510b Introduce a new lexer function to compute the "preamble" of a file,
which is the part of the file that contains all of the initial
comments, includes, and preprocessor directives that occur before any
of the actual code. Added a new -print-preamble cc1 action that is
only used for testing.

llvm-svn: 108913
2010-07-20 20:18:03 +00:00
Douglas Gregor b37b46e488 Complain when string literals are too long for the active language
standard's minimum requirements.

llvm-svn: 108837
2010-07-20 14:33:20 +00:00
Chris Lattner ad4f38b1a9 BUILD_ARCHIVE is the default for libraries, no need to set it.
llvm-svn: 108633
2010-07-18 00:14:47 +00:00
Chris Lattner 52c00bdd5b Add another terrible VC++ compatibility hack: allow users to
allow invalid token pastes (when in -fms-extensions mode)
with -Wno-invalid-token-paste

llvm-svn: 108624
2010-07-17 16:24:30 +00:00
Argyrios Kyrtzidis 36745fda34 Modify the pragma handlers to accept and use StringRefs instead of IdentifierInfos.
When loading the PCH, IdentifierInfos that are associated with pragmas cause declarations that use these identifiers to be deserialized (e.g. the "clang" pragma causes the "clang" namespace to be loaded).
We can avoid this if we just use StringRefs for the pragmas.

As a bonus, since we don't have to create and pass IdentifierInfos, the pragma interfaces get a bit more simplified.

llvm-svn: 108237
2010-07-13 09:07:17 +00:00
Argyrios Kyrtzidis d1d239f35c Remove the check for repeated tok::eofs, we are not supposed to go past eof so this code is
totally unnecessary.

llvm-svn: 108199
2010-07-12 21:41:41 +00:00
Argyrios Kyrtzidis c2924de667 If we are past tok::eof and in caching lex mode, avoid caching repeated tok::eofs.
llvm-svn: 108175
2010-07-12 18:49:30 +00:00
Chris Lattner 5a503e9f70 we do in fact have to cache the EOF token returned by the preprocessor.
In the case of backtracking, the cached token lexer will be the only 
lexer on the stack, without this the token stack will be empty and EOF
won't be returned.

This fixes PR7072.

llvm-svn: 108124
2010-07-12 04:25:32 +00:00
Chris Lattner 86851b8a7a fix PR4499, patch by Kyle Dean!
llvm-svn: 107836
2010-07-07 23:24:27 +00:00
Chris Lattner 30c924b3e8 Implement support for #pragma message, patch by Michael Spencer!
llvm-svn: 106950
2010-06-26 17:11:39 +00:00
Eric Christopher 03256c32ff More clang support for darwin tls. Add a __has_feature macro and
target specific preprocessor define as well.

llvm-svn: 106715
2010-06-24 02:02:00 +00:00
Chris Lattner c548be9ab3 Remove a dead argument to ProcessUCNEscape.
Fix string concatenation to treat escapes in concatenated strings that
are wide because of other string chunks to process the escapes as wide
themselves.  Before we would warn about and miscompile the attached testcase.

This fixes rdar://8040728 - miscompile + warning: hex escape sequence out of range

llvm-svn: 106012
2010-06-15 18:06:43 +00:00
Daniel Dunbar d839e77b12 Preprocessor: Ignore unknown pragmas in -E -dM and -Eonly modes.
llvm-svn: 105830
2010-06-11 20:10:12 +00:00
Ted Kremenek dea66e3e4c Fix memory leak in Preprocessor where MacroInfo objects in the MICache wouldn't have their
associated SmallVectors get deallocated.

llvm-svn: 105658
2010-06-08 23:00:53 +00:00
Daniel Dunbar ee6b692551 Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.
llvm-svn: 105638
2010-06-08 20:44:43 +00:00
Daniel Dunbar e6c1daa8fd Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

llvm-svn: 105637
2010-06-08 20:34:18 +00:00
Chris Lattner 52d96ac930 simpler fix for rdar://8044135 - escaped newlines have already
been processed, so they don't have to be tip-toed around.

llvm-svn: 105182
2010-05-30 23:27:38 +00:00
Douglas Gregor fe4a4107d8 Improve our handling of NULL after an escaping '\' in a string
literal. Fixes <rdar://problem/8044135>.

llvm-svn: 105181
2010-05-30 22:59:50 +00:00
Fariborz Jahanian 93bef10131 Fix a miscompile of wchar pascal strings.
(radar 8020384)

llvm-svn: 104996
2010-05-28 19:40:48 +00:00
Douglas Gregor 9af03022ff Tell the string literal parser when it's not permitted to emit
diagnostics. That would be while we're parsing string literals for the
sole purpose of producing a diagnostic about them. Fixes
<rdar://problem/8026030>.

llvm-svn: 104684
2010-05-26 05:35:51 +00:00
Douglas Gregor 6da3db4af3 Improve code completion in failure cases in two ways:
1) Suppress diagnostics as soon as we form the code-completion
  token, so we don't get any error/warning spew from the early
  end-of-file.
  2) If we consume a code-completion token when we weren't expecting
  one, go into a code-completion recovery path that produces the best
  results it can based on the context that the parser is in.

llvm-svn: 104585
2010-05-25 05:58:43 +00:00
Chris Lattner 467f6bcfe5 robustify the conflict marker stuff. Don't add 7 twice, which would
make it miss (invalid) things like:
<<<<<<<
>>>>>>>

and crash if 

<<<<<<< 

was at the end of the line.  When we find a >>>>>>> that is not at the
end of the line, make sure to reset Pos so we don't crash on something
like:
<<<<<<< >>>>>>>

This isn't worth making testcases for, since each would require a new file.

rdar://7987078 - signal 11 compiling "<<<<<<<<<<"

llvm-svn: 103968
2010-05-17 20:27:25 +00:00
Chris Lattner 561aabd943 when code completing inside a C-style block comment, don't emit errors about
a missing */ since we truncated the file.

This fixes rdar://7948776

llvm-svn: 103913
2010-05-16 19:54:05 +00:00
Ted Kremenek e506ddc71e Add '__has_feature' support for weak ObjC classes.
llvm-svn: 102588
2010-04-29 02:06:46 +00:00
Ted Kremenek 6459939112 Sort '__has_feature' cases. No functionality change.
llvm-svn: 102587
2010-04-29 02:06:42 +00:00
Chris Lattner fb24a3a4ec push some source location information down through the compiler,
into ContentCache::getBuffer.  This allows it to produce 
diagnostics on the broken #include line instead of without a 
location.

llvm-svn: 101939
2010-04-20 20:35:58 +00:00
Chris Lattner 72286d6129 add a PPCallback handler for a skipped #include, patch by
Zhanyong Wan!

llvm-svn: 101813
2010-04-19 20:44:31 +00:00
Chris Lattner 1cf5bdd03d emit warn_char_constant_too_large at most once per literal, fixing PR6852
llvm-svn: 101580
2010-04-16 23:44:05 +00:00
Chris Lattner c745cec17c Improve line marker directive locations, patch by Jordy Rose
llvm-svn: 101226
2010-04-14 04:28:50 +00:00
Chris Lattner 0384e63501 make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."
when avoiding paste.  Patch by David Peixotto!

llvm-svn: 101218
2010-04-14 03:57:19 +00:00
Chris Lattner 1a9e873bf9 fix a minor bug I noticed while work with Jordy's patch for PR6101,
in an input file like this:

# 42
int x;

we were emitting:

# <something>
 int x;

(with a space before the int) because we weren't clearing the leading 
whitespace flag properly after the \n from the directive was handled.

llvm-svn: 101084
2010-04-12 23:04:41 +00:00
Chris Lattner 58c79341ab Match MemoryBuffer API changes.
llvm-svn: 100484
2010-04-05 22:42:27 +00:00
Douglas Gregor a771f46c82 Reinstate my CodeModificationHint -> FixItHint renaming patch, without
the C-only "optimization".

llvm-svn: 100022
2010-03-31 17:46:05 +00:00
Douglas Gregor 30e631862f Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder
llvm-svn: 100018
2010-03-31 17:25:35 +00:00
Douglas Gregor 3baad0d4f7 Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.

llvm-svn: 100008
2010-03-31 15:31:50 +00:00
Chris Lattner 8c5d05a299 fix a case where macro expansion should be disabled, patch by
Abramo Bagnara!

llvm-svn: 99626
2010-03-26 17:49:16 +00:00
Chris Lattner 80dbccd1bf fix a bug in paste avoidance which would cause us to accidentally
form a >>=.  Patch by Abramo Bagnara, testcase by me.

llvm-svn: 99624
2010-03-26 17:10:02 +00:00
Daniel Dunbar cb9eaf59fb PPCallbacks: Add hook for reaching the end of the main file, and fix DependencyFile to not do work in its destructor.
llvm-svn: 99257
2010-03-23 05:09:10 +00:00
Douglas Gregor 8aaca67b0a Robustify PreprocessingRecord slightly, by only creating macro
instantiations when we have the corresponding macro definition and by
removing macro definition information from our table when the macro is
undefined. 

llvm-svn: 99004
2010-03-19 21:58:23 +00:00
Douglas Gregor aae9224e49 Implement serialization and lazy deserialization of the preprocessing
record (which includes all macro instantiations and definitions). As
with all lay deserialization, this introduces a new external source
(here, an external preprocessing record source) that loads all of the
preprocessed entities prior to iterating over the entities.

The preprocessing record is an optional part of the precompiled header
that is disabled by default (enabled with
-detailed-preprocessing-record). When the preprocessor given to the
PCH writer has a preprocessing record, that record is written into the
PCH file. When the PCH reader is given a PCH file that contains a
preprocessing record, it will be lazily loaded (which, effectively,
implicitly adds -detailed-preprocessing-record). This is the first
case where we have sections of the precompiled header that are
added/removed based on a compilation flag, which is
unfortunate. However, this data consumes ~550k in the PCH file for
Cocoa.h (out of ~9.9MB), and there is a non-trivial cost to gathering
this detailed preprocessing information, so it's too expensive to turn
on by default. In the future, we should investigate a better encoding
of this information.

llvm-svn: 99002
2010-03-19 21:51:54 +00:00
Douglas Gregor 7dc8722bd3 Make the preprocessing record a PPCallbacks subclass itself,
eliminating the extra PopulatePreprocessingRecord object. This will
become useful once we start writing the preprocessing record to
precompiled headers.

llvm-svn: 98966
2010-03-19 17:12:43 +00:00
Douglas Gregor 7f6d60dcc2 Optionally store a PreprocessingRecord in the preprocessor itself, and
tie its creation to a CC1 flag -detailed-preprocessing-record.

llvm-svn: 98963
2010-03-19 16:15:56 +00:00
Douglas Gregor 78ae2481b6 Explicitly link macro instantiations to macro definitions in the
preprocessing record. Use that link with clang_getCursorReferenced()
and clang_getCursorDefinition() to match instantiations of a macro to
the definition of the macro.

llvm-svn: 98842
2010-03-18 18:23:03 +00:00
Douglas Gregor 065f8d11ca Introduce the notion of a "preprocessing record", which keeps track of
the macro definitions and macro instantiations that are found
during preprocessing. Preprocessing records are *not* generated by
default; rather, we provide a PPCallbacks subclass that hooks into the
existing callback mechanism to record this activity.

The only client of preprocessing records is CIndex, which keeps track
of macro definitions and instantations so that they can be exposed via
cursors. At present, only token annotation uses these facilities, and
only for macro instantiations; both will change in the near
future. However, with this change, token annotation properly annotates
macro instantiations that do not produce any tokens and instantiations
of macros that are later undef'd, improving our consistency.

Preprocessing directives that are not macro definitions are still
handled by clang_annotateTokens() via re-lexing, so that we don't have
to track every preprocessing directive in the preprocessing record.

Performance impact of preprocessing records is still TBD, although it
is limited to CIndex and therefore out of the path of the main compiler.

llvm-svn: 98836
2010-03-18 17:52:52 +00:00
Douglas Gregor 4ad3da2843 Entering the main source file in the preprocessor can fail if the
source file has been changed. Handle that failure more gracefully.

llvm-svn: 98727
2010-03-17 15:44:30 +00:00
Douglas Gregor 1668355e06 Remove unused variable
llvm-svn: 98691
2010-03-16 22:54:32 +00:00
Douglas Gregor dc970f0866 Audit all Preprocessor::getSpelling() callers, improving failure
recovery for those that need it.

llvm-svn: 98689
2010-03-16 22:30:13 +00:00
Douglas Gregor 42fe858cd6 Audit all callers of SourceManager::getCharacterData(); update some of
them to recover more gracefully on failure.

llvm-svn: 98672
2010-03-16 20:46:42 +00:00
Douglas Gregor 4fb7fbef3b Audit all getBuffer() callers (for both the FullSourceLoc and
SourceManager versions), updating those callers that need to recover
gracefully from failure.

llvm-svn: 98665
2010-03-16 20:01:30 +00:00
Douglas Gregor 26266da3c3 Teach the one caller of SourceManager::getMemoryBufferForFile() to cope with errors
llvm-svn: 98664
2010-03-16 19:49:24 +00:00
Benjamin Kramer eb92dc0b09 Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.
llvm-svn: 98630
2010-03-16 14:14:31 +00:00
Douglas Gregor 7bda4b8310 Introduce optional "Invalid" parameters to routines that invoke the
SourceManager's getBuffer() and, therefore, could fail, along with
Preprocessor::getSpelling(). Use the Invalid parameters in the literal
parsers (string, floating point, integral, character) to make them
robust against errors that stem from, e.g., PCH files that are not
consistent with the underlying file system.

I still need to audit every use caller to all of these routines, to
determine which ones need specific handling of error conditions.

llvm-svn: 98608
2010-03-16 05:20:39 +00:00
Douglas Gregor 874cc62876 Use SourceManager's Diagnostic object for all file-reading errors,
simplifying the SourceManager interfaces somewhat.

llvm-svn: 98598
2010-03-16 00:35:39 +00:00
Douglas Gregor e0fbb83b8b Give SourceManager a Diagnostic object with which to report errors,
and start simplifying the interfaces in SourceManager that can fail.

llvm-svn: 98594
2010-03-16 00:06:06 +00:00
Douglas Gregor 802b77601e Introduce a new BufferResult class to act as the return type of
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.

Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).

llvm-svn: 98585
2010-03-15 22:54:52 +00:00
Kovarththanan Rajaratnam ba2c65277a Use SmallString instead of SmallVector
llvm-svn: 98436
2010-03-13 10:17:05 +00:00
Kovarththanan Rajaratnam e5f1c197af No need to call setIdentifierInfo() after LookUpIdentifierInfo() which LookUpIdentifierInfo() will automatically do
llvm-svn: 98435
2010-03-13 08:53:33 +00:00
Jeffrey Yasskin f6442f80cb Allow users to set CPPFLAGS and CXXFLAGS on the make command line.
Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)
llvm-svn: 98399
2010-03-12 22:55:16 +00:00
Kovarththanan Rajaratnam 661a309933 Switch over IdentifierInfoLookup to StringRef
llvm-svn: 98337
2010-03-12 08:23:34 +00:00
Ted Kremenek a00c5db1a8 Augment __has_feature to report that Clang supports adding attribute 'unused'
to an Objective-C instance variable.

llvm-svn: 97850
2010-03-05 22:43:32 +00:00
Benjamin Kramer a197fb6731 Move method out-of-line. I thought this would be a candidate for inlining but I was wrong.
llvm-svn: 97330
2010-02-27 17:05:45 +00:00
Benjamin Kramer 53fa347ee6 Another trivial getSpelling simplification.
llvm-svn: 97327
2010-02-27 16:29:36 +00:00
Benjamin Kramer 0a1abd4088 Add an overload of Preprocessor::getSpelling which takes a SmallVector and
returns a StringRef. Use it to simplify some repetitive code.

llvm-svn: 97322
2010-02-27 13:44:12 +00:00
Chris Lattner 9c56ec86b2 fix rdar://7683173, rejecting an invalid conditional
llvm-svn: 97253
2010-02-26 19:42:53 +00:00
Ted Kremenek f2b64ba858 Add __has_feature support for attributes ns_returns_not_retained
and cf_returns_not_retained.

llvm-svn: 96538
2010-02-18 00:06:04 +00:00
Chris Lattner aa1cccbbef Fix PR6282: the include guard optimization cannot happen if the
guard macro is already defined for the first occurrence of the
header.  If it is, the body will be skipped and not be properly
analyzed for the include guard optimization.

llvm-svn: 95972
2010-02-12 08:03:27 +00:00
Sebastian Redl b0e3e1bf67 When placing an annotation token over an existing annotation token, make sure that the new token's range extends to the end of the old token. Assert that in AnnotateCachedTokens. Fixes PR6248.
llvm-svn: 95555
2010-02-08 19:35:18 +00:00
Chris Lattner 93ddf80eb7 don't inform comment handlers about comments in #if 0 blocks,
doing so invalidates the file guard optimization and is not
in the spirit of "#if 0" because it is supposed to completely
skip everything, even if it isn't lexically valid. Patch by
Abramo Bagnara!

llvm-svn: 95253
2010-02-03 21:06:21 +00:00
Ted Kremenek db4b7710f7 Fix subtle bug in Preprocessor::AdvanceToTokenCharacter(): use '+=' instead of '='.
llvm-svn: 94830
2010-01-29 19:38:24 +00:00
Benjamin Kramer b925f7707e Use raw_ostreams in Preprocessor::ExpandBuiltinMacro. Still not nice but less fragile than the old code.
llvm-svn: 94679
2010-01-27 16:38:22 +00:00
Douglas Gregor 64213261b4 Fix typo in comment
llvm-svn: 94576
2010-01-26 19:43:43 +00:00
Chris Lattner 0bcc858a2b -fno-rtti is now the default.
llvm-svn: 94379
2010-01-24 20:43:31 +00:00
Fariborz Jahanian 8c6c0b6a1f ui64, etc. are valid VS suffixes.
Fixes radar 7562363.

llvm-svn: 94224
2010-01-22 21:36:53 +00:00
Douglas Gregor 562c1f9365 Teach CIndex's cursor visitor to restrict its traversal to a specific
region of interest (if provided). Implement clang_getCursor() in terms
of this traversal rather than using the Index library; the unified
cursor visitor is more complete, and will be The Way Forward.

Minor other tweaks needed to make this work:
  - Extend Preprocessor::getLocForEndOfToken() to accept an offset
  from the end, making it easy to move to the last character in the
  token (rather than just past the end of the token).
  - In Lexer::MeasureTokenLength(), the length of whitespace is zero.

llvm-svn: 94200
2010-01-22 19:49:59 +00:00
Chris Lattner fde85356c6 revert my patch for rdar://7520940 that warns when a published header
is #included with "foo.h" style syntax instead of framework syntax.
It produced too much noise.

llvm-svn: 94120
2010-01-22 00:14:44 +00:00
Chris Lattner 87d0208c41 allow the HandlerComment callback to push tokens into the
preprocessor.  This could be used by an OpenMP implementation
or something.  Patch by Abramo Bagnara!

llvm-svn: 93795
2010-01-18 22:35:47 +00:00
Chris Lattner f406b2402d simplify the code for skipping in a #if 0 block. The CurLexer
pointer is always non-null because the PTH case exits earlier
in the method.

llvm-svn: 93794
2010-01-18 22:33:01 +00:00
Alexis Hunt af4e28d897 Add a bunch more feature-checking macros for C++0x features. Some of these are
disabled with the intent that users can start with them now and not have to change
a thing to have them work when we implement the features.

llvm-svn: 93312
2010-01-13 08:31:49 +00:00
Chris Lattner 21d9b9a948 add a TODO for a perf improvement in LexIdentifier.
llvm-svn: 93141
2010-01-11 02:38:50 +00:00
Alexis Hunt 91b78382b5 Do not parse hexadecimal floating point literals in C++0x mode because they are
incompatible with user-defined literals, specifically with the following form:

  0x1p+1

The preprocessing-number token extends only as far as the 'p'; the '+' is not
included. Previously we could get away with this extension as p was an invalid
suffix, but now with user-defined literals, 'p' might well be a valid suffix
and we are forced to consider it as such.

This patch also adds a warning in non-0x C++ modes telling the user that
this extension is incompatible with C++0x that is enabled by default
(previously and with other languages, we warn only with a compliance
option such as -pedantic).

llvm-svn: 93135
2010-01-10 23:37:56 +00:00
Benjamin Kramer 307c2c7ebc Simplify code. No functionality change.
llvm-svn: 93114
2010-01-10 09:51:00 +00:00
Chris Lattner d081f8c851 stringref'ize a bunch of filename handling logic. Much
nicer than passing around two const char*'s.

llvm-svn: 93094
2010-01-10 01:35:12 +00:00
Chris Lattner abcbb7c05b clarify comment.
llvm-svn: 93084
2010-01-10 00:35:27 +00:00
Chris Lattner 2ceb625f59 implement rdar://7520940: published framework headers should
import other headers within the same framework with the full
framework path, not with a relative include.

llvm-svn: 93083
2010-01-10 00:24:58 +00:00
Benjamin Kramer 60fbd641ad Simplify with StringSwitch.
llvm-svn: 93064
2010-01-09 18:53:11 +00:00
Douglas Gregor 9882a5aac6 Teach Preprocessor::macro_begin/macro_end to lazily load all macro
definitions from a precompiled header. This ensures that
code-completion with macro names behaves the same with or without
precompiled headers.

llvm-svn: 92497
2010-01-04 19:18:44 +00:00
Benjamin Kramer d77adb5b1c Avoid an unnecessary copy of Predefines. getMemBufferCopy does the null termination for us.
llvm-svn: 92358
2009-12-31 15:33:09 +00:00
Benjamin Kramer 14488464be Convert to StringRef, avoid a memcpy in the common case.
llvm-svn: 92357
2009-12-31 13:32:38 +00:00
Chris Lattner 9e0005f445 use best-fit instead of first-fit when reusing a MacroArgs object,
this speeds up Eonly on the testcase in PR5888 from 30.5s to 0.85s

llvm-svn: 92203
2009-12-28 06:36:46 +00:00
Chris Lattner 394f589e73 The PreExpArgTokens array is indexed with an argument #,
not a token number.  Fix the reserve logic to get the right
amount of space.

llvm-svn: 92202
2009-12-28 06:17:16 +00:00
John McCall 53b93a091e Diagnose out-of-bounds floating-point constants. Fixes rdar://problem/6974641
llvm-svn: 92127
2009-12-24 09:08:04 +00:00
Chris Lattner 43c8be526d comment tweak
llvm-svn: 92055
2009-12-23 21:29:53 +00:00
Chris Lattner 3859c74b32 fix the microsoft "charify" extension to return the charified token
as a character literal, not a string literal.  This might fix
rdar://7486575

llvm-svn: 92025
2009-12-23 19:15:27 +00:00
John McCall 230a5d527e Eliminate a completely unnecessary buffer copy when parsing float literals.
llvm-svn: 91974
2009-12-23 01:37:10 +00:00
Chris Lattner 3dfff974ec reimplement r90860, fixing a couple of problems:
1. Don't make a copy of LangOptions every time a lexer is created.
2. Don't make CharInfo global mutable state.
3. Fix the implementation to properly treat ^Z as EOF instead of as
   horizontal whitespace, which matches the semantic implemented by VC++.

llvm-svn: 91586
2009-12-17 05:29:40 +00:00
Chris Lattner 1316249ad2 enable reuse of MacroArgs objects. This is a small (2.5%) win
on PR5610 (2.185 -> 2.130s).  The big issue is that this is making
insanely huge macro argument lists with over a million tokens in it.
The reason that mallco and free are so expensive is that we are 
actually going to the kernel to get it, and switching to a bump 
pointer allocator won't change this in an interesting way.

llvm-svn: 91449
2009-12-15 20:48:12 +00:00
Chris Lattner d19564b109 set up the machinery for a MacroArgs cache hanging off Preprocessor.
We creating and free thousands of MacroArgs objects (and the related
std::vectors hanging off them) for the testcase in PR5610 even though
there are only ~20 live at a time.  This doesn't actually use the 
cache yet.

llvm-svn: 91391
2009-12-15 01:51:03 +00:00
Chris Lattner ffbf2de1d8 move the VarargsElided member of MacrosArgs to shrink the MacroArgs struct
on 64-bit targets.  Pass Preprocessor into create/destroy methods of MacroArgs
even though it isn't used yet.

llvm-svn: 91345
2009-12-14 22:12:52 +00:00
Chris Lattner d2fa78d0bd fix typo
llvm-svn: 91343
2009-12-14 22:02:43 +00:00
Chris Lattner 7c027ee4c2 teach clang to recover gracefully from conflict markers left in source
files: PR5238.

llvm-svn: 91270
2009-12-14 06:16:57 +00:00
Chris Lattner 4c53c40a4c fix rdar://7466570 - Be more bug compatible with GCC when it comes to
expanding directives withing macro expansions.  This is undefined behavior
according to 6.10.3p11, so we might as well be undefined in ways similar to
GCC.

llvm-svn: 91266
2009-12-14 05:00:18 +00:00
Chris Lattner 8cf1f935c2 formatting changes.
llvm-svn: 91263
2009-12-14 04:54:40 +00:00
Chris Lattner 676268e45a reduce indentation.
llvm-svn: 91262
2009-12-14 04:26:45 +00:00
Douglas Gregor 9291ab6d80 Don't expand tabs when computing the offset from the code-completion column
llvm-svn: 90881
2009-12-08 21:45:46 +00:00
Steve Naroff 04bc01833e Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=80043

llvm-svn: 90860
2009-12-08 16:38:12 +00:00
Eli Friedman be6f4cffca Get rid of some diagnostics that don't follow our rules for -pedantic
diagnostics (specifically, that any extension in a compiler-reserved namespace
shouldn't trigger a diagnostic).

llvm-svn: 90826
2009-12-08 02:22:26 +00:00
Daniel Dunbar 58ecb2ab51 Unbreak and add test case for r90276, a situation in which getBuffer is expected to fail.
Also, update SourceManager.h doxyments for getBuffer() to reflect reality.

llvm-svn: 90701
2009-12-06 09:19:25 +00:00
Daniel Dunbar 1776679e71 Change Preprocessor::EnterSourceFile to make ErrorStr non-optional, clients should be forced to deal with error conditions.
llvm-svn: 90700
2009-12-06 09:19:12 +00:00
Chris Lattner 6aab73137a minor tidy.
llvm-svn: 90543
2009-12-04 06:14:03 +00:00
Douglas Gregor 5f49883488 Minor cleanup to the code-completion-point logic suggested by Chris.
llvm-svn: 90459
2009-12-03 17:05:59 +00:00
Ted Kremenek 5ef26fb4fd Add 'has_feature(cxx_exceptions)' to allow code to determine via preprocessor logic if C++ exceptions are enabled.
llvm-svn: 90378
2009-12-03 01:34:15 +00:00
Ted Kremenek c3fe01943f Rename has_feature(rtti) to has_feature(cxx_rtti) for clarity.
llvm-svn: 90376
2009-12-03 01:31:28 +00:00
Ted Kremenek 4bc256ec9d Add "has_feature" support for C++ RTTI.
llvm-svn: 90368
2009-12-03 01:02:35 +00:00
Douglas Gregor 53ad6b94b0 Extend the source manager with the ability to override the contents of
files with the contents of an arbitrary memory buffer. Use this new
functionality to drastically clean up the way in which we handle file
truncation for code-completion: all of the truncation/completion logic
is now encapsulated in the preprocessor where it belongs
(<rdar://problem/7434737>).

llvm-svn: 90300
2009-12-02 06:49:09 +00:00
Chris Lattner ed3b360290 pass the reason for failure up from MemoryBuffer and report it
in diagnostics when we fail to open a file.  This allows us to
report things like:

$ clang test.c -I.
test.c:2:10: fatal error: error opening file './foo.h': Permission denied
#include "foo.h"
         ^

llvm-svn: 90276
2009-12-01 22:52:33 +00:00
Chris Lattner 710bb87147 Fix PR5633 by making the preprocessor handle the case where we can
stat a file but where mmaping it fails.  In this case, we emit an
error like:
t.c:1:10: fatal error: error opening file '../../foo.h'

instead of "cannot find file".

llvm-svn: 90110
2009-11-30 04:18:44 +00:00
Nuno Lopes 0e5d13e025 remove stall comment
llvm-svn: 90080
2009-11-29 17:07:16 +00:00
Benjamin Kramer 337e3a5fea Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.
llvm-svn: 90044
2009-11-28 19:45:26 +00:00
Kovarththanan Rajaratnam 930de0aeaf Cleanup llvm/Support/Compiler.h include in header files
llvm-svn: 90040
2009-11-28 16:08:10 +00:00
Nuno Lopes baa1bc44af cleanup parsing of MS integer suffixes a little. this fixes PR5616
btw, I believe that isMicrosoftInteger can go away; it's not read anywhere

llvm-svn: 90036
2009-11-28 13:37:52 +00:00
Benjamin Kramer 5e738284d7 Move DISABLE_INLINE to the front of the decl so MSVC can parse it. Patch by Amine Khaldi!
llvm-svn: 88797
2009-11-14 16:36:57 +00:00
Daniel Dunbar bf410c6fc2 Add static version of Preprocessor::getSpelling.
llvm-svn: 88732
2009-11-14 01:20:48 +00:00
Daniel Dunbar 1b4441915a Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.
llvm-svn: 87087
2009-11-13 05:51:54 +00:00
Daniel Dunbar 1a54e3fbb9 Switch PTHManager to using diagnostics for most errors.
Also, always give errors on a token-cache PTH failure.

llvm-svn: 86939
2009-11-12 02:53:48 +00:00
Douglas Gregor c998409cce Remove an overly-eager assertion when replacing tokens with an
annotation token, because some of the tokens we're annotating might
not be in the set of cached tokens (we could have consumed them
unconditionally).

Also, move the tentative parsing from ParseTemplateTemplateArgument
into the one caller that needs it, improving recovery.

llvm-svn: 86904
2009-11-12 00:03:40 +00:00
Daniel Dunbar 0c6c930f05 Allow Preprocessor to take ownership of the HeaderSearch object. I think it should probably always own the header search object, but I'm not sure...
llvm-svn: 86882
2009-11-11 21:44:21 +00:00
Daniel Dunbar 93097b3906 Add Diagnostic::Report method for reporting diagnostics without a location.
llvm-svn: 86760
2009-11-10 23:55:23 +00:00
Daniel Dunbar 07dcd8b9d8 Make LookUpIdentifierInfo const. This makes the Identifiers table mutable and is
a little fuzzy, but conceptually it's just uniquing the identifier.

Chris, please review. I debated splitting into const/non-const versions where
the const one propogated constness to the resulting IdentifierInfo*.

llvm-svn: 86106
2009-11-05 01:53:52 +00:00
Daniel Dunbar f539bfeb4d StringRefize Preprocessor::getIdentifierInfo.
llvm-svn: 86105
2009-11-05 01:53:39 +00:00
Daniel Dunbar d0ba0e6108 Kill PreprocessorFactory, which was both morally repugnant and totally unused.
llvm-svn: 86076
2009-11-04 23:56:25 +00:00
John Thompson ac0b098d4d Added __has_include and __has_include_next.
llvm-svn: 85834
2009-11-02 22:28:12 +00:00
John Thompson b535352681 Re-arranged some internal functions for coming __has_include changes.
llvm-svn: 85589
2009-10-30 13:49:06 +00:00
Chandler Carruth a3f084ce16 Update location of DataTypes.h to reflect move in LLVM with r85086.
llvm-svn: 85087
2009-10-26 01:37:10 +00:00
Daniel Dunbar 2c422dc9ca Move clients to use IdentifierInfo::getNameStart() instead of getName()
llvm-svn: 84436
2009-10-18 20:26:12 +00:00
Daniel Dunbar f8502d50f7 Switch to llvm::HashString.
llvm-svn: 84375
2009-10-17 23:52:28 +00:00
Douglas Gregor d2eb58abac Add support for a chain of stat caches in the FileManager, rather than
only supporting a single stat cache. The immediate benefit of this
change is that we can now generate a PCH/AST file when including
another PCH file; in the future, the chain of stat caches will likely
be useful with multiple levels of PCH files.

llvm-svn: 84263
2009-10-16 18:18:30 +00:00
Chris Lattner a3d4f16b12 Teach Lexer::MeasureTokenLength to be able to measure the
length of comment tokens.  Patch by Abramo Bagnara!

llvm-svn: 84100
2009-10-14 15:04:18 +00:00
Mike Stump c99c022841 This fixes support for complex literals, reworked to avoid a goto, and
to add a flag noting the presence of a Microsoft extension suffix (i8,
i16, i32, i64).  Patch by John Thompson.

llvm-svn: 83591
2009-10-08 22:55:36 +00:00
Douglas Gregor 01249503fe Installation of Clang libraries and headers, from Axel Naumann!
llvm-svn: 83582
2009-10-08 22:15:31 +00:00
Douglas Gregor ea9b03e6e2 Replace the -code-completion-dump option with
-code-completion-at=filename:line:column

which performs code completion at the specified location by truncating
the file at that position and enabling code completion. This approach
makes it possible to run multiple tests from a single test file, and
gives a more natural command-line interface.

llvm-svn: 82571
2009-09-22 21:11:38 +00:00
Douglas Gregor 3545ff43f4 Refactor and simplify the CodeCompleteConsumer, so that all of the
real work is performed within Sema. Addresses Chris's comments, but
still retains the heavyweight list-of-multimaps data structure.

llvm-svn: 82459
2009-09-21 16:56:56 +00:00
Douglas Gregor 2436e7116b Initial implementation of a code-completion interface in Clang. In
essence, code completion is triggered by a magic "code completion"
token produced by the lexer [*], which the parser recognizes at
certain points in the grammar. The parser then calls into the Action
object with the appropriate CodeCompletionXXX action.

Sema implements the CodeCompletionXXX callbacks by performing minimal
translation, then forwarding them to a CodeCompletionConsumer
subclass, which uses the results of semantic analysis to provide
code-completion results. At present, only a single, "printing" code
completion consumer is available, for regression testing and
debugging. However, the design is meant to permit other
code-completion consumers.

This initial commit contains two code-completion actions: one for
member access, e.g., "x." or "p->", and one for
nested-name-specifiers, e.g., "std::". More code-completion actions
will follow, along with improved gathering of code-completion results
for the various contexts.

[*] In the current -code-completion-dump testing/debugging mode, the
file is truncated at the completion point and EOF is translated into
"code completion".

llvm-svn: 82166
2009-09-17 21:32:03 +00:00
Benjamin Kramer 26ddfee3b2 PR4991: Properly remove trailing newline from __TIMESTAMP__.
Replace strcpy with memcpy while at it.

llvm-svn: 82043
2009-09-16 13:10:04 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
David Chisnall 5778fce141 Updated GNU runtime non-fragile ABI.
Added -fconstant-string-class= option.
Added __has_feature() test for non-fragile ABI.

llvm-svn: 80591
2009-08-31 16:41:57 +00:00
Benjamin Kramer 89b422c118 Replace cerr with errs().
llvm-svn: 79854
2009-08-23 12:08:50 +00:00
Douglas Gregor 76d8c5725f Don't install Clang libraries.
llvm-svn: 79824
2009-08-23 05:02:18 +00:00
Erick Tryzelaar b90731117c Update lexer to work with the new APFloat string parsing.
llvm-svn: 79211
2009-08-16 23:36:28 +00:00