aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend
AgeCommit message (Collapse)AuthorFilesLines
2011-07-26This patch extends the previous patch by starting to incorporate more ↵Jonathan D. Turner1-1/+1
functionality, like lookup-by-name and exporting lookup tables, into the module manager. Methods now have documentation. A few more functions have been switched over to the new iterator style and away from manual/explicit iteration. Ultimately we want to move away from name lookup here, as symlinks make filenames not a safe unique value, but we use it here as a stopgap before better measures are in place (namely instead using FileEntry* from a global FileManager). llvm-svn: 136107
2011-07-26Rename SourceManager (and InstantiationInfo) isMacroArgInstantiation APIChandler Carruth1-3/+3
to isMacroArgExpansion. llvm-svn: 136053
2011-07-25Rename getInstantiationLineNumber to getExpansionLineNumber in bothChandler Carruth1-2/+2
SourceManager and FullSourceLoc. llvm-svn: 135969
2011-07-25Rename getInstantiationColumnNumber to getExpansionColumnNumber in bothChandler Carruth2-3/+3
SourceManager and FullSourceLoc. llvm-svn: 135965
2011-07-25Rename getDecomposedInstantiationLoc to getDecomposedExpansionLoc.Chandler Carruth1-1/+1
llvm-svn: 135962
2011-07-25Rename SourceManager::getImmediateInstantiationRange toChandler Carruth1-2/+2
getImmediateExpansionRange. llvm-svn: 135960
2011-07-25Pick up expected diagnostics not only in the main file but also in the file ↵Axel Naumann1-9/+21
where the first diagnostic occurred. Useful if the main file is not relevant (like with cling). By Vassil Vassilev. llvm-svn: 135936
2011-07-25Rename SourceManager::getInstantiationRange to getExpansionRange.Chandler Carruth1-2/+2
llvm-svn: 135915
2011-07-25Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth2-6/+6
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
2011-07-23Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon ↵Chris Lattner1-1/+1
Mulder! llvm-svn: 135855
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner20-239/+239
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-07-22Remove prepending of '$' to module names.Jonathan D. Turner1-2/+2
llvm-svn: 135775
2011-07-22Switch all of the "isysroot" const char*'s throughout the AST readerDouglas Gregor3-9/+11
and writer to StringRef or std::string, as appropriate. llvm-svn: 135769
2011-07-22Rename ASTReader::PerFileData to serialization::Module, pulling it outDouglas Gregor2-4/+5
of ASTReader so it can become its own full-fledged class (eventually). No functionality change. llvm-svn: 135767
2011-07-21For ASTUnit::Save, write the AST to a temporary and then rename it to the ↵Argyrios Kyrtzidis1-4/+26
actual filename. Should avoid race conditions. Addresses rdar://9788943. llvm-svn: 135691
2011-07-21Cut down one open/close pair of system calls by using Path's makeUnique ↵Argyrios Kyrtzidis2-2/+2
instead of createTemporaryFileOnDisk. llvm-svn: 135690
2011-07-21Rework the detailed preprocessing record to separate preprocessingDouglas Gregor1-9/+1
entities generated directly by the preprocessor from those loaded from the external source (e.g., the ASTReader). By separating these two sets of entities into different vectors, we allow both to grow independently, and eliminate the need for preallocating all of the loaded preprocessing entities. This is similar to the way the recent SourceManager refactoring treats FileIDs and the source location address space. As part of this, switch over to building a continuous range map to track preprocessing entities. llvm-svn: 135646
2011-07-19[arcmt] Add some additional driver flags to optionally emit or save the ↵Argyrios Kyrtzidis1-0/+10
pre-migration ARC errors. -arcmt-migrate-emit-errors : Emits the pre-migration ARC errors but it doesn't affect anything else -arcmt-migrate-report-output : Writes out the pre-migration ARC errors to the provided plist file rdar://9791454 llvm-svn: 135491
2011-07-19Revamp the SourceManager to separate the representation of parsedDouglas Gregor3-23/+99
source locations from source locations loaded from an AST/PCH file. Previously, loading an AST/PCH file involved carefully pre-allocating space at the beginning of the source manager for the source locations and FileIDs that correspond to the prefix, and then appending the source locations/FileIDs used for parsing the remaining translation unit. This design forced us into loading PCH files early, as a prefix, whic has become a rather significant limitation. This patch splits the SourceManager space into two parts: for source location "addresses", the lower values (growing upward) are used to describe parsed code, while upper values (growing downward) are used for source locations loaded from AST/PCH files. Similarly, positive FileIDs are used to describe parsed code while negative FileIDs are used to file/macro locations loaded from AST/PCH files. As a result, we can load PCH/AST files even during parsing, making various improvemnts in the future possible, e.g., teaching #include <foo.h> to look for and load <foo.h.gch> if it happens to be already available. This patch was originally written by Sebastian Redl, then brought forward to the modern age by Jonathan Turner, and finally polished/finished by me to be committed. llvm-svn: 135484
2011-07-19Implement a __WCHAR_UNSIGNED__ macro and use it to include WCHAR_MIN andAlexis Hunt1-0/+3
WCHAR_MAX in limits.h, thus solving the problem where the system header thinks it knows better. llvm-svn: 135455
2011-07-18Migrate LLVM and Clang to use the new makeArrayRef(...) functions where ↵Frits van Bommel1-2/+2
previously explicit non-default constructors were used. Mostly mechanical with some manual reformatting. llvm-svn: 135390
2011-07-16Do not modify string returned by getenv on Windows. Francois Pichet1-4/+2
Fixes PR9875, patch by Nikola Smiljanic! llvm-svn: 135356
2011-07-14Update the remaining comments in Frontend to 'expansion'.Chandler Carruth1-2/+2
llvm-svn: 135150
2011-07-14NestedMacroInstantiations -> NestedMacroExpansionsChandler Carruth2-8/+8
This is switches all the interfaces points (and most of the commenst / local variables I saw on my way through) regarding the NestedMacroInstantiations bit. The libclang enums corresponding to this state were renamed, but a legacy enum was added with the old name, and the same value to keep existing clients working. I've added a documentation blurb for it, but let me know if there is a canonical way to document legacy elemenst of the libclang interface. No functionality changed here, even in tests. llvm-svn: 135141
2011-07-14Switch all local code and comments from '[Ii]nstantiat(ion|ed)' toChandler Carruth1-14/+14
'[Ee]xpan(sion|ded)' in the TextDiagnosticPrinter. No functionality changed. llvm-svn: 135136
2011-07-14Switch the diagnostic messages about macros to use the terms 'expanded'Chandler Carruth1-2/+2
and 'expansions' rather than 'instantiated' and 'contexts'. This is the first of several patches migrating Clang's terminology surrounding macros from 'instantiation' to 'expansion'. llvm-svn: 135135
2011-07-13In debugger mode, make ObjC message sends to unknown selectors returnJohn McCall1-0/+3
__unknown_anytype, and rewrite such message sends correctly. I had to bite the bullet and actually add a debugger support mode for this one, which is a bit unfortunate, but there really isn't anything else I could imagine doing; this is clearly just debugger-specific behavior. llvm-svn: 135051
2011-07-12Implement -MG. Fixes PR9613Peter Collingbourne2-1/+39
llvm-svn: 134996
2011-07-09[arcmt] Introduce new '-ccc-arcmt-migrate <path>' ARC migration driver option.Argyrios Kyrtzidis1-1/+13
This is a new mode of migration, where we avoid modifying the original files but we emit temporary files instead. <path> will be used to keep migration process metadata. Currently the temporary files that are produced are put in the system's temp directory but we can put them in the <path> if is necessary. Also introduce new ARC migration functions in libclang whose only purpose, currently, is to accept <path> and provide pairs of original file/transformed file to map from the originals to the files after transformations are applied. Finally introduce the c-arcmt-test utility that exercises the new libclang functions, update arcmt-test, and add tests for the whole process. rdar://9735086. llvm-svn: 134844
2011-07-08Fix up dependency file name printing to more closely match that of gcc, ↵Eli Friedman1-5/+11
including fixing a nasty recent regression that could make us print "/foo.h" with a command-line including "-I ./". rdar://problem/9734352 llvm-svn: 134728
2011-07-07Keep track of which source locations are part of a macro argumentChandler Carruth1-13/+83
instantiation and improve diagnostics which are stem from macro arguments to trace the argument itself back through the layers of macro expansion. This requires some tricky handling of the source locations, as the argument appears to be expanded in the opposite direction from the surrounding macro. This patch provides helper routines that encapsulate the logic and explain the reasoning behind how we step through macros during diagnostic printing. This fixes the rest of the test cases originially in PR9279, and later split out into PR10214 and PR10215. There is still some more work we can do here to improve the macro backtrace, but those will follow as separate patches. llvm-svn: 134660
2011-07-07Remove BoostCon-specific code from Clang. FWIW, I'm a fan of things like ↵Jonathan D. Turner3-43/+0
this living in a separate branch. llvm-svn: 134649
2011-07-07Introduce a new libclang aPI function,Douglas Gregor1-16/+30
clang_codeCompleteGetContexts(), that provides the client with information about the context in which code completion has occurred and what kinds of entities make sense as completions at that point. Patch by Connor Wakamo! llvm-svn: 134615
2011-07-06Keep track of when "unrecoverable" errors occur, then allowDouglas Gregor1-1/+1
clang_saveTranslationUnit() to save a PCH file if the only errors it contains are recoverable errors. Fixes <rdar://problem/9727804>. llvm-svn: 134503
2011-07-06libclang: Allow callers of clang_saveTranslationUnit() to distinguishDouglas Gregor1-4/+4
between different classes of errors. Addresses most of <rdar://problem/9660328>. llvm-svn: 134495
2011-07-06Call objc_terminate() instead of abort() when a cleanup throws anJohn McCall1-0/+3
exception in Objective-C; in Objective-C++ we still use std::terminate(). This is only available in very recent runtimes. llvm-svn: 134456
2011-07-06Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall2-6/+10
structure to hold inferred information, then propagate each invididual bit down to -cc1. Separate the bits of "supports weak" and "has a native ARC runtime"; make the latter a CodeGenOption. The tool chain is still driving this decision, because it's the place that has the required deployment target information on Darwin, but at least it's better-factored now. llvm-svn: 134453
2011-07-05Don't define __CONSTANT_CFSTRINGS__ with -fno-constant-cfstrings issue.Fariborz Jahanian1-1/+2
Patch by Jean-Daniel Dupas. llvm-svn: 134414
2011-07-05Update header-search paths for MinGW, from Ruben Van BoxemDouglas Gregor1-0/+2
llvm-svn: 134406
2011-07-02Make the GCC version proliferation worse by N+1 for the sake ofChandler Carruth1-0/+4
ArchLinux. =/ Fixes PR10246. llvm-svn: 134299
2011-07-01Add initial *-*-rtems* target, from Joel SherrillDouglas Gregor1-1/+4
llvm-svn: 134283
2011-07-01When we create a precompiled preamble, don't copy theDouglas Gregor1-6/+9
CompilerInvocation on the stack, because other objects (e.g., the CompilerInstance) maintain an intrusive reference-counted pointer to the CompilerInvocation. This doesn't matter in the normal case, because we take back the CompilerInvocation. However, during crash recovery, this leads to us trying to free an object on the stack, and hilarity ensues. Fixes <rdar://problem/9652540>. llvm-svn: 134245
2011-06-29Use existing -fcatch-undefined-behavior option,Fariborz Jahanian1-3/+0
replacing -freset-local-blocks. // rdar://9227352 llvm-svn: 134082
2011-06-28Under a compiler flag, -freset-local-blocks,Fariborz Jahanian1-0/+3
wipe out stack blocks when they go out of scope. // rdar://9227352 llvm-svn: 134045
2011-06-28Fix PR9279 - Macro expansion stack trace seriously broken with ↵Chris Lattner1-7/+9
function-style macros, by not recursively printing notes for other 'instantiated from' notes. This is a one line fix here: + // Don't print recursive instantiation notes from an instantiation note. + Loc = SM.getSpellingLoc(Loc); While here, fix the testcase to be more precise (it got filecheck'ized brutally), and fix EmitCaretDiagnostic to be private and to not pass down the unused 'Level' argument. llvm-svn: 133993
2011-06-27Improve header search for MinGW(-w64), from Ruben Van Boxem!Douglas Gregor1-27/+39
llvm-svn: 133911
2011-06-24In TextDiagnosticPrinter::EmitCaretDiagnostic, don't always drop fixits if ↵Argyrios Kyrtzidis1-2/+3
the caret location points to a macro instantiation. llvm-svn: 133802
2011-06-24Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about ↵Argyrios Kyrtzidis1-13/+13
'ownership', not 'lifetime'. rdar://9477613. llvm-svn: 133779
2011-06-23avoid using config.h in public headersDylan Noblesmith1-0/+1
This is the only usage in clang's headers, and it's for a define that only exists on CMake builds for the sake of the MSVC compiler, so just use an ifdef instead. Also add an include for config.h in a file that actually needs it, and was picking it up by accident indirectly. llvm-svn: 133710
2011-06-22Copy diagnostic pragmas to the preprocessed output, from Richard Osborne!Douglas Gregor1-0/+44
llvm-svn: 133633