]> granicus.if.org Git - clang/log
clang
15 years agoeliminate FullSourceLoc::getLocation() now that FullSourceLoc
Chris Lattner [Fri, 16 Jan 2009 23:06:35 +0000 (23:06 +0000)]
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

15 years agoMake FullSourceLoc derive from SourceLocation instead of
Chris Lattner [Fri, 16 Jan 2009 23:03:56 +0000 (23:03 +0000)]
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

15 years agoelimiante FullSourceLoc::getCanonicalFileID
Chris Lattner [Fri, 16 Jan 2009 22:59:51 +0000 (22:59 +0000)]
elimiante FullSourceLoc::getCanonicalFileID

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

15 years agoremove FullSourceLoc::isFileID
Chris Lattner [Fri, 16 Jan 2009 22:53:56 +0000 (22:53 +0000)]
remove FullSourceLoc::isFileID

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

15 years agoan instantiation loc is always a file loc.
Chris Lattner [Fri, 16 Jan 2009 22:53:27 +0000 (22:53 +0000)]
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

15 years agoFix PR2477 - clang misparses "//*" in C89 mode
Chris Lattner [Fri, 16 Jan 2009 22:39:25 +0000 (22:39 +0000)]
Fix PR2477 - clang misparses "//*" in C89 mode

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

15 years agoMake sure to escape " when it occurs in a string in pragma comment
Chris Lattner [Fri, 16 Jan 2009 22:13:37 +0000 (22:13 +0000)]
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

15 years agoccc: Fix thinko, add gross but effective test of translation for Darwin/X86/cc1.
Daniel Dunbar [Fri, 16 Jan 2009 21:20:42 +0000 (21:20 +0000)]
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

15 years agoccc: Darwin/X86: gcc compatibility, only add
Daniel Dunbar [Fri, 16 Jan 2009 21:07:21 +0000 (21:07 +0000)]
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

15 years agoDon't ICE (issue diagnostics) when receiver is a non-objc
Fariborz Jahanian [Fri, 16 Jan 2009 20:35:09 +0000 (20:35 +0000)]
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

15 years agoccc: Darwin/X86: Implement remainder of (non -Z...) generic argument
Daniel Dunbar [Fri, 16 Jan 2009 20:25:36 +0000 (20:25 +0000)]
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

15 years agoDon't ICE on user redeclaration of objc's built-in types.
Fariborz Jahanian [Fri, 16 Jan 2009 19:58:32 +0000 (19:58 +0000)]
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

15 years agoAs a performance optimization, don't bother calling MacroInfo::isIdenticalTo
Chris Lattner [Fri, 16 Jan 2009 19:50:11 +0000 (19:50 +0000)]
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

15 years agosilence release-assert warning.
Chris Lattner [Fri, 16 Jan 2009 19:44:00 +0000 (19:44 +0000)]
silence release-assert warning.

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

15 years agoFix <rdar://problem/6502934>. We were creating an ImplicitCastExpr
Douglas Gregor [Fri, 16 Jan 2009 19:38:23 +0000 (19:38 +0000)]
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

15 years agoRandom note so I remember how to do this :)
Chris Lattner [Fri, 16 Jan 2009 19:33:59 +0000 (19:33 +0000)]
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

15 years agoStringRegion::print: Remove copy/paste code and just call Stmt::printPretty() for...
Ted Kremenek [Fri, 16 Jan 2009 19:26:50 +0000 (19:26 +0000)]
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

15 years agoMake -E mode propagate #pragma comment's into the output.
Chris Lattner [Fri, 16 Jan 2009 19:25:54 +0000 (19:25 +0000)]
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

15 years agomake ast-print handle random non-printable characters correctly with octal escapes.
Chris Lattner [Fri, 16 Jan 2009 19:25:18 +0000 (19:25 +0000)]
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

15 years agoChanged the API yet again.
Fariborz Jahanian [Fri, 16 Jan 2009 19:02:53 +0000 (19:02 +0000)]
Changed the API yet again.

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

15 years agoonly notify callbacks if they exist.
Chris Lattner [Fri, 16 Jan 2009 19:01:46 +0000 (19:01 +0000)]
only notify callbacks if they exist.

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

15 years agoImprove #pragma comment support by building the string argument and
Chris Lattner [Fri, 16 Jan 2009 18:59:23 +0000 (18:59 +0000)]
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

15 years agominor cleanups to StringLiteralParser: no need to pass target info
Chris Lattner [Fri, 16 Jan 2009 18:51:42 +0000 (18:51 +0000)]
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

15 years agoFix PR 3337 [retain/release checker]: Handle FunctionDecl's declared using typedefs.
Ted Kremenek [Fri, 16 Jan 2009 18:40:33 +0000 (18:40 +0000)]
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

15 years agoPart one of handling C++ functional casts. This handles semantic
Douglas Gregor [Fri, 16 Jan 2009 18:33:17 +0000 (18:33 +0000)]
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

15 years agoUsed a more suitable api to get to the type of a record
Fariborz Jahanian [Fri, 16 Jan 2009 17:41:13 +0000 (17:41 +0000)]
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

15 years agoAdd test case for member name lookup
Douglas Gregor [Fri, 16 Jan 2009 17:06:33 +0000 (17:06 +0000)]
Add test case for member name lookup

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

15 years agoUse a single function for doing vararg argument promotion. Also, make sure to do...
Anders Carlsson [Fri, 16 Jan 2009 16:48:51 +0000 (16:48 +0000)]
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

15 years agoImplement basic support for parsing #pragma comment, a microsoft extension
Chris Lattner [Fri, 16 Jan 2009 08:21:25 +0000 (08:21 +0000)]
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

15 years agomore SourceLocation lexicon change: instead of referring to the
Chris Lattner [Fri, 16 Jan 2009 07:36:28 +0000 (07:36 +0000)]
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

15 years agorename "virtual location" of a macro to "instantiation location".
Chris Lattner [Fri, 16 Jan 2009 07:15:35 +0000 (07:15 +0000)]
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

15 years agorename PP::getPhysicalCharacterAt -> PP::getSpelledCharacterAt.
Chris Lattner [Fri, 16 Jan 2009 07:10:29 +0000 (07:10 +0000)]
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

15 years agoremove obsolete comment which happened to go over 80 cols.
Chris Lattner [Fri, 16 Jan 2009 07:04:11 +0000 (07:04 +0000)]
remove obsolete comment which happened to go over 80 cols.

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

15 years agoremove an unneeded const_cast.
Chris Lattner [Fri, 16 Jan 2009 07:02:14 +0000 (07:02 +0000)]
remove an unneeded const_cast.

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

15 years agoupdate for terminology change.
Chris Lattner [Fri, 16 Jan 2009 07:00:50 +0000 (07:00 +0000)]
update for terminology change.

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

15 years agoChange some terminology in SourceLocation: instead of referring to
Chris Lattner [Fri, 16 Jan 2009 07:00:02 +0000 (07:00 +0000)]
Change some terminology in SourceLocation: instead of referring to
the "physical" location of tokens, refer to the "spelling" location.
This is more concrete and useful, tokens aren't really physical objects!

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

15 years agoDon't advance the statement iterator after we've deallocated the statement
Douglas Gregor [Fri, 16 Jan 2009 06:50:08 +0000 (06:50 +0000)]
Don't advance the statement iterator after we've deallocated the statement

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

15 years agoExtract code dealing with typedef declarators into a separate function.
Zhongxing Xu [Fri, 16 Jan 2009 03:34:13 +0000 (03:34 +0000)]
Extract code dealing with typedef declarators into a separate function.

No functionality change.

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

15 years agoAdd test for contextual conversion to bool, and enable some FIXME'd tests
Douglas Gregor [Fri, 16 Jan 2009 03:02:29 +0000 (03:02 +0000)]
Add test for contextual conversion to bool, and enable some FIXME'd tests

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

15 years agoExtract code dealing with variable declarator into a separate function.
Zhongxing Xu [Fri, 16 Jan 2009 02:36:34 +0000 (02:36 +0000)]
Extract code dealing with variable declarator into a separate function.

No functionality change.

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

15 years agoAttempt to unbreak Windows build.
Daniel Dunbar [Fri, 16 Jan 2009 01:50:29 +0000 (01:50 +0000)]
Attempt to unbreak Windows build.

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

15 years agopostpone sizeof objc-class computatin to the clients.
Fariborz Jahanian [Fri, 16 Jan 2009 01:42:12 +0000 (01:42 +0000)]
postpone sizeof objc-class computatin to the clients.

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

15 years agoExtract code dealing with declarators of function type into a separate function
Zhongxing Xu [Fri, 16 Jan 2009 01:13:29 +0000 (01:13 +0000)]
Extract code dealing with declarators of function type into a separate function
Sema::ActOnFunctionDeclarator().
No functionality change.

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

15 years agoImplemented code gen for sizeof(objc class interface).
Fariborz Jahanian [Fri, 16 Jan 2009 00:57:08 +0000 (00:57 +0000)]
Implemented code gen for sizeof(objc class interface).

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

15 years agoImprove diagnostics for ambiguous name lookup results
Douglas Gregor [Fri, 16 Jan 2009 00:38:09 +0000 (00:38 +0000)]
Improve diagnostics for ambiguous name lookup results

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

15 years agoadd codegen support to union casts
Nuno Lopes [Thu, 15 Jan 2009 20:14:33 +0000 (20:14 +0000)]
add codegen support to union casts
init of static vars still not working. I'll get back to it tomorrow or so

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

15 years agoPTH: Fix termination condition in binary search.
Ted Kremenek [Thu, 15 Jan 2009 19:28:38 +0000 (19:28 +0000)]
PTH: Fix termination condition in binary search.

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

15 years agoPR3330: given an enum like this:
Chris Lattner [Thu, 15 Jan 2009 19:19:42 +0000 (19:19 +0000)]
PR3330: given an enum like this:

enum E {
 A = 1U,
 B
};

Don't make an implicit cast expr of null for B.

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

15 years agoIdentifierInfo:
Ted Kremenek [Thu, 15 Jan 2009 18:47:46 +0000 (18:47 +0000)]
IdentifierInfo:
- IdentifierInfo can now (optionally) have its string data not be
  co-located with itself.  This is for use with PTH.  This aspect is a
  little gross, as getName() and getLength() now make assumptions
  about a possible alternate representation of IdentifierInfo.
  Perhaps we should make IdentifierInfo have virtual methods?

IdentifierTable:
- Added class "IdentifierInfoLookup" that can be used by
  IdentifierTable to perform "string -> IdentifierInfo" lookups using
  an auxilliary data structure.  This is used by PTH.
- Perform tests show that IdentifierTable::get() does not slow down
  because of the extra check for the IdentiferInfoLookup object (the
  regular StringMap lookup does enough work to mitigate the impact of
  an extra null pointer check).
- The upshot is that now that some IdentifierInfo objects might be
  owned by the IdentiferInfoLookup object.  This should be reviewed.

PTH:
- Modified PTHManager::GetIdentifierInfo to *not* insert entries in
  IdentifierTable's string map, and instead create IdentifierInfo
  objects on the fly when mapping from persistent IDs to
  IdentifierInfos.  This saves a ton of work with string copies,
  hashing, and StringMap lookup and resizing.  This change was
  motivated because when processing source files in the PTH cache we
  don't need to do any string -> IdentifierInfo lookups.
- PTHManager now subclasses IdentifierInfoLookup, allowing clients of
  IdentifierTable to transparently use IdentifierInfo objects managed
  by the PTH file.  PTHManager resolves "string -> IdentifierInfo"
  queries by doing a binary search over a sorted table of identifier
  strings in the PTH file (the exact algorithm we use can be changed
  as needed).

These changes lead to the following performance changes when using PTH on Cocoa.h:
- fsyntax-only: 10% performance improvement
- Eonly: 30% performance improvement

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

15 years agoFix some unused variable, control reaches end of non-void function,
Daniel Dunbar [Thu, 15 Jan 2009 18:32:35 +0000 (18:32 +0000)]
Fix some unused variable, control reaches end of non-void function,
and uninitialized use options.

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

15 years agoAdd dummy X86_64 ABIInfo implementation.
Daniel Dunbar [Thu, 15 Jan 2009 18:18:40 +0000 (18:18 +0000)]
Add dummy X86_64 ABIInfo implementation.

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

15 years agoadd support for initializing static vars with a cast to union (gcc extension)
Nuno Lopes [Thu, 15 Jan 2009 16:44:45 +0000 (16:44 +0000)]
add support for initializing static vars with a cast to union (gcc extension)

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

15 years agoPR2746: Implement GCC cast to union extension
Seo Sanghyeon [Thu, 15 Jan 2009 04:51:39 +0000 (04:51 +0000)]
PR2746: Implement GCC cast to union extension

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

15 years agoAdd utils/ABITest, my ABI test generation tool.
Daniel Dunbar [Thu, 15 Jan 2009 04:24:17 +0000 (04:24 +0000)]
Add utils/ABITest, my ABI test generation tool.
 - Mostly written as an entertaining exercise in enumerating large or
   (countably, naturally) infinite sets. But hey, its useful too!

 - Idea is to number all C-types so that the N-th type can quickly be
   computed, with a good deal of flexibility about what types to
   include, and taking some care so that the (N+1)-th type is
   interestingly different from the N-th type. For example, using the
   default generator, the 1,000,000-th function type is:
--
typedef _Complex int T0;
typedef char T1 __attribute__ ((vector_size (4)));
typedef int T2 __attribute__ ((vector_size (4)));
T2 fn1000000(T0 arg0, signed long long arg1, T1 arg2, T0 arg3);
--
   and the 1,000,001-th type is:
--
typedef _Complex char T0;
typedef _Complex char T2;
typedef struct T1 { T2 field0; T2 field1; T2 field2; } T1;
typedef struct T3 {  } T3;
unsigned short fn1000001(T0 arg0, T1 arg1, T3 arg2);
--

   Computing the 10^1600-th type takes a little less than 1s. :)

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

15 years agoDeallocate the BasePaths structure that we allocate for LookupResult.
Douglas Gregor [Thu, 15 Jan 2009 02:19:31 +0000 (02:19 +0000)]
Deallocate the BasePaths structure that we allocate for LookupResult.

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

15 years agoPTH: Embed a persistentID side-table in the PTH file that is sorted in the
Ted Kremenek [Thu, 15 Jan 2009 01:26:25 +0000 (01:26 +0000)]
PTH: Embed a persistentID side-table in the PTH file that is sorted in the
lexical order of the corresponding identifier strings. This will be used for a
forthcoming optimization. This slows down PTH generation time by 7%. We can
revert this change if the optimization proves to not be valuable.

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

15 years agoInitial implementation of member name lookup
Douglas Gregor [Thu, 15 Jan 2009 00:26:24 +0000 (00:26 +0000)]
Initial implementation of member name lookup

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

15 years agoccc: Implement support clang PTH using gcc PCH style interface.
Daniel Dunbar [Wed, 14 Jan 2009 23:26:40 +0000 (23:26 +0000)]
ccc: Implement support clang PTH using gcc PCH style interface.

This requires some hackery, as gcc's PCH mechanism changes behavior,
whereas while PTH is simply a cache. Notably:

 - Automatically cause clang to load a .pth file if we find one that
   matches a command line -include argument (similar to how gcc
   looks for .gch files).

 - When generating precompiled headers, translate the suffix from .gch
   to .pth (so we do not conflict with actual gcc PCH files).

 - When generating precompiled headers, copy the input header to the
   same location as the output PTH file. This is necessary because gcc
   supports -include xxx.h even if xxx.h doesn't exist, but for clang
   we need to actually have the contents of this file available.

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

15 years agoRefactor name lookup.
Douglas Gregor [Wed, 14 Jan 2009 22:20:51 +0000 (22:20 +0000)]
Refactor name lookup.

This change refactors and cleans up our handling of name lookup with
LookupDecl. There are several aspects to this refactoring:

  - The criteria for name lookup is now encapsulated into the class
  LookupCriteria, which replaces the hideous set of boolean values
  that LookupDecl currently has.

  - The results of name lookup are returned in a new class
  LookupResult, which can lazily build OverloadedFunctionDecls for
  overloaded function sets (and, eventually, eliminate the need to
  allocate member for OverloadedFunctionDecls) and contains a
  placeholder for handling ambiguous name lookup (for C++).

  - The primary entry points for name lookup are now LookupName (for
    unqualified name lookup) and LookupQualifiedName (for qualified
    name lookup). There is also a convenience function
    LookupParsedName that handles qualified/unqualified name lookup
    when given a scope specifier. Together, these routines are meant
    to gradually replace the kludgy LookupDecl, but this won't happen
    until after we have base class lookup (which forces us to cope
    with ambiguities).

  - Documented the heck out of name lookup. Experimenting a little
    with using Doxygen's member groups to make some sense of the Sema
    class. Feedback welcome!

  - Fixes some lingering issues with name lookup for
  nested-name-specifiers, which now goes through
  LookupName/LookupQualifiedName.

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

15 years agoCmpDriver: Allow over-ride of drivers to compare through env variables
Daniel Dunbar [Wed, 14 Jan 2009 20:06:04 +0000 (20:06 +0000)]
CmpDriver: Allow over-ride of drivers to compare through env variables
(DRIVER_[AB]).

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

15 years agoccc: Finish main clang compiler argument translation.
Daniel Dunbar [Wed, 14 Jan 2009 19:42:31 +0000 (19:42 +0000)]
ccc: Finish main clang compiler argument translation.
 - Still missing some odds and ends like -M.

 - Also, we still need to do some translation and forwarding of
   codegen options.

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

15 years agoPatch to keep clang honest that it does not yet support
Fariborz Jahanian [Wed, 14 Jan 2009 19:39:53 +0000 (19:39 +0000)]
Patch to keep clang honest that it does not yet support
explicit return type on block literals.

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

15 years agoFix typo and spelling of -Wunused-macros.
Daniel Dunbar [Wed, 14 Jan 2009 18:56:36 +0000 (18:56 +0000)]
Fix typo and spelling of -Wunused-macros.

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

15 years agoTest explicit constructor
Douglas Gregor [Wed, 14 Jan 2009 18:02:48 +0000 (18:02 +0000)]
Test explicit constructor

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

15 years agoIntroduce support for C++0x explicit conversion operators (N2437)
Douglas Gregor [Wed, 14 Jan 2009 15:45:31 +0000 (15:45 +0000)]
Introduce support for C++0x explicit conversion operators (N2437)

Small cleanup in the handling of user-defined conversions.

Also, implement an optimization when constructing a call. We avoid
recomputing implicit conversion sequences and instead use those
conversion sequences that we computed as part of overload resolution.

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

15 years agoAdd a FIXME.
Steve Naroff [Wed, 14 Jan 2009 07:06:32 +0000 (07:06 +0000)]
Add a FIXME.

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

15 years agoccc: Darwin/Compiler: Improve gcc compat in use of -auxbase-strip.
Daniel Dunbar [Wed, 14 Jan 2009 03:31:16 +0000 (03:31 +0000)]
ccc: Darwin/Compiler: Improve gcc compat in use of -auxbase-strip.

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

15 years agoccc: Implement argument translation for clang.
Daniel Dunbar [Wed, 14 Jan 2009 01:50:15 +0000 (01:50 +0000)]
ccc: Implement argument translation for clang.
 - This is what ccc (old) currently handles.

 - Clang accepts some more things that aren't getting forwarded...

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

15 years agoccc: Add hello.{cpp,m} tests.
Daniel Dunbar [Wed, 14 Jan 2009 01:34:13 +0000 (01:34 +0000)]
ccc: Add hello.{cpp,m} tests.
 - hello.cpp is XFAIL pending g++ emulation.

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

15 years agoccc: Add -ccc-echo special option, and support pulling CCC_CLANG,
Daniel Dunbar [Wed, 14 Jan 2009 01:32:05 +0000 (01:32 +0000)]
ccc: Add -ccc-echo special option, and support pulling CCC_CLANG,
CCC_ECHO, and CCC_FALLBACK from environment as ccc (old) did.

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

15 years agoccc: Use Clang/Compile for Objective-C files as well.
Daniel Dunbar [Wed, 14 Jan 2009 01:30:55 +0000 (01:30 +0000)]
ccc: Use Clang/Compile for Objective-C files as well.

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

15 years agoFix a subtle bug in DeclContext::DestroyDecls().
Steve Naroff [Wed, 14 Jan 2009 01:27:31 +0000 (01:27 +0000)]
Fix a subtle bug in DeclContext::DestroyDecls().

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

15 years agoccc: Add dummy Clang/Compile tool and use on Darwin/X86 for C files.
Daniel Dunbar [Wed, 14 Jan 2009 01:03:36 +0000 (01:03 +0000)]
ccc: Add dummy Clang/Compile tool and use on Darwin/X86 for C files.

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

15 years agoFunctionDecl::setParams() now uses the allocator associated with ASTContext to alloca...
Ted Kremenek [Wed, 14 Jan 2009 00:42:25 +0000 (00:42 +0000)]
FunctionDecl::setParams() now uses the allocator associated with ASTContext to allocate the array of ParmVarDecl*'s.

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

15 years agoccc: Darwin/Compile: Define __private_extern__ when building c++.
Daniel Dunbar [Wed, 14 Jan 2009 00:06:14 +0000 (00:06 +0000)]
ccc: Darwin/Compile: Define __private_extern__ when building c++.

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

15 years agoImplemenent objective-c's NSObject attribute as a way of ddeclaraing c-type
Fariborz Jahanian [Tue, 13 Jan 2009 23:34:40 +0000 (23:34 +0000)]
Implemenent objective-c's NSObject attribute as a way of ddeclaraing c-type
objects as an objective-c object.

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

15 years agoPTH:
Ted Kremenek [Tue, 13 Jan 2009 23:19:12 +0000 (23:19 +0000)]
PTH:
- Use canonical FileID when using getSpelling() caching.  This
  addresses some cache misses we were seeing with -fsyntax-only on
  Cocoa.h
- Added Preprocessor::getPhysicalCharacterAt() utility method for
  clients to grab the first character at a specified sourcelocation.
  This uses the PTH spelling cache.
- Modified Sema::ActOnNumericConstant() to use
  Preprocessor::getPhysicalCharacterAt() instead of
  SourceManager::getCharacterData() (to get PTH hits).

These changes cause -fsyntax-only to not page in any sources from
Cocoa.h.  We see a speedup of 27%.

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

15 years agoPermitting typedefs without a name is a Microsoft/GNU extension
Douglas Gregor [Tue, 13 Jan 2009 23:10:51 +0000 (23:10 +0000)]
Permitting typedefs without a name is a Microsoft/GNU extension

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

15 years agoFix corner cases in PTH getSpelling() binary search.
Ted Kremenek [Tue, 13 Jan 2009 22:16:45 +0000 (22:16 +0000)]
Fix corner cases in PTH getSpelling() binary search.

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

15 years agoPTH: Fix remaining cases where the spelling cache in the PTH file was being missed...
Ted Kremenek [Tue, 13 Jan 2009 22:05:50 +0000 (22:05 +0000)]
PTH: Fix remaining cases where the spelling cache in the PTH file was being missed when it shouldn't.  This shaves another 7% off PTH time for -Eonly on Cocoa.h

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

15 years agoccc: Fix a test case.
Daniel Dunbar [Tue, 13 Jan 2009 21:11:28 +0000 (21:11 +0000)]
ccc: Fix a test case.

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

15 years agouse a slightly more sensible position for an array ref's "getExprLoc"
Chris Lattner [Tue, 13 Jan 2009 21:11:15 +0000 (21:11 +0000)]
use a slightly more sensible position for an array ref's "getExprLoc"

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

15 years agoccc: Darwin: Implement some important general argument translations
Daniel Dunbar [Tue, 13 Jan 2009 21:07:43 +0000 (21:07 +0000)]
ccc: Darwin: Implement some important general argument translations
for the Darwin tool chain.
 - Ideally we would localize these to tool specific argument
   processing but for now this matches gcc closely.

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

15 years agoTurn off some Destroy calls that are currenly causing double-destruction of ScopedDec...
Douglas Gregor [Tue, 13 Jan 2009 19:47:12 +0000 (19:47 +0000)]
Turn off some Destroy calls that are currenly causing double-destruction of ScopedDecls. We will re-enable this later, when we have time to fully solve the ownership issue.

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

15 years agoccc: Allow internal tool chain specific argument translation.
Daniel Dunbar [Tue, 13 Jan 2009 18:51:26 +0000 (18:51 +0000)]
ccc: Allow internal tool chain specific argument translation.
 - Pulled -Xarch processing into this.

 - Get rid of manual creation of forwarding arg array.

 - Use Darwin/CC1 instead of generic GCC cc1 on X86.

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

15 years agoUse the unqualified type for GCCs struct/union cast extension
Anders Carlsson [Tue, 13 Jan 2009 17:00:51 +0000 (17:00 +0000)]
Use the unqualified type for GCCs struct/union cast extension

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

15 years agoDeclContext::KindTrait was not meant to be used outside of DeclContext::CastTo (cause...
Argyrios Kyrtzidis [Tue, 13 Jan 2009 13:11:58 +0000 (13:11 +0000)]
DeclContext::KindTrait was not meant to be used outside of DeclContext::CastTo (causes compilation error on MSVC).
Add DeclContext::getDeclKind() and use that instead of DeclContext::KindTrait.

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

15 years agoccc: Bug fix, '-f...' should be part of the '-f' group.
Daniel Dunbar [Tue, 13 Jan 2009 07:39:45 +0000 (07:39 +0000)]
ccc: Bug fix, '-f...' should be part of the '-f' group.

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

15 years agoAdd simple tool for comparing drivers (hardcoded to gcc and xcc) which
Daniel Dunbar [Tue, 13 Jan 2009 07:38:29 +0000 (07:38 +0000)]
Add simple tool for comparing drivers (hardcoded to gcc and xcc) which
support -###.

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

15 years agoccc: Darwin/Link also runs dsymutil in one very particular situation.
Daniel Dunbar [Tue, 13 Jan 2009 06:44:28 +0000 (06:44 +0000)]
ccc: Darwin/Link also runs dsymutil in one very particular situation.

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

15 years agoPrint function parameters in DeclContextPrinter.
Zhongxing Xu [Tue, 13 Jan 2009 06:25:33 +0000 (06:25 +0000)]
Print function parameters in DeclContextPrinter.

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

15 years agoccc: Bug fix and gcc compatibility tweak.
Daniel Dunbar [Tue, 13 Jan 2009 06:25:31 +0000 (06:25 +0000)]
ccc: Bug fix and gcc compatibility tweak.

 - --gstabs only goes to Darwin/Assembler when dealing with an
     assembly file from the command line.

 - Relative placement of -o option for cc1 moves depending on
   -fsyntax-only/-S, how quaint.

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

15 years agoccc: Add option groups.
Daniel Dunbar [Tue, 13 Jan 2009 05:54:38 +0000 (05:54 +0000)]
ccc: Add option groups.
 - Simple mechanism for group together sets of options so the driver
   can efficiently deal with them as a group (i.e., for forwarding -i*
   to cc1).

 - Use to finish off the major missing pieces of Darwin/CC1 support.

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

15 years agoWarn when someone tries to pass a variable with a non-POD type to a varargs function...
Anders Carlsson [Tue, 13 Jan 2009 05:48:52 +0000 (05:48 +0000)]
Warn when someone tries to pass a variable with a non-POD type to a varargs function/method/block.

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

15 years agoFix argument-passing bugs in a call to object
Douglas Gregor [Tue, 13 Jan 2009 05:10:00 +0000 (05:10 +0000)]
Fix argument-passing bugs in a call to object

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

15 years agoccc: Darwin/CC1: Hardcode (for now) some -m options to match gcc.
Daniel Dunbar [Tue, 13 Jan 2009 04:51:51 +0000 (04:51 +0000)]
ccc: Darwin/CC1: Hardcode (for now) some -m options to match gcc.

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

15 years agoccc: Allow host to over-ride default arch based on command line
Daniel Dunbar [Tue, 13 Jan 2009 04:05:40 +0000 (04:05 +0000)]
ccc: Allow host to over-ride default arch based on command line
arguments (e.g., -m32 and -m64).

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

15 years agoImprove c++ methods printing in DeclContextPrinter.
Zhongxing Xu [Tue, 13 Jan 2009 03:26:38 +0000 (03:26 +0000)]
Improve c++ methods printing in DeclContextPrinter.

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

15 years agoadd a fixme.
Zhongxing Xu [Tue, 13 Jan 2009 03:07:41 +0000 (03:07 +0000)]
add a fixme.

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

15 years agoImprove DeclContextPrinter: print enum name.
Zhongxing Xu [Tue, 13 Jan 2009 02:41:08 +0000 (02:41 +0000)]
Improve DeclContextPrinter: print enum name.

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