Rafael Espindola
2f16bc1095
Use raw_pwrite_stream in clang.
...
This is a small improvement to -emit-pth and allows llvm to start requiring it.
llvm-svn: 234897
2015-04-14 15:15:49 +00:00
Rafael Espindola
7e556adddd
Propagate usage of std:unique_ptr a bit. NFC.
...
llvm-svn: 234538
2015-04-09 21:50:11 +00:00
Rafael Espindola
4dedcd7eab
Update for LLVM api changes.
...
llvm-svn: 234536
2015-04-09 21:06:11 +00:00
Eric Christopher
7e0fadf837
Update for llvm commit r233648.
...
llvm-svn: 233649
2015-03-31 00:10:23 +00:00
Rafael Espindola
e9ad54b3ee
Update for llvm api change.
...
llvm-svn: 232843
2015-03-20 20:00:30 +00:00
Rafael Espindola
55cfaa2552
Update for llvm API change.
...
llvm-svn: 232430
2015-03-16 22:30:13 +00:00
Eric Christopher
e0646e6a0a
Update clang for llvm r231861.
...
llvm-svn: 231862
2015-03-10 22:03:27 +00:00
Rafael Espindola
d465be8ebd
Update for llvm api change.
...
llvm-svn: 219800
2014-10-15 16:12:57 +00:00
Joerg Sonnenberger
a43604ad50
Convert MC command line flag for fatal assembler warnings into a proper
...
flag.
llvm-svn: 216472
2014-08-26 18:40:25 +00:00
Rafael Espindola
dae941a6c8
Update for llvm api change.
...
llvm-svn: 216397
2014-08-25 18:17:04 +00:00
David Blaikie
9e095d9b6b
Update Clang for LLVM API change to use unique_ptr in SourceManager::AddNewSourceBuffer
...
llvm-svn: 216226
2014-08-21 21:01:00 +00:00
Sean Silva
070cd2d9d4
ArrayRef'ize
...
I've shied away from ArrayRef'izing CompilerInvocation::CreateFromArgs
in this commit because that is a less localized change.
llvm-svn: 215773
2014-08-15 21:38:36 +00:00
Alp Toker
532e5b97d4
Remove dead code from r212620
...
llvm-svn: 212622
2014-07-09 14:09:52 +00:00
Alp Toker
61dad75b10
cc1as: consolidate option flags with cc1 and eliminate duplication
...
The clang -cc1as options are nearly a strict subset of -cc1. Instead of
duplicating the definitions and documentation, let's go ahead and share the
definitions in a similar way the current handling of combined driver and
frontend flags, eliminating some of the vestigial legacy surrounding the
assembler subcommand.
llvm-svn: 212620
2014-07-09 14:05:11 +00:00
Rafael Espindola
2d2b420ab9
Update for llvm api change.
...
llvm-svn: 212408
2014-07-06 17:43:24 +00:00
Rafael Espindola
8e650d7bf0
Refer to error_code with the std prefix.
...
llvm-svn: 210817
2014-06-12 20:37:59 +00:00
Rafael Espindola
8a8e554adc
Include system_error directly.
...
llvm-svn: 210802
2014-06-12 17:19:42 +00:00
Craig Topper
69186e731f
[C++11] Use 'nullptr'. Tools edition.
...
llvm-svn: 210422
2014-06-08 08:38:04 +00:00
Alp Toker
4429314aef
cc1as: invert return bool to indicate failure
...
This simplifies code flow and matches the convention used in surrounding code.
No functional change.
llvm-svn: 209936
2014-05-31 00:02:27 +00:00
Alp Toker
e98ea7c9b6
cc1as: fix a potential leak and unremoved output file in error conditions
...
llvm-svn: 209935
2014-05-31 00:02:21 +00:00
Oliver Stannard
9b2a7d4f2d
Pass -gdwarf-N options to integrated assembler
...
llvm-svn: 209124
2014-05-19 13:39:13 +00:00
Rafael Espindola
9b74ec415b
Update for llvm api change.
...
llvm-svn: 208206
2014-05-07 13:00:49 +00:00
Evgeniy Stepanov
eeb820f572
Update Target::createMCAsmParser calls for the LLVM interface change.
...
Patch by Yuri Gorshenin.
llvm-svn: 206970
2014-04-23 11:15:49 +00:00
David Blaikie
b31e1d16df
Comment necessity of early initialization
...
Code review feedback from Eric Christopher on r204261.
I didn't want to go into too much detail (the revision history should
provide the full stuff) - but I can add more if that's preferred.
Also moved this up to right by the construction of the MCAsmInfo so
there's less chance that other things might sneak in in between.
llvm-svn: 205267
2014-03-31 23:47:13 +00:00
David Blaikie
07b8d4e6ed
DebugInfo compression: Enable compression before any sections are created.
...
For those playing at home this produced some fairly subtle behavior. The
sections created in InitMCObjectFileInfo were created without compressed
debug info (a mistake, but not necessarily /broken). Since these
sections were almost always referenced by the existing MCSection object,
this almost worked.
This got weird when we got to handling the relocations for a section.
See ELFObjectWriter::WriteSection where we compute the true section for
a relocation section by simply stripping the ".rela" prefix and then
looking up that section - doing so hit the compression codepath, looked
up .zdebug_blah and found a newly constructed empty section... thus,
things got weird.
This is untestable without a cross-project test (let me know if people
would prefer that to no testing).
llvm-svn: 205261
2014-03-31 23:13:30 +00:00
David Blaikie
7e2fd943ae
Support for -Wa,-compress-debug-sections.
...
Also, while I'm here, support -nocompress-debug-sections too.
llvm-svn: 204959
2014-03-27 20:47:30 +00:00
Ahmed Charles
dfca6f97bc
[C++11] Replace OwningPtr include with <memory>.
...
llvm-svn: 203389
2014-03-09 11:36:40 +00:00
Ahmed Charles
b89843299a
Replace OwningPtr with std::unique_ptr.
...
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.
llvm-svn: 203279
2014-03-07 20:03:18 +00:00
Ahmed Charles
9a16beb8bc
Change OwningPtr::take() to OwningPtr::release().
...
This is a precursor to moving to std::unique_ptr.
llvm-svn: 203275
2014-03-07 19:33:25 +00:00
Rafael Espindola
4fbd373815
Update for llvm api change.
...
llvm-svn: 202053
2014-02-24 18:20:21 +00:00
Rafael Espindola
c32818ac9b
Update for llvm api change.
...
llvm-svn: 200863
2014-02-05 18:00:26 +00:00
Rafael Espindola
d51906e5b3
Update for llvm api change.
...
llvm-svn: 200136
2014-01-26 06:39:14 +00:00
Bob Wilson
a1b4206a70
Fix up fallout from r187156.
...
The previous change caused the driver to translate -Wa,-L to the
-msave-temp-labels option for cc1as, but cc1as did not accept that option.
This patch follows the same approach used for similar options (-relax-all,
-noexecstack) in the previous patch.
llvm-svn: 191458
2013-09-26 21:00:51 +00:00
Joey Gouly
92dfcfa403
Fix the MCTargetAsmParser API change.
...
llvm-svn: 190601
2013-09-12 10:59:24 +00:00
Bill Wendling
5257538df9
Update to the new API interface which requires the MCRegisterInfo object. <rdar://problem/13623355>
...
llvm-svn: 190291
2013-09-09 02:37:56 +00:00
David Blaikie
9260ed6c06
Don't forward all assembler arguments untouched to -cc1as
...
Use the same filtering for assembly arguments to -cc1as as we do for
-cc1, this allows a consistent (& more useful) diagnostic experience for
users (rather than getting an error from -cc1as (which a user shouldn't
really be thinking about) about --foo, they get an error from clang
about --foo in -Wa,)
I'm sort of surprised by the separation of -cc1as & the separate
argument handling, etc, but at least this removes a little bit of the
duplication.
llvm-svn: 187156
2013-07-25 21:19:01 +00:00
Rafael Espindola
16125fb652
Update for llvm API change.
...
llvm-svn: 186448
2013-07-16 19:44:23 +00:00
Rafael Espindola
ccc6ea6c0b
Don't use PathV1.h in cc1as_main.cpp.
...
llvm-svn: 184938
2013-06-26 12:48:34 +00:00
Bill Wendling
da1e3e737a
Update to pass in pointers intead of references.
...
llvm-svn: 184176
2013-06-18 07:22:05 +00:00
Reid Kleckner
898229ab4b
[Driver] Refactor clang driver to use LLVM's Option library
...
The big changes are:
- Deleting Driver/(Arg|Opt)*
- Rewriting includes to llvm/Option/ and re-sorting
- 'using namespace llvm::opt' in clang::driver
- Fixing the autoconf build by adding option everywhere
As discussed in the review, this change includes using directives in
header files. I'll make follow up changes to remove those in favor of
name specifiers.
Reviewers: espindola
Differential Revision: http://llvm-reviews.chandlerc.com/D975
llvm-svn: 183989
2013-06-14 17:17:23 +00:00
Rafael Espindola
dcf73d2275
Don't depend on the transitive inclusion of PathV1.h.
...
llvm-svn: 183945
2013-06-13 21:09:29 +00:00
Rafael Espindola
18556de316
Use the sys::RemoveFileOnSignal that takes a StringRef.
...
llvm-svn: 183944
2013-06-13 21:02:40 +00:00
Rafael Espindola
77056237d7
Update for LLVM interface change in r181680.
...
llvm-svn: 181681
2013-05-13 01:24:18 +00:00
Chad Rosier
05c71aa745
Update the error handing static functions for r178161.
...
Part of rdar://13296693
llvm-svn: 178162
2013-03-27 18:28:23 +00:00
Kevin Enderby
ae2ec4745f
We want the dwarf AT_producer for assembly source files to match clang's
...
AT_producer. Which includes clang's version information so we can tell
which version of the compiler was used.
This is second of the two steps to allow us to do this. The first was a
change to llvm-mc with revision 172630 to provide a method to set the
AT_producer string. This second step has the clang driver passing the value
of getClangFullVersion() via the new flag -dwarf-debug-producer when invoking
the integrated assembler on assembly source files. Then using the new
setDwarfDebugProducer() method to set the AT_producer string.
rdar://12888242
llvm-svn: 172758
2013-01-17 21:38:06 +00:00
Chandler Carruth
ffd5551bc7
Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
...
reflect the migration in r171366.
Re-sort the #include lines to reflect the new paths.
llvm-svn: 171369
2013-01-02 11:45:17 +00:00
Eric Christopher
45f2e71571
Add support for passing the main file name down to the assembler
...
for location information.
Part of PR14624
llvm-svn: 170391
2012-12-18 00:31:10 +00:00
Chandler Carruth
4d5e1a9b34
Fix PR14625 by teaching the driver to detect PWD for assembly files.
...
This also requires adding support to -cc1as for passing the detecting
PWD down through LLVM's debug info (which in turn required the LLVM
change in r170371).
The test case is weak (we only test the driver behavior) because there
is currently to infrastructure for running cc1as in the test suite. So
those four lines are untested (much like all other lines in that file),
but we have a test for the same pattern using llvm-mc in the LLVM
repository.
llvm-svn: 170373
2012-12-17 21:40:04 +00:00
Chandler Carruth
cc0694c8a4
Sort #include lines for tools/...
...
Completely automated with sort_includes.py
llvm-svn: 169240
2012-12-04 09:25:21 +00:00
Richard Smith
bd55daf2ee
Remove first argument from Arg::getValue; it's been unused since r105760.
...
llvm-svn: 167211
2012-11-01 04:30:05 +00:00
Douglas Gregor
811db4eac4
Make DiagnosticOptions intrusively reference-counted, and make sure
...
the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.
llvm-svn: 166508
2012-10-23 22:26:28 +00:00
Micah Villmow
dd31ca10ef
Move TargetData to DataLayout.
...
llvm-svn: 165395
2012-10-08 16:25:52 +00:00
Roman Divacky
5bebfb7363
Follow up on llvm r164132.
...
llvm-svn: 164133
2012-09-18 16:09:16 +00:00
Jim Grosbach
490950a928
Allow MCCodeEmitter access to the target MCRegisterInfo.
...
Add MRI to the createMCCodeEmitter() call.
llvm-svn: 156830
2012-05-15 17:36:07 +00:00
Bill Wendling
f4ec97d9b0
Fix build by passing in the needed variable after r153860.
...
llvm-svn: 153861
2012-04-02 06:17:37 +00:00
Jim Grosbach
6c258a891f
Add MCRegisterInfo to the MCInstPrinter factory function interface.
...
llvm-svn: 152046
2012-03-05 19:33:41 +00:00
Dylan Noblesmith
c95d81924d
Basic: import IntrusiveRefCntPtr<> into clang namespace
...
The class name is long enough without the llvm:: added.
Also bring in RefCountedBase and RefCountedBaseVPTR.
llvm-svn: 150958
2012-02-20 14:00:23 +00:00
Dylan Noblesmith
1cd1069b68
drop more llvm:: prefixes on OwningPtr<>
...
More cleanup after r149798.
llvm-svn: 150379
2012-02-13 12:32:21 +00:00
Jim Grosbach
576452b830
Have the driver pass CPU and target feature information to cc1as.
...
When creating the MCSubtargetInfo, the assembler driver uses the CPU and
feature string to construct a more accurate model of what instructions
are and are not legal.
rdar://10840476
llvm-svn: 150273
2012-02-10 20:37:10 +00:00
David Blaikie
09d20eefaa
Make use of const-correct ParseCommandLineOptions
...
llvm-svn: 150000
2012-02-07 19:36:38 +00:00
Jim Grosbach
ff3789a6bb
Pass the SourceMgr to the MCContext for cc1as.
...
llvm-svn: 149608
2012-02-02 17:54:07 +00:00
Dylan Noblesmith
68207c0b26
driver: fix unused variable warning
...
from r147218.
llvm-svn: 147278
2011-12-26 19:29:47 +00:00
Dylan Noblesmith
e99b27f35e
Let CompilerInvocation initialization indicate failure
...
This fixes the FIXMEs in ParseAnalyzeArgs. (Also a
precursor to moving the analyzer into an AST plugin.)
For consistency, do the same with AssemblerInvocation.
llvm-svn: 147218
2011-12-23 03:05:38 +00:00
Kevin Enderby
292dc080e0
Last part of support for generating dwarf for assembly source files. This gets
...
the clang driver to enable this when assembling a .s file. rdar://9275556
llvm-svn: 147167
2011-12-22 19:31:58 +00:00
Sebastian Pop
8188c8a1f3
rename getHostTriple into getDefaultTargetTriple in clang
...
llvm-svn: 143503
2011-11-01 21:33:06 +00:00
Nick Lewycky
1d617acef9
Wire up support for the controlling the extended dwarf .file directive. With
...
r142300 but not this patch, clang -S may emit .s files that assemblers other
than llvm-mc can't parse.
llvm-svn: 142301
2011-10-17 23:05:52 +00:00
David Blaikie
9c902b5502
Rename Diagnostic to DiagnosticsEngine as per issue 5397
...
llvm-svn: 140478
2011-09-25 23:23:43 +00:00
James Molloy
98f3e18f25
Fix up MCInstPrinter creation to take the new SubtargetInfo parameter (see LLVM r139237)
...
llvm-svn: 139238
2011-09-07 17:25:30 +00:00
Evan Cheng
494eb062b5
Match LLVM change: TargetRegistry and TargetSelect have been moved to Support.
...
llvm-svn: 138451
2011-08-24 18:09:14 +00:00
Jim Grosbach
acb07b599c
Update createMCAsmParser() to match r137735.
...
llvm-svn: 137736
2011-08-16 18:33:55 +00:00
Evan Cheng
5a7a4ea505
Assembler really doesn't need to create TargetMachine anymore.
...
llvm-svn: 136045
2011-07-26 01:49:26 +00:00
Evan Cheng
9568f27950
Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to createMCObjectStreamer.
...
llvm-svn: 136032
2011-07-26 00:42:40 +00:00
Evan Cheng
939f809ce9
Rename createAsmParser to createMCAsmParser.
...
llvm-svn: 136029
2011-07-26 00:24:45 +00:00
Evan Cheng
4b89983662
Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
...
llvm-svn: 136011
2011-07-25 23:25:09 +00:00
Evan Cheng
c2d8c6be92
Assembler doesn't need to initialize TargetMachine's anymore.
...
llvm-svn: 135964
2011-07-25 20:53:26 +00:00
Evan Cheng
06e70d33fc
Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.
...
llvm-svn: 135834
2011-07-23 00:45:53 +00:00
Evan Cheng
c391a58b2b
Match LLVM API change.
...
llvm-svn: 135813
2011-07-22 21:59:11 +00:00
Evan Cheng
b5517a4d8c
Match MCContext change.
...
llvm-svn: 135612
2011-07-20 19:53:19 +00:00
Evan Cheng
347033fd8b
Match LLVM API change.
...
llvm-svn: 135570
2011-07-20 06:22:27 +00:00
Evan Cheng
3f37dd065b
Match createTargetMachine API change.
...
llvm-svn: 135469
2011-07-19 06:37:41 +00:00
Evan Cheng
b505ace101
MCContext now takes MCRegisterInfo.
...
llvm-svn: 135425
2011-07-18 20:57:51 +00:00
Evan Cheng
6d188f5f1c
Match llvm API change.
...
llvm-svn: 135220
2011-07-14 23:50:56 +00:00
Evan Cheng
279f2907ed
Match createCodeEmitter change.
...
llvm-svn: 134885
2011-07-11 04:24:19 +00:00
Joerg Sonnenberger
e3531fcf88
Unbreak -cc1as mode after MC subtarget changes
...
llvm-svn: 134877
2011-07-10 19:16:25 +00:00
Evan Cheng
dec3187e7f
createAsmParser API change.
...
llvm-svn: 134797
2011-07-09 06:04:17 +00:00
Chandler Carruth
961995dc9a
Update the creation of the TargetAsmParser based on API change in r134678.
...
llvm-svn: 134680
2011-07-08 03:15:48 +00:00
Evan Cheng
299b36fa72
createMCInstPrinter doesn't need TargetMachine anymore.
...
llvm-svn: 134526
2011-07-06 19:45:57 +00:00
Evan Cheng
adc7959851
createTargetMachine now takes a CPU string.
...
llvm-svn: 134128
2011-06-30 02:06:32 +00:00
Joerg Sonnenberger
b487d2d815
Support -fatal-warnings for the assembler frontend
...
llvm-svn: 131662
2011-05-19 18:42:29 +00:00
Rafael Espindola
26cdfa71ef
Update API.
...
llvm-svn: 130588
2011-04-30 03:46:18 +00:00
Daniel Dunbar
9cf7bc7a6c
Frontend/cc1as: Add support for -L.
...
llvm-svn: 128432
2011-03-28 22:49:24 +00:00
Bill Wendling
a8da50d011
Pass in the TargetMachine parameter to the inst printer.
...
llvm-svn: 127987
2011-03-21 05:02:03 +00:00
Rafael Espindola
148141c98f
Add support for the --noexecstack option. Fixes PR8762.
...
llvm-svn: 124078
2011-01-23 17:58:26 +00:00
Michael J. Spencer
d9da7a1f16
MemoryBuffer API update.
...
llvm-svn: 121956
2010-12-16 03:28:14 +00:00
Daniel Dunbar
8f514a8826
Update for LLVM API change.
...
llvm-svn: 121950
2010-12-16 03:06:05 +00:00
Rafael Espindola
86f2c57c8d
Fixed version of 121435.
...
llvm-svn: 121472
2010-12-10 07:40:14 +00:00
Rafael Espindola
33f793892f
Revert my previous patch to make the valgrind bots happy.
...
llvm-svn: 121460
2010-12-10 04:01:05 +00:00
Rafael Espindola
40fa9b6765
Update clang for the API changes in the cfi patch.
...
llvm-svn: 121435
2010-12-09 23:48:34 +00:00
Michael J. Spencer
f25faaaffb
Use error_code instead of std::string* for MemoryBuffer.
...
llvm-svn: 121378
2010-12-09 17:36:38 +00:00
Michael J. Spencer
8aaf49959c
Merge System into Support.
...
llvm-svn: 120297
2010-11-29 18:12:39 +00:00
Argyrios Kyrtzidis
5c26cda273
getNumErrors() -> hasErrorOccurred()
...
llvm-svn: 119765
2010-11-19 00:19:18 +00:00
Argyrios Kyrtzidis
d004064864
Refactoring of Diagnostic class.
...
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.
llvm-svn: 119730
2010-11-18 20:06:41 +00:00
Rafael Espindola
85111907bb
Call InitSections when assembling. This makes clang's output match that of
...
llvm-mc.
llvm-svn: 116405
2010-10-13 14:53:57 +00:00
Duncan Sands
f610b5b622
Straighten out target triples provided on the command line
...
before using them.
llvm-svn: 112468
2010-08-30 09:42:39 +00:00
Douglas Gregor
2dd19f1d5f
Simplify the ownership model for DiagnosticClients, which was really
...
convoluted and a bit leaky. Now, the Diagnostic object owns its
DiagnosticClient.
llvm-svn: 111437
2010-08-18 22:29:43 +00:00
Dan Gohman
b37af7de47
Call llvm::remove_fatal_error_handler before deallocating objects
...
which are used by the error handling functions.
llvm-svn: 111427
2010-08-18 21:23:17 +00:00
Benjamin Kramer
4b5de0d6a3
Prepare for upcoming ownership change.
...
llvm-svn: 109766
2010-07-29 17:48:03 +00:00
Daniel Dunbar
deaff5d792
Update for LLVM API change.
...
llvm-svn: 108665
2010-07-19 00:33:53 +00:00
Daniel Dunbar
05474285aa
clang -cc1as: Switch to using AsmParser constructor function.
...
llvm-svn: 108605
2010-07-17 02:26:21 +00:00
Daniel Dunbar
a2b1f8b5cd
MC: Pass the target instance to the AsmParser constructor.
...
llvm-svn: 107427
2010-07-01 20:41:59 +00:00
Daniel Dunbar
a442fd5da6
Driver: Fix arg_iterator typing to reflect that it is really an iterator over Arg*s.
...
llvm-svn: 105838
2010-06-11 22:00:13 +00:00
Daniel Dunbar
0454f657ce
clang -cc1as: Add -help, -version, and -mllvm support.
...
Also, fix output defaulting to match llvm-mc.
llvm-svn: 104246
2010-05-20 18:15:20 +00:00
Daniel Dunbar
2fcaa549a8
Driver/MC: Add 'clang -cc1as' integrated assembler tool, currently accepts approximately the same interface as 'llvm-mc'.
...
llvm-svn: 104239
2010-05-20 17:49:16 +00:00