]> granicus.if.org Git - clang/log
clang
14 years agoCreated __builtin___NSStringMakeConstantString() builtin, which generates constant...
David Chisnall [Sat, 23 Jan 2010 02:40:42 +0000 (02:40 +0000)]
Created __builtin___NSStringMakeConstantString() builtin, which generates constant Objective-C strings.

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

14 years agoRename getClangFullVendorVersion() to getClangFullVersion().
Ted Kremenek [Sat, 23 Jan 2010 02:11:34 +0000 (02:11 +0000)]
Rename getClangFullVendorVersion() to getClangFullVersion().

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

14 years agoImplement elementary access control.
John McCall [Sat, 23 Jan 2010 00:46:32 +0000 (00:46 +0000)]
Implement elementary access control.

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

14 years agoTeach the cursor visitor to recurse into the type information of
Douglas Gregor [Sat, 23 Jan 2010 00:40:08 +0000 (00:40 +0000)]
Teach the cursor visitor to recurse into the type information of
explicit casts, sizeof, alignof, and compound literals.

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

14 years agoExtern darwin-clang_rt.c test to also test targetting ARM ({armv6, armv7} x
Daniel Dunbar [Sat, 23 Jan 2010 00:26:38 +0000 (00:26 +0000)]
Extern darwin-clang_rt.c test to also test targetting ARM ({armv6, armv7} x
{thumb,no-thumb}).

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

14 years agoFix a FIXME, this test folds to a constant now.
Daniel Dunbar [Sat, 23 Jan 2010 00:26:29 +0000 (00:26 +0000)]
Fix a FIXME, this test folds to a constant now.

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

14 years agoExtend clang_createTranslationUnitFromSourceFile() to support creating
Douglas Gregor [Sat, 23 Jan 2010 00:14:00 +0000 (00:14 +0000)]
Extend clang_createTranslationUnitFromSourceFile() to support creating
translation units that include unsaved files.

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

14 years agooutside a method, 'super' should resolve in a normal name look up
Fariborz Jahanian [Fri, 22 Jan 2010 23:04:44 +0000 (23:04 +0000)]
outside a method, 'super' should resolve in a normal name look up
to mimic gcc's behavior. Fixes radar 7400691.

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

14 years agoAdd 'clang_getClangVersion()' function to CIndex. This exposes the full Clang versio...
Ted Kremenek [Fri, 22 Jan 2010 22:44:15 +0000 (22:44 +0000)]
Add 'clang_getClangVersion()' function to CIndex.  This exposes the full Clang version string through the CIndex API.

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

14 years agoFixup the rest of the testcases to grep the .ll file instead of the .s
Mike Stump [Fri, 22 Jan 2010 22:37:17 +0000 (22:37 +0000)]
Fixup the rest of the testcases to grep the .ll file instead of the .s
file, and add FIXMEs to the remaining broken tests.

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

14 years agoFixes test.
Fariborz Jahanian [Fri, 22 Jan 2010 22:30:25 +0000 (22:30 +0000)]
Fixes test.

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

14 years agoMove version string generation (e.g., "clang 1.1 ...") to libBasic/Version.cpp, getCl...
Ted Kremenek [Fri, 22 Jan 2010 22:29:50 +0000 (22:29 +0000)]
Move version string generation (e.g., "clang 1.1 ...") to libBasic/Version.cpp, getClangFullVendorVersion().

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

14 years agoImprove content and structure of the Doxygen documentation for the
Douglas Gregor [Fri, 22 Jan 2010 22:29:16 +0000 (22:29 +0000)]
Improve content and structure of the Doxygen documentation for the
CIndex API. No functionality change.

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

14 years ago(1) Rename getClangSubversionRevision() to getClangRevision(), and
Ted Kremenek [Fri, 22 Jan 2010 22:12:47 +0000 (22:12 +0000)]
(1) Rename getClangSubversionRevision() to getClangRevision(), and
    have it return a StringRef instead of an integer (to be more VCS
    agnostic).

(2) Add getClangFullRepositoryVersion(), which contains an
    amalgamation of the repository name and the revision.

(3) Change PCH to only emit the string returned by
    getClangFullRepositoryVersion() instead of also emitting the value
    of getClangSubversionRevision() (which has been removed).  This is
    functionally equivalent.

More cleanup to version string generation pending...

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

14 years agoConvert more testcases to checking the .ll file instead of the .s file.
Mike Stump [Fri, 22 Jan 2010 22:06:55 +0000 (22:06 +0000)]
Convert more testcases to checking the .ll file instead of the .s file.

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

14 years agoYet more CIndex API cleanup:
Douglas Gregor [Fri, 22 Jan 2010 21:44:22 +0000 (21:44 +0000)]
Yet more CIndex API cleanup:
  - Added more routines to manipulate/compare source locations and ranges
  - Switched clang_getCursor() over to take a CXSourceLocation rather
  than file/line/column.

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

14 years agoui64, etc. are valid VS suffixes.
Fariborz Jahanian [Fri, 22 Jan 2010 21:36:53 +0000 (21:36 +0000)]
ui64, etc. are valid VS suffixes.
Fixes radar 7562363.

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

14 years agoRename pch::SVN_BRANCH_REVISION to pch::VERSION_CONTROL_BRANCH_REVISION.
Ted Kremenek [Fri, 22 Jan 2010 20:59:36 +0000 (20:59 +0000)]
Rename pch::SVN_BRANCH_REVISION to pch::VERSION_CONTROL_BRANCH_REVISION.

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

14 years agoRename getClangSubversionPath() -> getClangRepositoryPath() and have it return a...
Ted Kremenek [Fri, 22 Jan 2010 20:55:35 +0000 (20:55 +0000)]
Rename getClangSubversionPath() -> getClangRepositoryPath() and have it return a StringRef.

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

14 years agoEliminate index-test; all of its tested functionality is now in c-index-test.
Douglas Gregor [Fri, 22 Jan 2010 20:40:20 +0000 (20:40 +0000)]
Eliminate index-test; all of its tested functionality is now in c-index-test.

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

14 years agoEliminate CIndex's dependency on the Clang Index library, since we
Douglas Gregor [Fri, 22 Jan 2010 20:35:53 +0000 (20:35 +0000)]
Eliminate CIndex's dependency on the Clang Index library, since we
weren't actually using any of its facilities.

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

14 years agoBe sure to select primary bases among the nearly empties in preorder,
Mike Stump [Fri, 22 Jan 2010 20:27:17 +0000 (20:27 +0000)]
Be sure to select primary bases among the nearly empties in preorder,
not just among the direct bases.  Before we where missing nearly
empties that were bases of virtual base classes.

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

14 years agoTeach CIndex's cursor visitor to restrict its traversal to a specific
Douglas Gregor [Fri, 22 Jan 2010 19:49:59 +0000 (19:49 +0000)]
Teach CIndex's cursor visitor to restrict its traversal to a specific
region of interest (if provided). Implement clang_getCursor() in terms
of this traversal rather than using the Index library; the unified
cursor visitor is more complete, and will be The Way Forward.

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

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

14 years agoFinish off fixing up debug information.
Mike Stump [Fri, 22 Jan 2010 18:48:47 +0000 (18:48 +0000)]
Finish off fixing up debug information.

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

14 years agoPatch fixes a lookup bug in c++'s anonymous union member
Fariborz Jahanian [Fri, 22 Jan 2010 18:30:17 +0000 (18:30 +0000)]
Patch fixes a lookup bug in c++'s anonymous union member
lookup. Fixes radar 7562438.

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

14 years agoNo need to canonicalize the type and use dyn_cast. Also, correctly diagnose trying...
Anders Carlsson [Fri, 22 Jan 2010 17:37:20 +0000 (17:37 +0000)]
No need to canonicalize the type and use dyn_cast. Also, correctly diagnose trying to override a function returning an lvalue reference with a function overriding an rvalue reference.

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

14 years agoEliminate some Clang warnings
Douglas Gregor [Fri, 22 Jan 2010 15:41:14 +0000 (15:41 +0000)]
Eliminate some Clang warnings

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

14 years agoSimplify code.
Benjamin Kramer [Fri, 22 Jan 2010 13:59:13 +0000 (13:59 +0000)]
Simplify code.

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

14 years agoFix an obvious goof that caused us to only see the top level of return types
Chandler Carruth [Fri, 22 Jan 2010 13:07:41 +0000 (13:07 +0000)]
Fix an obvious goof that caused us to only see the top level of return types
when checking for covariance. Added some fun test cases, fixes PR6110.

This felt obvious enough to just commit. ;] Let me know if anything needs
tweaking.

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

14 years agoEnsure we output all non-virtual base vtables. Fixes PR5890.
Mike Stump [Fri, 22 Jan 2010 06:45:05 +0000 (06:45 +0000)]
Ensure we output all non-virtual base vtables.  Fixes PR5890.

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

14 years agoProcess cast according to the cast kind. Prepare for more specific cast
Zhongxing Xu [Fri, 22 Jan 2010 04:30:00 +0000 (04:30 +0000)]
Process cast according to the cast kind. Prepare for more specific cast
handling (for C++). No functionality change for now.

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

14 years agoDriver/Darwin: Update tool chain to use static clang_rt libraries provided by
Daniel Dunbar [Fri, 22 Jan 2010 03:38:14 +0000 (03:38 +0000)]
Driver/Darwin: Update tool chain to use static clang_rt libraries provided by
compiler-rt. This tool chain now works on x86 and ARM, but isn't the x86 default
yet.

This drastically cleans up the linker invocation, old invocation:
--
"/Developer/usr/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-weak_reference_mismatches" "non-weak" "-o" "a.out" "-lcrt1.10.6.o" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.." "t.o" "-lSystem" "-lgcc"
--

New invocation:
--
# For 10.6:
 "/usr/bin/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-o" "a.out" "-lcrt1.10.6.o" "t.o" "-lSystem"
# For 10.4:
 "/usr/bin/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.4" "-o" "a.out" "-lcrt1.o" "t.o" "-lSystem" "-lgcc_s.10.4" "/Volumes/Data/ddunbar/llvm.obj.64/Debug/lib/clang/1.1/lib/darwin/libclang_rt.10.4.a"
--

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

14 years agoDriver/Darwin/ld: Fix refacto, -force_cpusubtype_ALL should only be forwarded,
Daniel Dunbar [Fri, 22 Jan 2010 03:37:33 +0000 (03:37 +0000)]
Driver/Darwin/ld: Fix refacto, -force_cpusubtype_ALL should only be forwarded,
not always added.

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

14 years agoUpdate debugging code.
Mike Stump [Fri, 22 Jan 2010 02:51:26 +0000 (02:51 +0000)]
Update debugging code.

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

14 years agoDriver/Darwin/ld: Factor out getDarwinArchName, for getting the "Darwin" arch
Daniel Dunbar [Fri, 22 Jan 2010 02:04:58 +0000 (02:04 +0000)]
Driver/Darwin/ld: Factor out getDarwinArchName, for getting the "Darwin" arch
name being used in an driver invocation.

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

14 years agoDriver/Darwin/ld: Eliminate AddDarwinSubArch, our linker invocation is going to
Daniel Dunbar [Fri, 22 Jan 2010 02:04:52 +0000 (02:04 +0000)]
Driver/Darwin/ld: Eliminate AddDarwinSubArch, our linker invocation is going to
diverge from gcc anyway.

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

14 years agoAdd a Coding Standards section to hacking.html, and point out that cstdio is forbidden.
Daniel Dunbar [Fri, 22 Jan 2010 02:04:46 +0000 (02:04 +0000)]
Add a Coding Standards section to hacking.html, and point out that cstdio is forbidden.

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

14 years agoUse raw_ostream instead of cstdio.
Daniel Dunbar [Fri, 22 Jan 2010 02:04:41 +0000 (02:04 +0000)]
Use raw_ostream instead of cstdio.

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

14 years agoVisit if, switch statements properly
Douglas Gregor [Fri, 22 Jan 2010 01:00:11 +0000 (01:00 +0000)]
Visit if, switch statements properly

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

14 years agoTeach the cursor visitor to walk all of the C and Objective-C
Douglas Gregor [Fri, 22 Jan 2010 00:50:27 +0000 (00:50 +0000)]
Teach the cursor visitor to walk all of the C and Objective-C
declarations that have enough source information to make such a walk
useful. This includes walking into variable initializers and enum
constants, the types behind typedefs, etc.

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

14 years agoCreate function, block, and template parameters in the context of the
John McCall [Fri, 22 Jan 2010 00:28:27 +0000 (00:28 +0000)]
Create function, block, and template parameters in the context of the
translation unit.  This is temporary for function and block parameters;
template parameters can just stay this way, since Templates aren't
DeclContexts.  This gives us the nice property that everything created
in a record DC should have access in C++.

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

14 years agorevert my patch for rdar://7520940 that warns when a published header
Chris Lattner [Fri, 22 Jan 2010 00:14:44 +0000 (00:14 +0000)]
revert my patch for rdar://7520940 that warns when a published header
is #included with "foo.h" style syntax instead of framework syntax.
It produced too much noise.

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

14 years agoWire up the new range reporting for unreachable code.
Mike Stump [Thu, 21 Jan 2010 23:49:01 +0000 (23:49 +0000)]
Wire up the new range reporting for unreachable code.

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

14 years agoTeach the cursor visitor to walk statements and expressions, including
Douglas Gregor [Thu, 21 Jan 2010 23:27:09 +0000 (23:27 +0000)]
Teach the cursor visitor to walk statements and expressions, including
a few important subkinds. Now we're cookin' with gas!

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

14 years agoImprove unreachable code warnings with respect to dead member and
Mike Stump [Thu, 21 Jan 2010 23:15:53 +0000 (23:15 +0000)]
Improve unreachable code warnings with respect to dead member and
dead array references.

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

14 years agoDue to local reversions and re-patching, I accidentally had multiple copies
John McCall [Thu, 21 Jan 2010 22:59:41 +0000 (22:59 +0000)]
Due to local reversions and re-patching, I accidentally had multiple copies
of the 'payload' in this header.

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

14 years agoImprove unreachable code warnings for with respect to dead functional casts in C++.
Mike Stump [Thu, 21 Jan 2010 22:12:18 +0000 (22:12 +0000)]
Improve unreachable code warnings for with respect to dead functional casts in C++.

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

14 years agoTeach the cursor visitor to walk into typeof types (both kinds). This
Douglas Gregor [Thu, 21 Jan 2010 20:48:56 +0000 (20:48 +0000)]
Teach the cursor visitor to walk into typeof types (both kinds). This
is hard to test now; tests will come when we can walk stataements and
expressions properly.

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

14 years agoImprove unreachable code warnings for with respect to c-style casts.
Mike Stump [Thu, 21 Jan 2010 19:51:34 +0000 (19:51 +0000)]
Improve unreachable code warnings for with respect to c-style casts.

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

14 years agoImprove unreachable code warnings for with respect to ? :.
Mike Stump [Thu, 21 Jan 2010 19:44:04 +0000 (19:44 +0000)]
Improve unreachable code warnings for with respect to ? :.

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

14 years agoAllocate the 'Protocols' array in ObjCInterfaceType and
Ted Kremenek [Thu, 21 Jan 2010 19:22:34 +0000 (19:22 +0000)]
Allocate the 'Protocols' array in ObjCInterfaceType and
ObjCObjectPointerType using the allocator associated with ASTContext.
Not only does this fix a memory leak, but it also makes these arrays
BumpPtrAllocated (in the typical case).

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

14 years agoRevert r94073, it fails in Release-Asserts builds.
Benjamin Kramer [Thu, 21 Jan 2010 18:14:21 +0000 (18:14 +0000)]
Revert r94073, it fails in Release-Asserts builds.

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

14 years agoFixes a comment.
Fariborz Jahanian [Thu, 21 Jan 2010 17:39:43 +0000 (17:39 +0000)]
Fixes a comment.

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

14 years agoPatch to implement rewriting of properties.
Fariborz Jahanian [Thu, 21 Jan 2010 17:36:00 +0000 (17:36 +0000)]
Patch to implement rewriting of properties.
Fixes radar 7562952.

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

14 years agoImprove unreachable code warnings for with respect to compound
Mike Stump [Thu, 21 Jan 2010 17:31:41 +0000 (17:31 +0000)]
Improve unreachable code warnings for with respect to compound
assignments.

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

14 years agoTeach the cursor visitor to walk into a variety of different TypeLoc
Douglas Gregor [Thu, 21 Jan 2010 17:29:07 +0000 (17:29 +0000)]
Teach the cursor visitor to walk into a variety of different TypeLoc
kinds, so that we see referenced types, protocols, classes, etc.

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

14 years agoImprove unreachable code warnings with respect to dead binary and
Mike Stump [Thu, 21 Jan 2010 17:21:23 +0000 (17:21 +0000)]
Improve unreachable code warnings with respect to dead binary and
unary operators.

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

14 years agoAdd a test for clang_rt support on Darwin. With appropriate massaging, this
Daniel Dunbar [Thu, 21 Jan 2010 17:10:39 +0000 (17:10 +0000)]
Add a test for clang_rt support on Darwin. With appropriate massaging, this
checks that the runtime library can be linked and works for compiling on 10.6
for 10.{4,5,6} targets. Currently test is only for x86, and misses some
compiler-rt functions.

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

14 years agoTweak OptionalTests paths.
Daniel Dunbar [Thu, 21 Jan 2010 17:09:39 +0000 (17:09 +0000)]
Tweak OptionalTests paths.

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

14 years agoUpdate to use llvm/utils/GetSourceVersion to detect version number, instead of
Daniel Dunbar [Thu, 21 Jan 2010 16:56:47 +0000 (16:56 +0000)]
Update to use llvm/utils/GetSourceVersion to detect version number, instead of
assuming SVN. This should be fixed to not necessarily be an integer.

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

14 years agoAdd utils/OptionalTests, a dumping ground for additional (lit) tests which for
Daniel Dunbar [Thu, 21 Jan 2010 16:55:39 +0000 (16:55 +0000)]
Add utils/OptionalTests, a dumping ground for additional (lit) tests which for
one reason or another don't belong in the regular test suite.

Inside is utils/OptionalTests/Extra which is specifically for tests that match
the layout of the regular tests.

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

14 years agoMove the VTT related code into its own file, CGVTT.cpp
Anders Carlsson [Thu, 21 Jan 2010 16:50:45 +0000 (16:50 +0000)]
Move the VTT related code into its own file, CGVTT.cpp

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

14 years agoIntroduce type references into the C API, capturing references to
Douglas Gregor [Thu, 21 Jan 2010 16:28:34 +0000 (16:28 +0000)]
Introduce type references into the C API, capturing references to
typedefs only (for now).

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

14 years agoTeach code-completion to deal with calls to functions without prototypes.
Douglas Gregor [Thu, 21 Jan 2010 15:46:19 +0000 (15:46 +0000)]
Teach code-completion to deal with calls to functions without prototypes.

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

14 years agoSpeed up compilation by avoiding generating exceptional edges from
Mike Stump [Thu, 21 Jan 2010 15:20:48 +0000 (15:20 +0000)]
Speed up compilation by avoiding generating exceptional edges from
CallExprs as those edges help cause a n^2 explosion in the number of
destructor calls.  Other consumers, such as static analysis, that
would like to have more a more complete CFG can select the inclusion
of those edges as CFG build time.

This also fixes up the two compilation users of CFGs to be tolerant of
having or not having those edges.  All catch code is assumed be to
live if we didn't generate the exceptional edges for CallExprs.

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

14 years agoMatch branch labels with the trailing colon so we don't accidentally match something...
Benjamin Kramer [Thu, 21 Jan 2010 15:19:14 +0000 (15:19 +0000)]
Match branch labels with the trailing colon so we don't accidentally match something else.

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

14 years agoMove some recent checking code into SemaChecking instead.
Mike Stump [Thu, 21 Jan 2010 03:59:47 +0000 (03:59 +0000)]
Move some recent checking code into SemaChecking instead.

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

14 years agoAvoid instantiating std::sort to save on compiler size.
Mike Stump [Thu, 21 Jan 2010 03:43:13 +0000 (03:43 +0000)]
Avoid instantiating std::sort to save on compiler size.

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

14 years agoWhen checking for unreachable code, we can trivially avoid checking
Mike Stump [Thu, 21 Jan 2010 03:07:51 +0000 (03:07 +0000)]
When checking for unreachable code, we can trivially avoid checking
for unreachable loops if all the blocks are already marked live by
this point.

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

14 years agoWhen checking for unreachable blocks, we can trivially avoid extra
Mike Stump [Thu, 21 Jan 2010 02:55:37 +0000 (02:55 +0000)]
When checking for unreachable blocks, we can trivially avoid extra
work, if we know we already marked all blocks as live.

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

14 years agoAdd infrastructure to add base initializers and member initializers to
Mike Stump [Thu, 21 Jan 2010 02:21:40 +0000 (02:21 +0000)]
Add infrastructure to add base initializers and member initializers to
the CFG.  WIP.

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

14 years agoFixes comments.
Fariborz Jahanian [Thu, 21 Jan 2010 00:08:17 +0000 (00:08 +0000)]
Fixes comments.

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

14 years agoAlso allow cast of block pointer type to
Fariborz Jahanian [Thu, 21 Jan 2010 00:05:09 +0000 (00:05 +0000)]
Also allow cast of block pointer type to
pointer to an any object. Another variation of
radar 7562285.

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

14 years agoStash a CXXUnit pointer into each cursor. This allows us to simplify
Douglas Gregor [Wed, 20 Jan 2010 23:57:43 +0000 (23:57 +0000)]
Stash a CXXUnit pointer into each cursor. This allows us to simplify
the interface to clang_visitChildren() by eliminating the
CXTranslationUnit pointer.

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

14 years ago A Decl->getName() is not unique. However, the debug info descriptors
Devang Patel [Wed, 20 Jan 2010 23:56:40 +0000 (23:56 +0000)]
 A Decl->getName() is not unique. However, the debug info descriptors
 are uniqued. The debug info descriptor describing record's context is
necessary to keep two Decl's descriptor unique if their name match.

There is more work to do to create descriptors for DeclContext.
As a temp. step use type's name in FwdDecl.

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

14 years agoEliminate the MakeCXCursor routines that require their callers to know too much about...
Douglas Gregor [Wed, 20 Jan 2010 23:34:41 +0000 (23:34 +0000)]
Eliminate the MakeCXCursor routines that require their callers to know too much about the cursor's storage

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

14 years agoIn objective-c++ land, a block pointer is another object pointer.
Fariborz Jahanian [Wed, 20 Jan 2010 22:54:38 +0000 (22:54 +0000)]
In objective-c++ land, a block pointer is another object pointer.
So, casting a generic object pointer ('id' or 'Class') to the
block pointer is allowed. Fixes radar 7562285.

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

14 years agoYet more Doxygen-comment tweaking in the CIndex library.
Douglas Gregor [Wed, 20 Jan 2010 22:45:41 +0000 (22:45 +0000)]
Yet more Doxygen-comment tweaking in the CIndex library.

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

14 years agoImprove Doxygen documentation for the CIndex library, somewhat.
Douglas Gregor [Wed, 20 Jan 2010 22:28:27 +0000 (22:28 +0000)]
Improve Doxygen documentation for the CIndex library, somewhat.

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

14 years agoChange LLVM/clang #includes to use quotes, not angle-brackets. Just a think-o
John McCall [Wed, 20 Jan 2010 22:16:29 +0000 (22:16 +0000)]
Change LLVM/clang #includes to use quotes, not angle-brackets.  Just a think-o
prompted by the #include <iterator> above.

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

14 years agoKill CXEntity and CXDecl. The first has never been used, while the
Douglas Gregor [Wed, 20 Jan 2010 22:14:22 +0000 (22:14 +0000)]
Kill CXEntity and CXDecl. The first has never been used, while the
second has been wholly replaced by cursors.

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

14 years agoFirst pass at collecting access-specifier information along inheritance paths.
John McCall [Wed, 20 Jan 2010 21:53:11 +0000 (21:53 +0000)]
First pass at collecting access-specifier information along inheritance paths.
Triggers lots of assertions about missing access information;  fix them.

Will actually consume this information soon.

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

14 years agoKill some CXDecl-related APIs that have been superceded by
Douglas Gregor [Wed, 20 Jan 2010 21:45:58 +0000 (21:45 +0000)]
Kill some CXDecl-related APIs that have been superceded by
CXCursor-based APIs.

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

14 years agoKill CXStmt. It isn't being used anywhere, and has no future.
Douglas Gregor [Wed, 20 Jan 2010 21:38:07 +0000 (21:38 +0000)]
Kill CXStmt. It isn't being used anywhere, and has no future.

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

14 years agoKill clang_loadDeclaration() and clang_loadTranslationUnit().
Douglas Gregor [Wed, 20 Jan 2010 21:37:00 +0000 (21:37 +0000)]
Kill clang_loadDeclaration() and clang_loadTranslationUnit().

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

14 years agoSwitch c-index-test from clang_loadDeclaration() and
Douglas Gregor [Wed, 20 Jan 2010 21:32:04 +0000 (21:32 +0000)]
Switch c-index-test from clang_loadDeclaration() and
clang_loadTranslationUnit() over to clang_visitChildren().

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

14 years agoSwitch the internals of clang_loadTranslationUnit() over to the new
Douglas Gregor [Wed, 20 Jan 2010 21:13:59 +0000 (21:13 +0000)]
Switch the internals of clang_loadTranslationUnit() over to the new
cursor-based traversal, and eliminate TUVisitor. We're now down to one
visitor for traversing the AST. Yay!

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

14 years agoUse sizeof() instead of hard-coding a size for WrittenBuiltinSpecs, eek!
Daniel Dunbar [Wed, 20 Jan 2010 21:13:31 +0000 (21:13 +0000)]
Use sizeof() instead of hard-coding a size for WrittenBuiltinSpecs, eek!

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

14 years agoIntroduce a new, cursor-based traversal function that visits the
Douglas Gregor [Wed, 20 Jan 2010 20:59:29 +0000 (20:59 +0000)]
Introduce a new, cursor-based traversal function that visits the
children of a given cursor, regardless of what kind of cursor it
is. This is a generalization of clang_loadDeclaration and
clang_loadTranslationUnit that will also extent to statements,
expressions, etc.

As proof-of-concept, switched clang_loadDeclaration() from its own
visitor over to an instance of this traversal function internally.

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

14 years agoSettled rule on warning on unimplemented property in
Fariborz Jahanian [Wed, 20 Jan 2010 19:36:21 +0000 (19:36 +0000)]
Settled rule on warning on unimplemented property in
category implementation when some implementations
are missing in the primary class implementation.
(fixes radar 6505200).

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

14 years agoreduce redundant are's
Chris Lattner [Wed, 20 Jan 2010 17:53:58 +0000 (17:53 +0000)]
reduce redundant are's

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

14 years agoImprove performance of warning when not implementing a required
Fariborz Jahanian [Wed, 20 Jan 2010 17:27:59 +0000 (17:27 +0000)]
Improve performance of warning when not implementing a required
property of a protocol (my previous patch). No change in functionality.
(radar 7544809).

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

14 years agoMake some helper functions static.
Benjamin Kramer [Wed, 20 Jan 2010 16:21:40 +0000 (16:21 +0000)]
Make some helper functions static.

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

14 years agoDon't store a Twine temporary, it's unsafe.
Benjamin Kramer [Wed, 20 Jan 2010 16:18:11 +0000 (16:18 +0000)]
Don't store a Twine temporary, it's unsafe.

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

14 years agoFix html glitch. Pointed out by clwi (PR6090).
Duncan Sands [Wed, 20 Jan 2010 12:40:56 +0000 (12:40 +0000)]
Fix html glitch.  Pointed out by clwi (PR6090).

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

14 years agoCorrect comments.
Zhongxing Xu [Wed, 20 Jan 2010 07:57:45 +0000 (07:57 +0000)]
Correct comments.

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

14 years agoallow this test to pass, even with the recent .s printer changes.
Chris Lattner [Wed, 20 Jan 2010 07:45:09 +0000 (07:45 +0000)]
allow this test to pass, even with the recent .s printer changes.
Have I ever mentioned that clang regtests should not be grepping .s files??

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

14 years agoFix a typo pointed about by gabor.
Chandler Carruth [Wed, 20 Jan 2010 07:43:54 +0000 (07:43 +0000)]
Fix a typo pointed about by gabor.

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

14 years agoMove the MacroBuilder utilitiy to its own header. Update references.
Chandler Carruth [Wed, 20 Jan 2010 06:13:02 +0000 (06:13 +0000)]
Move the MacroBuilder utilitiy to its own header. Update references.

Comments and/or improvements to the documentation are welcome.

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

14 years agoFix an invalid Twine use spotty by abbeyj, it isn't safe to use Twine
Daniel Dunbar [Wed, 20 Jan 2010 06:09:53 +0000 (06:09 +0000)]
Fix an invalid Twine use spotty by abbeyj, it isn't safe to use Twine
temporaries (this is one reason I'm nervous about propagating their use beyond
particularly performance critical places).

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