summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* Move instantiateTemplateAttribute into the sema namespace, make helpers static.Benjamin Kramer2012-02-061-1/+1
| | | | llvm-svn: 149864
* Invalid O levels on the command line no longer have a confusing error.Aaron Ballman2012-02-061-4/+5
| | | | llvm-svn: 149852
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-0516-32/+32
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-057-39/+39
| | | | llvm-svn: 149798
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-041-0/+1
| | | | | | | | include. Fix all the transitive include users. llvm-svn: 149783
* Remove Diagnostic.h include from Preprocessor.h.Benjamin Kramer2012-02-041-3/+3
| | | | | | | - Move the offending methods out of line and fix transitive includers. - This required changing an enum in the PPCallback API into an unsigned. llvm-svn: 149782
* ArrayRef goodness in MultiplexConsumer, no functionality change.Argyrios Kyrtzidis2012-02-041-2/+3
| | | | llvm-svn: 149764
* Use variable in place of multiple CI.getFrontendOpts() calls and use a bitArgyrios Kyrtzidis2012-02-041-2/+2
| | | | | | of ArrayRef goodness. No functionality change. llvm-svn: 149739
* Clang has existing support for debuggers thatSean Callanan2012-02-041-0/+3
| | | | | | | | | | | | | | | | | | | | want to provide "po"-like functionality which treats the result of an expression implicitly as "id" (if it is not otherwise known) and prints it as an Objective-C object. This has in the past been gated by the "DebuggerSupport" language option, but that is too general. Debuggers also provide other commands like "print" that do not make any assumptions about whether the object is an Objective-C object. This patch makes the assumption conditional on a new language option: DebuggerCastResultToId. I have also made corresponding modifications to the testsuite. llvm-svn: 149735
* Make sure that the layout-override parser grabs the size, not the dataDouglas Gregor2012-02-031-3/+3
| | | | | | size. Otherwise, we can end up with bogus layouts. llvm-svn: 149703
* Fix -ftrap-function fallout from llvm r145714. <rdar://problem/10799325>Bob Wilson2012-02-031-0/+1
| | | | | | | | | That llvm change removed the -trap-func backend option, so that using -ftrap-function with clang would cause the backend to complain. Fix it by adding the trap function name to the CodeGenOptions and passing it through to the TargetOptions. llvm-svn: 149679
* Replace the old --with-cxx-* configure options with a single ↵Rafael Espindola2012-02-031-13/+0
| | | | | | | | | --with-gcc-toolchain that just uses the new toolchain probing logic. This fixes linking with -m32 on 64 bit systems (the /32 dir was not being added to the search). llvm-svn: 149652
* Rename -dependency-graphviz to -dependencncy-dotDouglas Gregor2012-02-023-4/+5
| | | | llvm-svn: 149645
* Back out my heinous hack that tricked the module generation mechanismDouglas Gregor2012-02-022-39/+34
| | | | | | | | | | | | | | | | | | | | into using non-absolute system includes (<foo>)... ... and introduce another hack that is simultaneously more heineous and more effective. We whitelist Clang-supplied headers that augment or override system headers (such as float.h, stdarg.h, and tgmath.h). For these headers, Clang does not provide a module mapping. Instead, a system-supplied module map can refer to these headers in a system module, and Clang will look both in its own include directory and wherever the system-supplied module map suggests, then adds either or both headers. The end result is that Clang-supplied headers get merged into the system-supplied module for the C standard library. As a drive-by, fix up a few dependencies in the _Builtin_instrinsics module. llvm-svn: 149611
* Introduce a -cc1 option "-dependency-graphviz" that determines headerDouglas Gregor2012-02-024-0/+145
| | | | | | dependencies and outputs them in GraphViz format. llvm-svn: 149575
* back out r149504Dylan Noblesmith2012-02-021-1/+4
| | | | | | Too many weird build failures. llvm-svn: 149571
* [libclang] Make sure we don't ever leave a StoredDiagnostic associated withArgyrios Kyrtzidis2012-02-011-10/+34
| | | | | | a SourceManager that has already been deleted, rdar://10768346. llvm-svn: 149532
* include clang's config.h unconditionallyDylan Noblesmith2012-02-011-5/+3
| | | | | | | | | | | | | And remove HAVE_CLANG_CONFIG_H, now that the header is generated in the autoconf build, too. (clang r149497 / llvm r149498) Also include the config.h header after all other headers, per the LLVM coding standards. It also turns out WindowsToolChain.cpp wasn't using the config header at all, so that include's just deleted now. llvm-svn: 149504
* Split compiler builtin module into "stdlib" builtins and "intrinsic"Douglas Gregor2012-01-311-26/+39
| | | | | | | | builds, and bring mm_alloc.h into the fold. Start playing some tricks with these builtin modules to mirror the include_next tricks that the headers already perform. llvm-svn: 149434
* Fix 80-column violation.Chad Rosier2012-01-311-1/+2
| | | | llvm-svn: 149405
* Thread a TargetInfo through to the module map; we'll need it forDouglas Gregor2012-01-303-4/+6
| | | | | | target-specific module requirements. llvm-svn: 149224
* Switch over to LLVM's file-level locking facilityDouglas Gregor2012-01-291-265/+5
| | | | llvm-svn: 149204
* Ensure that we clean up after a failed module build and cope with theDouglas Gregor2012-01-292-1/+4
| | | | | | results in libclang. llvm-svn: 149200
* Implement code completion support for module import declarations, e.g.,Douglas Gregor2012-01-291-1/+0
| | | | | | | | | | | | @import <complete with module names here> or @import std.<complete with submodule names here> Addresses <rdar://problem/10710117>. llvm-svn: 149199
* Rework HeaderSearch's interface for getting a module from a name andDouglas Gregor2012-01-292-5/+20
| | | | | | | | | for getting the name of the module file, unifying the code for searching for a module with a given name (into lookupModule()) and separating out the mapping to a module file (into getModuleFileName()). No functionality change. llvm-svn: 149197
* Complain about attempts to use 'protected' visibility on targetsJohn McCall2012-01-291-0/+1
| | | | | | | | like Darwin that don't support it. We should also complain about invalid -fvisibility=protected, but that information doesn't seem to exist at the most appropriate time, so I've left a FIXME behind. llvm-svn: 149186
* Introduce module attributes into the module map grammar, along with aDouglas Gregor2012-01-273-8/+16
| | | | | | | | | | | | | single attribute ("system") that allows us to mark a module as being a "system" module. Each of the headers that makes up a system module is considered to be a system header, so that we (for example) suppress warnings there. If a module is being inferred for a framework, and that framework directory is within a system frameworks directory, infer it as a system framework. llvm-svn: 149143
* Due to a bug, -Wno-everything works like -Weverything. Fix the bug by havingArgyrios Kyrtzidis2012-01-271-2/+8
| | | | | | | | | -Wno-everything remap all warnings to ignored. We can now use "-Wno-everything -W<warning>" to ignore all warnings except specific ones. llvm-svn: 149121
* objc-arc: introduce -no-finalize-removal which in gc mode,Fariborz Jahanian2012-01-261-0/+1
| | | | | | | | leaves "finalize' behind and in arc mode, does not include it. This allows the migrated source to be compiled in both gc and arc mode. // rdar://10532441 llvm-svn: 149079
* Extend the ExternalASTSource interface to allow the AST source toDouglas Gregor2012-01-264-3/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | provide the layout of records, rather than letting Clang compute the layout itself. LLDB provides the motivation for this feature: because various layout-altering attributes (packed, aligned, etc.) don't get reliably get placed into DWARF, the record layouts computed by LLDB from the reconstructed records differ from the actual layouts, and badness occurs. This interface lets the DWARF data drive layout, so we don't need the attributes preserved to get the answer write. The testing methodology for this change is fun. I've introduced a variant of -fdump-record-layouts called -fdump-record-layouts-simple that always has the simple C format and provides size/alignment/field offsets. There is also a -cc1 option -foverride-record-layout=<file> to take the output of -fdump-record-layouts-simple and parse it to produce a set of overridden layouts, which is introduced into the AST via a testing-only ExternalASTSource (called LayoutOverrideSource). Each test contains a number of records to lay out, which use various layout-changing attributes, and then dumps the layouts. We then run the test again, using the preprocessor to eliminate the layout-changing attributes entirely (which would give us different layouts for the records), but supplying the previously-computed record layouts. Finally, we diff the layouts produced from the two runs to be sure that they are identical. Note that this code makes the assumption that we don't *have* to provide the offsets of bases or virtual bases to get the layout right, because the alignment attributes don't affect it. I believe this assumption holds, but if it does not, we can extend LayoutOverrideSource to also provide base offset information. Fixes the Clang side of <rdar://problem/10169539>. llvm-svn: 149055
* Introduce 3 new fixit options:Argyrios Kyrtzidis2012-01-261-0/+9
| | | | | | | | | | | | | | -fixit-recompile applies fixits and recompiles the result -fixit-to-temporary applies fixits to temporary files -fix-only-warnings">, applies fixits for warnings only, not errors Combining "-fixit-recompile -fixit-to-temporary" allows testing the result of fixits without touching the original sources. llvm-svn: 149027
* Fix -fmacro-backtrace-limit=0 to show the entire macro backtrace.Ted Kremenek2012-01-251-1/+2
| | | | llvm-svn: 148930
* Rework the external Sema source's ReadMethodPool() so that it doesn'tDouglas Gregor2012-01-251-3/+2
| | | | | | | return pre-built lists. Instead, it feeds the methods it deserializes to Sema so that Sema can unique them, which keeps the chains shorter. llvm-svn: 148889
* arc migrator: Provide infrastructure to add optionsFariborz Jahanian2012-01-251-0/+6
| | | | | | | | | specific to migrator. Use its first option to warn migrating from GC to arc when NSAllocateCollectable/NSReallocateCollectable is used. // rdar://10532541 llvm-svn: 148887
* Improve Lexer::getImmediateMacroName to take into account inner macrosArgyrios Kyrtzidis2012-01-231-1/+38
| | | | | | | | | of macro arguments. For "MAC1( MAC2(foo) )" and location of 'foo' token it would return "MAC1" instead of "MAC2". llvm-svn: 148704
* Add support for -fno-optimize-sibling-calls. Currently only implemented in theNick Lewycky2012-01-231-0/+3
| | | | | | X86 backend in LLVM. llvm-svn: 148689
* lib/Frontend/InitHeaderSearch.cpp: [Cygwin] Add 4.5.3.NAKAMURA Takumi2012-01-211-0/+1
| | | | llvm-svn: 148637
* [Cygwin] Abandon Cygwin-1.5 and g++-3. Use g++-4.3 and higher on Cygwin-1.7.NAKAMURA Takumi2012-01-211-2/+0
| | | | llvm-svn: 148636
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-2/+0
| | | | llvm-svn: 148577
* Extract the (InputKind, std::string) pair used to describe inputs toDouglas Gregor2012-01-208-69/+61
| | | | | | | the front end into its own class, FrontendInputFile, to make it easier to introduce new per-input data. No functionality change. llvm-svn: 148546
* Refactor: Pull getImmediateMacroName() out of DiagnosticRenderer andAnna Zaks2012-01-181-30/+1
| | | | | | into Lexer and Preprocessor; making it widely available. llvm-svn: 148410
* [libclang] Make sure Preprocessor is set in ASTUnit during indexing.Argyrios Kyrtzidis2012-01-171-0/+2
| | | | llvm-svn: 148319
* Treat -Wformat=0 as an alias for -Wformat.Hans Wennborg2012-01-171-0/+4
| | | | | | Fixes PR9195. llvm-svn: 148300
* Remove unnecessary default cases in switches over enums.David Blaikie2012-01-173-5/+3
| | | | | | This allows -Wswitch-enum to find switches that need updating when these enums are modified. llvm-svn: 148281
* Some improvements to the handling of C11 atomic types:David Chisnall2012-01-161-0/+8
| | | | | | | | | | | | | | | | | | - Add atomic-to/from-nonatomic cast types - Emit atomic operations for arithmetic on atomic types - Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load - Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function. - Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it. Still to do: - Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg. - Add a signal fence builtin - Properly set the fenv state in atomic operations on floating point values - Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context) - Fix the many remaining corner cases llvm-svn: 148242
* When loading an AST file, set SourceManager::MainFileID to the main file of ↵Argyrios Kyrtzidis2012-01-051-10/+1
| | | | | | | | the AST file, as suggested by Tom Honermann. llvm-svn: 147612
* When generating includes for all of the headers we found in anDouglas Gregor2012-01-051-3/+13
| | | | | | | umbrella directory, skip includes for any headers that are part of an unavailable module. llvm-svn: 147572
* Store the submodules of a module in source order, as they are storedDouglas Gregor2012-01-042-16/+17
| | | | | | | | in the module map. This provides a bit more predictability for the user, as well as eliminating the need to sort the submodules when serializing them. llvm-svn: 147564
* Add a "Modules" language option, which subsumes the previousDouglas Gregor2012-01-032-5/+3
| | | | | | "AutoModuleImport" preprocessor option and is tied to -fmodules. llvm-svn: 147448
* Rename the command-line option for mapping #include/#import over toDouglas Gregor2012-01-031-1/+1
| | | | | | | | module imports from -fauto-module-import to -fmodules. The new name will eventually be used to enable modules, and the #include/#import mapping is a crucial part of the feature. llvm-svn: 147447
OpenPOWER on IntegriCloud