Граф коммитов

7423 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner 2b2453a7d8 this massive patch introduces a simple new abstraction: it makes
"FileID" a concept that is now enforced by the compiler's type checker
instead of yet-another-random-unsigned floating around.

This is an important distinction from the "FileID" currently tracked by
SourceLocation.  *That* FileID may refer to the start of a file or to a
chunk within it.  The new FileID *only* refers to the file (and its 
#include stack and eventually #line data), it cannot refer to a chunk.

FileID is a completely opaque datatype to all clients, only SourceManager
is allowed to poke and prod it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 06:22:33 +00:00
Chris Lattner 05816591ec make "ContentCache::Buffer" mutable to avoid a const_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62403 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 03:54:16 +00:00
Chris Lattner 5c263857e2 no need to check this: content cache is already 1-1 map with fileentries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 03:49:48 +00:00
Chris Lattner c6fe32a91c Instead of iterating over FileID's, have PTH generation iterate over the
content cache directly.  Content cache has a 1-1 mapping with fileentries,
whereas multiple FileIDs can be the same FileEntry.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 03:48:08 +00:00
Chris Lattner 5bdf3a81eb remove an irrelevant idea
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 03:46:44 +00:00
Douglas Gregor 8158f69257 Warn about typedefs of enums without any declarator name. Fixes rdar://problem/6503878
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 02:55:50 +00:00
Daniel Dunbar 7d791fd22e ccc: Support running piped jobs (-pipe now works).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 02:02:35 +00:00
Ted Kremenek 72afb3739d Fix analyzer crash found when scanning Wine sources where the analyzer used old logic to determine the value of a switch 'case' label.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 01:54:16 +00:00
Douglas Gregor 69d993ad84 PODify LookupResult, for a measly 1% speedup on Cocoa.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 01:13:24 +00:00
Douglas Gregor 3dfea40c73 Add -fnext-runtime to Objective-C properties testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62390 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 00:53:59 +00:00
Daniel Dunbar 470104edfd ccc: Don't be pedantically compatible with -Z options, these are the
result of an internal implementation detail of gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62389 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 00:53:19 +00:00
Daniel Dunbar c97c05f849 Return success indicator from CmpDriver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62388 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 00:50:45 +00:00
Nuno Lopes 81e51e2c5b add support for usage of cast to union thing with static vars
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 00:48:48 +00:00
Douglas Gregor 0b7a158d12 Teach DeclContext how to find the primary declaration for any TagDecl
even when we are still defining the TagDecl. This is required so that
qualified name lookup of a class name within its definition works (see
the new bits in test/SemaCXX/qualified-id-lookup.cpp).

As part of this, move the nested redefinition checking code into
ActOnTag. This gives us diagnostics earlier (when we try to perform
the nested redefinition, rather than when we try to complete the 2nd
definition) and removes some code duplication.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 00:42:38 +00:00
Fariborz Jahanian 41f2b32df5 Catch a foreach parse error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 00:00:40 +00:00
Sebastian Redl f05b1520d6 Convert some more statement actions to smart pointers.
Fix a type error; parser wanted to pass the third part of a for-statement as a statement; should be expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62380 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 23:28:06 +00:00
Ted Kremenek d4bd97dfdb Updated checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 23:26:38 +00:00
Daniel Dunbar 9471345ae6 ccc: Clean up (user level) error handling.
- ccc now checks for existence of input files (more annoying to test,
   but matches gcc).
 - Fix some test cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 23:12:12 +00:00
Chris Lattner 59ddeabc4c eliminate FullSourceLoc::getLocation() now that FullSourceLoc
*is* the location.  This eliminates some weird X.getLocation().getLocation()'s.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 23:06:35 +00:00
Chris Lattner a50bd54164 Make FullSourceLoc derive from SourceLocation instead of
containing one.  Containment is generally better than derivation,
but in this case FullSourceLoc really 'isa' SourceLocation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62375 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 23:03:56 +00:00
Chris Lattner 4abb87ef14 elimiante FullSourceLoc::getCanonicalFileID
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 22:59:51 +00:00
Chris Lattner 0cf7bb937d remove FullSourceLoc::isFileID
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62371 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 22:53:56 +00:00
Chris Lattner f3e8fcd074 an instantiation loc is always a file loc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 22:53:27 +00:00
Chris Lattner 8402c73dd8 Fix PR2477 - clang misparses "//*" in C89 mode
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 22:39:25 +00:00
Chris Lattner 52a3e9ed65 Make sure to escape " when it occurs in a string in pragma comment
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 22:13:37 +00:00
Daniel Dunbar a22c16dd89 ccc: Fix thinko, add gross but effective test of translation for Darwin/X86/cc1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 21:20:42 +00:00
Daniel Dunbar 105132e722 ccc: Darwin/X86: gcc compatibility, only add
'-feliminate-unused-debug-symbols' in reponse to '-g' (not '-g*').


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 21:07:21 +00:00
Fariborz Jahanian ebff1fed66 Don't ICE (issue diagnostics) when receiver is a non-objc
type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 20:35:09 +00:00
Daniel Dunbar 9c3ea76809 ccc: Darwin/X86: Implement remainder of (non -Z...) generic argument
translation.
 - As is my general strategy, this is initially pedantically
   compatible with gcc and can be cleaned up later. So, for example,
   we still pass -static to collect2 4 times if you say '-mkernel
   -fapple-kext'. ;)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 20:25:36 +00:00
Fariborz Jahanian c55a24095c Don't ICE on user redeclaration of objc's built-in types.
Issue diagnostics instead if types do not match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:58:32 +00:00
Chris Lattner 41c3ae108a As a performance optimization, don't bother calling MacroInfo::isIdenticalTo
if warnings in system headers are disabled.  isIdenticalTo can end up 
calling the expensive getSpelling method, and other bad stuff and is 
completely unneeded if the warning will be discarded anyway. rdar://6502956


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:50:11 +00:00
Chris Lattner 95d58f3ad7 silence release-assert warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:44:00 +00:00
Douglas Gregor 66b947fdf9 Fix <rdar://problem/6502934>. We were creating an ImplicitCastExpr
with reference type (it should be an lvalue with non-reference type).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62345 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:38:23 +00:00
Chris Lattner eab819b41d Random note so I remember how to do this :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:33:59 +00:00
Ted Kremenek e2916d6a7d StringRegion::print: Remove copy/paste code and just call Stmt::printPretty() for the StringLiteral.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:26:50 +00:00
Chris Lattner c7d945d053 Make -E mode propagate #pragma comment's into the output.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:25:54 +00:00
Chris Lattner 9a81c87503 make ast-print handle random non-printable characters correctly with octal escapes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:25:18 +00:00
Fariborz Jahanian 1522bc80df Changed the API yet again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:02:53 +00:00
Chris Lattner 172e336b12 only notify callbacks if they exist.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 19:01:46 +00:00
Chris Lattner a9d9145741 Improve #pragma comment support by building the string argument and
notifying PPCallbacks about it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62333 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 18:59:23 +00:00
Chris Lattner bbee00b645 minor cleanups to StringLiteralParser: no need to pass target info
into its ctor.  Also, make it handle validity checking of pascal
strings instead of making clients do it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62332 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 18:51:42 +00:00
Ted Kremenek 9989065938 Fix PR 3337 [retain/release checker]: Handle FunctionDecl's declared using typedefs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62331 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 18:40:33 +00:00
Douglas Gregor 506ae418eb Part one of handling C++ functional casts. This handles semantic
analysis and AST-building for the cases where we have N != 1
arguments. For N == 1 arguments, we need to finish the C++
implementation of explicit type casts (C++ [expr.cast]).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 18:33:17 +00:00
Fariborz Jahanian ab654afb2d Used a more suitable api to get to the type of a record
in code gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 17:41:13 +00:00
Douglas Gregor 01beed0db7 Add test case for member name lookup
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62324 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 17:06:33 +00:00
Anders Carlsson dce5e2cabf Use a single function for doing vararg argument promotion. Also, make sure to do the promotion before checking the type - fixes PR3340.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 16:48:51 +00:00
Chris Lattner 636c5ef657 Implement basic support for parsing #pragma comment, a microsoft extension
documented here:
http://msdn.microsoft.com/en-us/library/7f0aews7(VS.80).aspx

This is according to my understanding reading the docs, I don't know if it
really agrees fully with what VC++ allows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62317 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 08:21:25 +00:00
Chris Lattner f7cf85b330 more SourceLocation lexicon change: instead of referring to the
"logical" location, refer to the "instantiation" location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 07:36:28 +00:00
Chris Lattner 88054dee04 rename "virtual location" of a macro to "instantiation location".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 07:15:35 +00:00
Chris Lattner 0c21e84b82 rename PP::getPhysicalCharacterAt -> PP::getSpelledCharacterAt.
Slightly speed up sema of numbers like '1' by going directly to 
TargetInfo instead of through ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 07:10:29 +00:00