diff options
author | Mandeep Singh Grang <mgrang@codeaurora.org> | 2016-12-06 02:49:16 +0000 |
---|---|---|
committer | Mandeep Singh Grang <mgrang@codeaurora.org> | 2016-12-06 02:49:16 +0000 |
commit | e9895ed59a7f1c28e4e70d8ea249b5f4803dbc7f (patch) | |
tree | 88b7a1de2f16c404b4317c32b8dc224c750370d7 /tools/driver | |
parent | 39afaeb8ccba8ca420d079543bc79ccb750e09e1 (diff) |
[clang] Fix D26214: Move error handling out of MC and to the callers.
Summary: Related llvm patch: https://reviews.llvm.org/D27359
Reviewers: echristo, t.p.northover, rengolin, grosbach, compnerd
Subscribers: mehdi_amini, cfe-commits, llvm-commits
Tags: #clang-c
Differential Revision: https://reviews.llvm.org/D27360
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver')
-rw-r--r-- | tools/driver/cc1as_main.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp index c9361541cd..263751346b 100644 --- a/tools/driver/cc1as_main.cpp +++ b/tools/driver/cc1as_main.cpp @@ -426,10 +426,13 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts, // Set values for symbols, if any. for (auto &S : Opts.SymbolDefs) { - if (Ctx.setSymbolValue(Parser->getStreamer(), S)) { - Failed = true; - break; - } + auto Pair = StringRef(S).split('='); + auto Sym = Pair.first; + auto Val = Pair.second; + int64_t Value; + // We have already error checked this in the driver. + Val.getAsInteger(0, Value); + Ctx.setSymbolValue(Parser->getStreamer(), Sym, Value); } if (!Failed) { |