]> granicus.if.org Git - clang/log
clang
13 years agoMigrate 'Instantiation' data and API bits of SLocEntry to 'Expansion'
Chandler Carruth [Tue, 26 Jul 2011 04:56:51 +0000 (04:56 +0000)]
Migrate 'Instantiation' data and API bits of SLocEntry to 'Expansion'
etc. With this I think essentially all of the SourceManager APIs are
converted. Comments and random other bits of cleanup should be all thats
left.

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

13 years agoConvert InstantiationInfo and much of the related code to ExpansionInfo
Chandler Carruth [Tue, 26 Jul 2011 04:41:47 +0000 (04:41 +0000)]
Convert InstantiationInfo and much of the related code to ExpansionInfo
and various other 'expansion' based terms. I've tried to reformat where
appropriate and catch as many references in comments but I'm going to do
several more passes. Also I've tried to expand parameter names to be
more clear where appropriate.

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

13 years agoRename create(MacroArg)InstantiationLoc to create(MacroArg)ExpansionLoc.
Chandler Carruth [Tue, 26 Jul 2011 03:03:05 +0000 (03:03 +0000)]
Rename create(MacroArg)InstantiationLoc to create(MacroArg)ExpansionLoc.

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

13 years agoRename SourceManager (and InstantiationInfo) isMacroArgInstantiation API
Chandler Carruth [Tue, 26 Jul 2011 03:03:00 +0000 (03:03 +0000)]
Rename SourceManager (and InstantiationInfo) isMacroArgInstantiation API
to isMacroArgExpansion.

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

13 years agoExpand array bounds checking to work in the presence of unary & and *,
Kaelyn Uhrain [Tue, 26 Jul 2011 01:52:28 +0000 (01:52 +0000)]
Expand array bounds checking to work in the presence of unary & and *,
and to work with pointer arithmetic in addition to array indexing.

The new pointer arithmetic porition of the array bounds checking can be
turned on by -Warray-bounds-pointer-arithmetic (and is off by default).

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

13 years agoAssembler really doesn't need to create TargetMachine anymore.
Evan Cheng [Tue, 26 Jul 2011 01:49:26 +0000 (01:49 +0000)]
Assembler really doesn't need to create TargetMachine anymore.

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

13 years agoTest commit
Kaelyn Uhrain [Tue, 26 Jul 2011 01:42:22 +0000 (01:42 +0000)]
Test commit

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

13 years agotest/CodeGen/2003-08-18-SigSetJmp.c: XFAIL: mingw, too!
NAKAMURA Takumi [Tue, 26 Jul 2011 01:40:37 +0000 (01:40 +0000)]
test/CodeGen/2003-08-18-SigSetJmp.c: XFAIL: mingw, too!

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

13 years agowin32 doesn't have sigsetjmp, just xfail this test there.
Eric Christopher [Tue, 26 Jul 2011 01:32:19 +0000 (01:32 +0000)]
win32 doesn't have sigsetjmp, just xfail this test there.

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

13 years agoRework this slightly to work for optimized compilers and remove the
Eric Christopher [Tue, 26 Jul 2011 01:24:10 +0000 (01:24 +0000)]
Rework this slightly to work for optimized compilers and remove the
optimization from the test.

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

13 years agoThese tests use standard headers and so need ms extensions with MSVC headers.
Eric Christopher [Tue, 26 Jul 2011 01:12:27 +0000 (01:12 +0000)]
These tests use standard headers and so need ms extensions with MSVC headers.
Use the driver instead of just clang -cc1.

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

13 years agoRemove this test, it's more properly an optimizer test.
Eric Christopher [Tue, 26 Jul 2011 01:11:20 +0000 (01:11 +0000)]
Remove this test, it's more properly an optimizer test.

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

13 years agoMigrate and FileCheck-ize some of:
Eric Christopher [Tue, 26 Jul 2011 00:57:50 +0000 (00:57 +0000)]
Migrate and FileCheck-ize some of:

2003-09-18-BitfieldTests.c 2007-04-11-PR1321.c 2003-11-13-TypeSafety.c 2003-08-29-StructLayoutBug.c 2010-05-14-Optimized-VarType.c 2003-10-06-NegateExprType.c 2007-06-05-NoInlineAttribute.c 2011-03-31-ArrayRefFolding.c 2010-07-14-ref-off-end.c Atomics-no64bit.c 2007-05-11-str-const.c 2004-11-27-InvalidConstantExpr.c 2007-04-05-UnPackedStruct.c 2004-03-15-SimpleIndirectGoto.c 2004-01-08-ExternInlineRedefine.c sret2.c 2007-02-07-AddrLabel.c 2002-09-19-StarInLabel.c 2003-11-16-StaticArrayInit.c 2003-08-18-SigSetJmp.c 2007-04-24-VolatileStructCopy.c 2002-07-29-Casts.c 2005-06-15-ExpandGotoInternalProblem.c 2007-09-17-WeakRef.c 2007-04-24-str-const.c 2003-08-30-LargeIntegerBitfieldMember.c inline-asm-mrv.c

from llvm/test/FrontendC.

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

13 years agoMigrate over 2009-04-22-UnknownSize.c, 2009-07-17-VoidParameter.c,
Eric Christopher [Tue, 26 Jul 2011 00:47:54 +0000 (00:47 +0000)]
Migrate over 2009-04-22-UnknownSize.c, 2009-07-17-VoidParameter.c,
2009-03-09-WeakDeclarations-1.c, and 2010-05-31-palignr.c from
llvm/test/FrontendC.

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

13 years agoRename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to createMCObje...
Evan Cheng [Tue, 26 Jul 2011 00:42:40 +0000 (00:42 +0000)]
Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to createMCObjectStreamer.

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

13 years agoRename createAsmParser to createMCAsmParser.
Evan Cheng [Tue, 26 Jul 2011 00:24:45 +0000 (00:24 +0000)]
Rename createAsmParser to createMCAsmParser.

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

13 years agoRename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
Evan Cheng [Mon, 25 Jul 2011 23:25:09 +0000 (23:25 +0000)]
Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.

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

13 years agoFix the MSVC build. 2 problems:
Francois Pichet [Mon, 25 Jul 2011 22:00:44 +0000 (22:00 +0000)]
Fix the MSVC build. 2 problems:
   - buildPieces was return a C++ object from inside an extern "C". (MSVC didn't like that)
   - clang_getCursorReferenceNameRange was missing a CINDEX_LINKAGE causing a link error.

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

13 years agoobjective-c: Provide a 'fixit' when class was used
Fariborz Jahanian [Mon, 25 Jul 2011 21:12:27 +0000 (21:12 +0000)]
objective-c: Provide a 'fixit' when class was used
to declare a static object. // rdar://9603056

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

13 years agoRename getInstantiationLineNumber to getExpansionLineNumber in both
Chandler Carruth [Mon, 25 Jul 2011 21:09:52 +0000 (21:09 +0000)]
Rename getInstantiationLineNumber to getExpansionLineNumber in both
SourceManager and FullSourceLoc.

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

13 years agoRepair some indentation I missed in my previous commit.
Chandler Carruth [Mon, 25 Jul 2011 20:59:15 +0000 (20:59 +0000)]
Repair some indentation I missed in my previous commit.

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

13 years agoRename getInstantiationColumnNumber to getExpansionColumnNumber in both
Chandler Carruth [Mon, 25 Jul 2011 20:57:57 +0000 (20:57 +0000)]
Rename getInstantiationColumnNumber to getExpansionColumnNumber in both
SourceManager and FullSourceLoc.

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

13 years agoAssembler doesn't need to initialize TargetMachine's anymore.
Evan Cheng [Mon, 25 Jul 2011 20:53:26 +0000 (20:53 +0000)]
Assembler doesn't need to initialize TargetMachine's anymore.

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

13 years agoRename getDecomposedInstantiationLoc to getDecomposedExpansionLoc.
Chandler Carruth [Mon, 25 Jul 2011 20:52:32 +0000 (20:52 +0000)]
Rename getDecomposedInstantiationLoc to getDecomposedExpansionLoc.

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

13 years agogetInstantiationLocSlowCase -> getExpansionLocSlowCase
Chandler Carruth [Mon, 25 Jul 2011 20:52:26 +0000 (20:52 +0000)]
getInstantiationLocSlowCase -> getExpansionLocSlowCase

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

13 years agoRename SourceManager::getImmediateInstantiationRange to
Chandler Carruth [Mon, 25 Jul 2011 20:52:21 +0000 (20:52 +0000)]
Rename SourceManager::getImmediateInstantiationRange to
getImmediateExpansionRange.

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

13 years agoRefactor of how modules are handled in ASTReader to remove explicit uses of a chain...
Jonathan D. Turner [Mon, 25 Jul 2011 20:32:21 +0000 (20:32 +0000)]
Refactor of how modules are handled in ASTReader to remove explicit uses of a chain of AST files, instead redirect calls through a module manager.  This should help move toward a DAG and the potential of loading multiple, unrelated PCH files.  It's still early in development.

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

13 years agoAllow target to specify about using minimum alignment vs preferred. Takes care of
Chad Rosier [Mon, 25 Jul 2011 19:39:39 +0000 (19:39 +0000)]
Allow target to specify about using minimum alignment vs preferred.  Takes care of
FIXME: Override "preferred align" for double and long long for ARM apcs-gnu ABI.
Also part of rdar://9802874

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

13 years agoPick up expected diagnostics not only in the main file but also in the file where...
Axel Naumann [Mon, 25 Jul 2011 19:18:12 +0000 (19:18 +0000)]
Pick up expected diagnostics not only in the main file but also in the file where the first diagnostic occurred.
Useful if the main file is not relevant (like with cling).
By Vassil Vassilev.

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

13 years agoFix r135934. Rename was intended, but without additional tests for double.
Chad Rosier [Mon, 25 Jul 2011 19:17:48 +0000 (19:17 +0000)]
Fix r135934.  Rename was intended, but without additional tests for double.

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

13 years agoRename an alignment test to be more precise and add another test for the default
Chad Rosier [Mon, 25 Jul 2011 19:00:00 +0000 (19:00 +0000)]
Rename an alignment test to be more precise and add another test for the default
ABI.

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

13 years agoUpdate C++0x status for explicit override controls and explicit
Douglas Gregor [Mon, 25 Jul 2011 18:53:48 +0000 (18:53 +0000)]
Update C++0x status for explicit override controls and explicit
conversion operators, from Jonathan Sauer.

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

13 years agohttp://llvm.org/bugs/show_bug.cgi?id=10472
Howard Hinnant [Mon, 25 Jul 2011 18:09:56 +0000 (18:09 +0000)]
http://llvm.org/bugs/show_bug.cgi?id=10472

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

13 years agoAdded clang_getCursorReferenceNameRange to libclang to to retrieve parts of
Douglas Gregor [Mon, 25 Jul 2011 17:48:11 +0000 (17:48 +0000)]
Added clang_getCursorReferenceNameRange to libclang to to retrieve parts of
a cursor reference, from Erik Verbruggen!

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

13 years agoRename SourceManager::getInstantiationRange to getExpansionRange.
Chandler Carruth [Mon, 25 Jul 2011 16:56:02 +0000 (16:56 +0000)]
Rename SourceManager::getInstantiationRange to getExpansionRange.

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

13 years agoMechanically rename SourceManager::getInstantiationLoc and
Chandler Carruth [Mon, 25 Jul 2011 16:49:02 +0000 (16:49 +0000)]
Mechanically rename SourceManager::getInstantiationLoc and
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part
of the API and documentation update from 'instantiation' as the term for
macros to 'expansion'.

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

13 years agoShorten some expressions by using ArrayRef::slice().
Frits van Bommel [Mon, 25 Jul 2011 15:13:01 +0000 (15:13 +0000)]
Shorten some expressions by using ArrayRef::slice().

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

13 years agowww/get_started.html: Fix a phrase, "in the *build* directory* in the instructions...
NAKAMURA Takumi [Mon, 25 Jul 2011 12:40:26 +0000 (12:40 +0000)]
www/get_started.html: Fix a phrase, "in the *build* directory* in the instructions of Visual Studio. Thanks to Andreas Bittel to point it out.

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

13 years agoadd link to 2010 dev mtg
Chris Lattner [Sun, 24 Jul 2011 21:00:45 +0000 (21:00 +0000)]
add link to 2010 dev mtg

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

13 years agoobjc: clang should warn if redeclaration of methods
Fariborz Jahanian [Sun, 24 Jul 2011 20:53:26 +0000 (20:53 +0000)]
objc: clang should warn if redeclaration of methods
declared in protocol in the class qualified by the
protocol have type conflicts. To reduce amount of
noise, this is done when class is implemented.
// rdar://9352731

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

13 years agolib/AST/CMakeLists.txt: Update LLVM_USED_LIBS, not to miss symbols with building...
NAKAMURA Takumi [Sat, 23 Jul 2011 23:29:47 +0000 (23:29 +0000)]
lib/AST/CMakeLists.txt: Update LLVM_USED_LIBS, not to miss symbols with building shared lib. Thanks to Ryuta Suzuki.

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

13 years agofix PR10415, tidying up IR representation of module level inline asm
Chris Lattner [Sat, 23 Jul 2011 20:04:25 +0000 (20:04 +0000)]
fix PR10415, tidying up IR representation of module level inline asm
to avoid extraneous \n's.

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

13 years agoExtend libclang with clang_equalRanges, from Erik Verbruggen!
Douglas Gregor [Sat, 23 Jul 2011 19:35:14 +0000 (19:35 +0000)]
Extend libclang with clang_equalRanges, from Erik Verbruggen!

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

13 years agoAdd a link-friendly name to the Clang extension acceptance criteria
Douglas Gregor [Sat, 23 Jul 2011 19:22:17 +0000 (19:22 +0000)]
Add a link-friendly name to the Clang extension acceptance criteria

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

13 years agoDocument the criteria for evaluating a proposed extension to Clang.
Douglas Gregor [Sat, 23 Jul 2011 19:21:07 +0000 (19:21 +0000)]
Document the criteria for evaluating a proposed extension to Clang.

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

13 years agoTests for explicit conversion operators, along with a fix to avoid
Douglas Gregor [Sat, 23 Jul 2011 18:59:35 +0000 (18:59 +0000)]
Tests for explicit conversion operators, along with a fix to avoid
considering explicit conversion operators when determining surrogate
functions. Fixes PR10453. Note that there are a few test cases where
Clang is still wrong because it does not implement DR899; see PR10456.

Patch by Jonathan Sauer!

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

13 years agoMove ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon Mulder!
Chris Lattner [Sat, 23 Jul 2011 17:14:25 +0000 (17:14 +0000)]
Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon Mulder!

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

13 years agoUnbreak the MSVC build, using namespace clang is required otherwise MSVC will not...
Francois Pichet [Sat, 23 Jul 2011 11:36:43 +0000 (11:36 +0000)]
Unbreak the MSVC build, using namespace clang is required otherwise MSVC will not find raw_ostream.

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

13 years agoremove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
Chris Lattner [Sat, 23 Jul 2011 10:55:15 +0000 (10:55 +0000)]
remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.

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

13 years agoclean up forward declarations of raw_ostream to use the new LLVM.h
Chris Lattner [Sat, 23 Jul 2011 10:35:09 +0000 (10:35 +0000)]
clean up forward declarations of raw_ostream to use the new LLVM.h
patch by Jon Mulder!

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

13 years agoMigrate 2007-10-01-BuildArrayRef.c from llvm/test/FrontendC.
Eric Christopher [Sat, 23 Jul 2011 02:16:25 +0000 (02:16 +0000)]
Migrate 2007-10-01-BuildArrayRef.c from llvm/test/FrontendC.

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

13 years agoMove TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.
Evan Cheng [Sat, 23 Jul 2011 00:45:53 +0000 (00:45 +0000)]
Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.

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

13 years agoAdd ext_backslash_newline_eof to Wnewline-eof group.
Anna Zaks [Sat, 23 Jul 2011 00:36:52 +0000 (00:36 +0000)]
Add ext_backslash_newline_eof to Wnewline-eof group.

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

13 years agoThis patch (thanks to Doug Gregor) fixes a
Sean Callanan [Fri, 22 Jul 2011 23:46:03 +0000 (23:46 +0000)]
This patch (thanks to Doug Gregor) fixes a
problem where Clang was setting the
hasExternalVisibleDecls() bit for all
DeclContexts it imported.  This caused Clang
to make unnecessary calls to
findExternalVisibleDecls() when an external
AST source was installed.

In fact, Clang sometimes interpreted a failure
by one of these spurious calls to find a
Decl as meaning the Decl didn't exist, even
though findExternalLexicalDecls() did locate
that decl.  This produced amusing errors of
the form:

-
error: no member named 'b' in 'A'; did you
mean 'b'?
-

Now, if hasExternalVisibleDecls() or
hasExternalLexicalDecls() should be set, the
external AST source must do so itself.

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

13 years agoExpose no newline at end of file warning under Wnewline-eof flag.
Anna Zaks [Fri, 22 Jul 2011 23:08:19 +0000 (23:08 +0000)]
Expose no newline at end of file warning under Wnewline-eof flag.

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

13 years agoMatch LLVM API change.
Evan Cheng [Fri, 22 Jul 2011 21:59:11 +0000 (21:59 +0000)]
Match LLVM API change.

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

13 years agokill a FIXME in IsIntegralPromotion
David Majnemer [Fri, 22 Jul 2011 21:09:04 +0000 (21:09 +0000)]
kill a FIXME in IsIntegralPromotion

IsIntegralPromotion should consider the signedness of FromType when
calculating promotions. This, as of now, cannot be exercised on any
platform so there is no corresponding test.

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

13 years agoRemove prepending of '$' to module names.
Jonathan D. Turner [Fri, 22 Jul 2011 17:25:03 +0000 (17:25 +0000)]
Remove prepending of '$' to module names.

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

13 years agoSwitch all of the "isysroot" const char*'s throughout the AST reader
Douglas Gregor [Fri, 22 Jul 2011 16:35:34 +0000 (16:35 +0000)]
Switch all of the "isysroot" const char*'s throughout the AST reader
and writer to StringRef or std::string, as appropriate.

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

13 years agoRename ASTReader::PerFileData to serialization::Module, pulling it out
Douglas Gregor [Fri, 22 Jul 2011 16:00:58 +0000 (16:00 +0000)]
Rename ASTReader::PerFileData to serialization::Module, pulling it out
of ASTReader so it can become its own full-fledged class
(eventually). No functionality change.

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

13 years agoUse -ffreestanding with clang_cc1 to make the test picks the clang builtin include.
Francois Pichet [Fri, 22 Jul 2011 10:49:54 +0000 (10:49 +0000)]
Use -ffreestanding with clang_cc1 to make the test picks the clang builtin include.

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

13 years agoAdd a missing forward declaration and namespace qualifier to this
Chandler Carruth [Fri, 22 Jul 2011 10:16:15 +0000 (10:16 +0000)]
Add a missing forward declaration and namespace qualifier to this
header. This showed up in client code that has a different include
ordering after Chris's shuffle of raw_ostream. All of the Clang code
ends up with a header included before this one that provides the needed
type and using declaration.

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

13 years agoDocument the existing objc_precise_lifetime attribute.
John McCall [Fri, 22 Jul 2011 08:53:00 +0000 (08:53 +0000)]
Document the existing objc_precise_lifetime attribute.
Introduce and document a new objc_returns_inner_pointer
attribute, and consume it by performing a retain+autorelease
on message receivers when they're not immediately loaded from
an object with precise lifetime.

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

13 years agoFix test on MSVC: since the test includes a system header it cannot use clang_cc1.
Francois Pichet [Fri, 22 Jul 2011 08:52:55 +0000 (08:52 +0000)]
Fix test on MSVC: since the test includes a system header it cannot use clang_cc1.

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

13 years agoConvert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use
Jay Foad [Fri, 22 Jul 2011 08:16:57 +0000 (08:16 +0000)]
Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use
ArrayRef.

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

13 years agoBring over a test from llvm/test/FrontendC that is for Sema and not CodeGen.
Eric Christopher [Fri, 22 Jul 2011 07:26:22 +0000 (07:26 +0000)]
Bring over a test from llvm/test/FrontendC that is for Sema and not CodeGen.

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

13 years agofix PR10384: C++ allows external arrays of incomplete type as well.
Chris Lattner [Fri, 22 Jul 2011 06:27:26 +0000 (06:27 +0000)]
fix PR10384: C++ allows external arrays of incomplete type as well.
Many thanks to Eli for reducing this great testcase.

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

13 years agorename test.
Chris Lattner [Fri, 22 Jul 2011 06:26:12 +0000 (06:26 +0000)]
rename test.

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

13 years agoIntroduce a global bit-offset continuous range map into the ASTReader,
Douglas Gregor [Fri, 22 Jul 2011 06:10:01 +0000 (06:10 +0000)]
Introduce a global bit-offset continuous range map into the ASTReader,
so that we have one, simple way to map from global bit offsets to
local bit offsets. Eliminates a number of loops over the chain, and
generalizes for more interesting bit remappings.

Also, as an amusing oddity, we were computing global bit offsets
*backwards* for preprocessed entities (e.g., the directly included PCH
file in the chain would start at offset zero, rather than the original
PCH that occurs first in translation unit). Even more amusingly, it
made precompiled preambles work, because we were forgetting to adjust
the local bit offset to a global bit offset when storing preprocessed
entity offsets in the ASTUnit. Two wrongs made a right, and now
they're both right.

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

13 years agoFix an embarrassing bug in relocatable PCH support, where we were
Douglas Gregor [Fri, 22 Jul 2011 06:03:18 +0000 (06:03 +0000)]
Fix an embarrassing bug in relocatable PCH support, where we were
passing a temporary const char* down as the "isysroot" parameter and
then accessing it later. Fixes <rdar://problem/9035180>.

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

13 years agoMove duplicate uninitialized warning suppression into the
Chandler Carruth [Fri, 22 Jul 2011 05:27:52 +0000 (05:27 +0000)]
Move duplicate uninitialized warning suppression into the
AnalysisBasedWarnings Sema layer and out of the Analysis library itself.
This returns the uninitialized values analysis to a more pure form,
allowing its original logic to correctly detect some categories of
definitely uninitialized values. Fixes PR10358 (again).

Thanks to Ted for reviewing and updating this patch after his rewrite of
several portions of this analysis.

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

13 years agoIn ARC, non-atomic getters do not need to retain and autorelease
John McCall [Fri, 22 Jul 2011 05:23:13 +0000 (05:23 +0000)]
In ARC, non-atomic getters do not need to retain and autorelease
their loaded values, although it still worth doing this for __weak
properties to get the autoreleased-return-value optimization.

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

13 years agoMove this ObjCImplementationDecl member function into libAST
John McCall [Fri, 22 Jul 2011 04:15:06 +0000 (04:15 +0000)]
Move this ObjCImplementationDecl member function into libAST
where it belongs.

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

13 years agoIn Objective-C, pull arbitrary attributes from overridden
John McCall [Fri, 22 Jul 2011 02:45:48 +0000 (02:45 +0000)]
In Objective-C, pull arbitrary attributes from overridden
methods, including indirectly overridden methods like those
declared in protocols and categories.  There are mismatches
that we would like to diagnose but aren't yet, but this
is fine for now.

I looked at approaches that avoided doing this lookup
unless we needed it, but the infer-related-result-type
checks were doing it anyway, so I left it with the same
fast-path check for no previous declartions of that
selector.

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

13 years agoAdd a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.
Jordy Rose [Fri, 22 Jul 2011 02:08:32 +0000 (02:08 +0000)]
Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.
This was previously not-const only because it has to lazily construct a chain
of ivars the first time it is called (and after the chain is invalidated).
In practice, all the clients were just const_casting their const Decls;
all those now-unnecessary const_casts have been removed.

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

13 years agoobjective-c: Any use of @synthesize or @dynamic lexically after a method (or C functi...
Fariborz Jahanian [Fri, 22 Jul 2011 01:06:53 +0000 (01:06 +0000)]
objective-c: Any use of @synthesize or @dynamic lexically after a method (or C function) implementation
will be rejected with a compilation error in ARC mode, and a compiler warning otherwise.
This may cause breakage in non-arc (and arc) tests which don't expect warning/error. Feel free
to fix the tests, or reverse the patch, if I am unavailable. // rdar://9818354 - WIP

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

13 years agoIn the AST reader, factor out the mapping of local type IDs to global
Douglas Gregor [Fri, 22 Jul 2011 00:38:23 +0000 (00:38 +0000)]
In the AST reader, factor out the mapping of local type IDs to global
type IDs into a single place, and make sure that all of the callers
use the appropriate functions to do the mapping. Since the mapping is
still the identity function, this is essentially a no-op.

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

13 years agoAvoid warning on "clang -c -Dfoo test.i". Lines like these are created
Rafael Espindola [Thu, 21 Jul 2011 23:40:37 +0000 (23:40 +0000)]
Avoid warning on "clang -c -Dfoo test.i". Lines like these are created
when using ccache and libtool.m4 assumes that the compiler cannot print
warnings about options it knows about.

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

13 years agoClean up the rest of the local -> global declaration ID mappings
Douglas Gregor [Thu, 21 Jul 2011 23:29:11 +0000 (23:29 +0000)]
Clean up the rest of the local -> global declaration ID mappings
within the ASTReader (I hope).

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

13 years agoIn the ASTReader, factor out the loading of (local) declaration IDs,
Douglas Gregor [Thu, 21 Jul 2011 22:35:25 +0000 (22:35 +0000)]
In the ASTReader, factor out the loading of (local) declaration IDs,
such that every declaration ID loaded from an AST file will go through
a central local -> global mapping function. At present, this change
does nothing, since the local -> global mapping function is the
identity function.

This is the mechanical part of the refactoring; a follow-up patch will
address a few remaining areas where it's not obvious whether we're
dealing with local or global IDs.

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

13 years agoAdd a missing test for the limits on wchar
Sean Hunt [Thu, 21 Jul 2011 22:01:12 +0000 (22:01 +0000)]
Add a missing test for the limits on wchar

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

13 years agoFix diagnostic when loading a PCH which has different enabled/disabled state of ...
Argyrios Kyrtzidis [Thu, 21 Jul 2011 21:56:04 +0000 (21:56 +0000)]
Fix diagnostic when loading a PCH which has different enabled/disabled state of -fobjc-arc. rdar://9818341

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

13 years agoCleaning up more of the ID situation in the AST reader. This patch relaxes and gener...
Jonathan D. Turner [Thu, 21 Jul 2011 21:15:19 +0000 (21:15 +0000)]
Cleaning up more of the ID situation in the AST reader.  This patch relaxes and generalizes how CXX base specifiers are identified and loaded by using a ContinuousRangeMap.  This also adds a global bit offset (or base) to the PerFileData.

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

13 years agoAdd some debugging output to the AST reader, so we can see the global remappings...
Douglas Gregor [Thu, 21 Jul 2011 19:50:14 +0000 (19:50 +0000)]
Add some debugging output to the AST reader, so we can see the global remappings we generate

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

13 years agoIn the AST reader, keep track of the total number of source locations
Douglas Gregor [Thu, 21 Jul 2011 18:46:38 +0000 (18:46 +0000)]
In the AST reader, keep track of the total number of source locations
entries incrementally, rather than iterating over the chain when
loading a single AST file.

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

13 years agoFor ASTUnit::Save, write the AST to a temporary and then rename it to the actual...
Argyrios Kyrtzidis [Thu, 21 Jul 2011 18:44:49 +0000 (18:44 +0000)]
For ASTUnit::Save, write the AST to a temporary and then rename it to the actual filename.
Should avoid race conditions. Addresses rdar://9788943.

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

13 years agoCut down one open/close pair of system calls by using Path's makeUnique instead of...
Argyrios Kyrtzidis [Thu, 21 Jul 2011 18:44:46 +0000 (18:44 +0000)]
Cut down one open/close pair of system calls by using Path's makeUnique instead of createTemporaryFileOnDisk.

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

13 years agoUpdate cxx_status page on www: clang has had full support for in-class initializers...
Richard Smith [Thu, 21 Jul 2011 18:02:57 +0000 (18:02 +0000)]
Update cxx_status page on www: clang has had full support for in-class initializers since r132890.

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

13 years agoClean up the C++ status page by eliminating the utterly unnecessary set of projects...
Douglas Gregor [Thu, 21 Jul 2011 17:46:15 +0000 (17:46 +0000)]
Clean up the C++ status page by eliminating the utterly unnecessary set of projects. C++98/03 is sooooo yesterday

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

13 years agoUpdate C++0x nullptr status, from Jonathan Sauer
Douglas Gregor [Thu, 21 Jul 2011 17:41:00 +0000 (17:41 +0000)]
Update C++0x nullptr status, from Jonathan Sauer

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

13 years agoAdd FixIt hint for missing 'id' type.
Fariborz Jahanian [Thu, 21 Jul 2011 17:38:14 +0000 (17:38 +0000)]
Add FixIt hint for missing 'id' type.
// rdar://9615045

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

13 years agoobjc - Diagnose missing method return type specifier under
Fariborz Jahanian [Thu, 21 Jul 2011 17:00:47 +0000 (17:00 +0000)]
objc - Diagnose missing method return type specifier under
a warning flag. // rdar://9615045

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

13 years agoOne last RandomAccessIterator operator for PreprocessingRecord::iterator
Douglas Gregor [Thu, 21 Jul 2011 16:37:44 +0000 (16:37 +0000)]
One last RandomAccessIterator operator for PreprocessingRecord::iterator

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

13 years agoAdd the remaining RandomAccessIterator operations to
Douglas Gregor [Thu, 21 Jul 2011 16:35:41 +0000 (16:35 +0000)]
Add the remaining RandomAccessIterator operations to
PreprocessingRecord::iterator. Where's concept_map when I need it?

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

13 years agoDefine the _MIPS_SIM builtin macro on MIPS platforms. Patch by Robert Millan!
Bruno Cardoso Lopes [Thu, 21 Jul 2011 15:10:57 +0000 (15:10 +0000)]
Define the _MIPS_SIM builtin macro on MIPS platforms. Patch by Robert Millan!

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

13 years agoConvert ConstantExpr::getGetElementPtr and
Jay Foad [Thu, 21 Jul 2011 14:31:17 +0000 (14:31 +0000)]
Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.

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

13 years agoFor some reason I don't fully comprehend, the MSVC debug build will fail with a huge...
Francois Pichet [Thu, 21 Jul 2011 06:26:00 +0000 (06:26 +0000)]
For some reason I don't fully comprehend, the MSVC debug build will fail with a huge 50+ lines template error message if PreprocessingRecord::iterator has no operator<()

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

13 years agoSpeculatively revert 135649 to bring back the g++ testing bots.
Eric Christopher [Thu, 21 Jul 2011 05:34:24 +0000 (05:34 +0000)]
Speculatively revert 135649 to bring back the g++ testing bots.

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

13 years agoMove AnalysisManager constructor out of line. No functionality change (yet).
Ted Kremenek [Thu, 21 Jul 2011 05:22:52 +0000 (05:22 +0000)]
Move AnalysisManager constructor out of line.  No functionality change (yet).

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

13 years agoSimplify passing of CFGBuildOptions around for AnalysisContext. No functionality...
Ted Kremenek [Thu, 21 Jul 2011 05:22:47 +0000 (05:22 +0000)]
Simplify passing of CFGBuildOptions around for AnalysisContext.  No functionality change.

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