aboutsummaryrefslogtreecommitdiff
path: root/Lex
AgeCommit message (Collapse)Author
2008-03-15Make a major restructuring of the clang tree: introduce a top-levelChris Lattner
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-14Make the preprocessor own its PPCallbacks, fixing a memory leak.Chris Lattner
Patch by Sam Bishop! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10Add some missing #includes for GCC mainline, patch by Shantonu Sen!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48153 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10add comments about some simple optimizations that may become Chris Lattner
more important if this api gets wider use. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48131 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10implement simple support for arbitrary token lookahead. Change the Chris Lattner
objc @try parser to use it, fixing a FIXME. Update the objc-try-catch-1.m file to pass now that we get more reasonable errors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48129 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09improve comment.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48083 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09move PP::LookupFile from PPLexerChange -> PPDirectives.cppChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48082 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09Move a bunch more code out of Preprocessor.cpp into PPLexerChange.cppChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48080 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09split macro expansion support out of Preprocessor.cpp into PPMacroExpansion.cppChris Lattner
Rename Directives.cpp -> PPDirectives.cpp since it implements part of the Preprocessor class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48078 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09rename HandleEndOfMacro -> HandleEndOfTokenLexerChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48076 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09split the MacroArgs class out of TokenLexer.cpp/h intoChris Lattner
MacroArgs.cpp/h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48075 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09rename some MacroExpander-related ivars to TokenLexer.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48073 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09Rename MacroExpander.cpp/h -> TokenLexer.cpp/hChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48072 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09rename the MacroExpander class to TokenLexer. It handles bothChris Lattner
token streams and macro lexing, so a more generic name is useful. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48071 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09rename MacroTokens -> Tokens. When this is a token stream, there is no macroChris Lattner
involved. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48070 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09split preprocesor directive handling out of Preprocessor.cpp into Directives.cppChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48068 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05remove the source location arguments to various target query methods.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47954 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05Remove the first layer of support for "portability" warnings. This is Chris Lattner
theoretically useful, but not useful in practice. It adds a bunch of complexity, and not much value. It's best to nuke it. One big advantage is that it means the target interfaces will soon lose their SLoc arguments and target queries can never emit diagnostics anymore (yay). Removing this also simplifies some of the core preprocessor which should make it slightly faster. Ted, I didn't simplify TripleProcessor, which can now have at most one triple, and can probably just be removed. Please poke at it when you have time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25clarify comment, this is undefined behavior in any case, even if it onlyChris Lattner
bits VC++ right now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47565 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Revert an incorrect part of my previuos patch.Lauro Ramos Venancio
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47553 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Fix PR2086.Lauro Ramos Venancio
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47551 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24Fix PR2090, a typo in digraph processing.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24Two more Windows-related fixes:Ted Kremenek
- More enum signeness bitfield fixes (MSVC treats enums as signed). - Fixed in Lex/HeaderSearch.cpp an unsafe copy between two HeaderSearch::PerFileInfo entries in a common vector. The copy involved two calls to getFileInfo() within the assignment; these calls could have side-effects that enlarged the internal vector, and with MSVC this would invalidate one of the values in the assignment. Patch by Argiris Kirtzidis! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47536 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16Fix CheckEndOfDirective to diagnose lines that contain macros that expand to Chris Lattner
zero tokens. This fixes PR2045, thanks to Neil for finding another incredibly subtle corner case :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47203 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Adjust for APInt's isPositive being renamed to isNonNegative.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47091 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-11Move Microsoft __declspec hack from the parser to the preprocessor. Since we ↵Steve Naroff
have no plans to actually implement this construct, it is cleaner to limit the change to the preprocessor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46973 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-10long is 32-bit is on win32.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46935 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07- Add support for fuzzy parsing line-oriented __asm's (yuck).Steve Naroff
- Change handling of __w64 to a built-in macro. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07Minor cleanup from yesterday's -fms-extension commit. Move __int* MS ↵Steve Naroff
keywords to predefined macros. This removes some of the MS-madness from Parser::ParseDeclarationSpecifiers(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46852 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07Implement support for the extremely atrocious MS /##/ extension, Chris Lattner
which pastes together a comment. This is only enabled with -fms-extensions of course. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46845 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07Implement -fms-extensions. This allows us to fuzzy parse non-standard MS ↵Steve Naroff
constructs used in "windows.h". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46838 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01Fix PR1969. stdin has no FileEntry.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Fix a bug where we would incorrectly emit a "cannot paste" error Chris Lattner
message when handling the GNU ", ## __VA_ARGS__" extension. While I'm at it, flag uses of this as extensions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46503 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Change the location we return for the EOF token to actually be on the lastChris Lattner
line of the file, in the common case where a file ends with a newline. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46335 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23add support for -Wundef.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46274 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-22Fix PR1936, a crash on malformed #if. Thanks to Neil forChris Lattner
noticing this! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46256 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14Change uses of std::cerr/std::cout to llvm::Lcerr/llvm::cout, and removeTed Kremenek
#include<iostream>. Patch provided by Sam Bishop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45962 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07Fix a nasty corner case that Neil noticed in PR1900, where we would Chris Lattner
incorrectly apply the multiple include optimization to files with guards like: #if !defined(x) MACRO where MACRO could expand to different things in different contexts. Thanks Neil! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45716 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07Fix typoNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45682 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03simplify the lexer a bit, pulling stuff out of the default case.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45540 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29remove attribution from makefiles.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45412 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29Don't attribute in file headers anymore. See llvmdev for theChris Lattner
discussion of this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20Converted uses of scoped_ptr to OwningPtr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45265 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19Interned MainFileID within SourceManager. Since SourceManager is referenced byTed Kremenek
both Preprocessor and ASTContext, we no longer need to explicitly pass MainFileID around in function calls that also pass either Preprocessor or ASTContext. This resulted in some nice cleanups in the ASTConsumers and the driver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45228 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19Add support for #pragma mark, which shouldn't warn about bogus tokens.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45212 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17implement HeaderMap::LookupFile. I think headermaps are done now. All that is Chris Lattner
left is this crazy thing called "testing". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45124 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17implement enough helper functions to successfully dump out the Chris Lattner
contents of the header map. Look ma, no assumptions about input data here (aka, corrupt header maps can't crash the compiler - crazy thought). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45122 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17simplify some code, using new scoped_ptr support. Fix a bug in the Chris Lattner
cross-endianness case, where we checked the version in the wrong endianness. Amusingly, the GCC logic that detects mixed endianness hmaps and rejects them is dead for this very reason. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17Finish hooking up the scaffolding for headermaps. They can now do everythingChris Lattner
except resolve lookups. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45111 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17Start reading the headermap header, drop the 'errorstr' argument toChris Lattner
the create method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45109 91177308-0d34-0410-b5e6-96231b3b80d8